Remove the DisabledState from NsdService

In order to increase the line coverage for the Connectivity
module, remove the DisabledState from NsdService which is
uselss for a while.

Bug: 234315786
Test: atest FrameworksNetTests CtsNetTestCases \
      ConnectivityCoverageTest
Change-Id: I29c7ef608d97037084b25daa70ad5829f474e20a
This commit is contained in:
Paul Hu
2022-05-31 06:48:57 +00:00
parent 875daa69eb
commit 29f4359856
2 changed files with 4 additions and 35 deletions

View File

@@ -100,7 +100,6 @@ public class NsdService extends INsdManager.Stub {
private class NsdStateMachine extends StateMachine {
private final DefaultState mDefaultState = new DefaultState();
private final DisabledState mDisabledState = new DisabledState();
private final EnabledState mEnabledState = new EnabledState();
@Override
@@ -151,7 +150,6 @@ public class NsdService extends INsdManager.Stub {
NsdStateMachine(String name, Handler handler) {
super(name, handler);
addState(mDefaultState);
addState(mDisabledState, mDefaultState);
addState(mEnabledState, mDefaultState);
State initialState = mEnabledState;
setInitialState(initialState);
@@ -249,25 +247,6 @@ public class NsdService extends INsdManager.Stub {
}
}
class DisabledState extends State {
@Override
public void enter() {
sendNsdStateChangeBroadcast(false);
}
@Override
public boolean processMessage(Message msg) {
switch (msg.what) {
case NsdManager.ENABLE:
transitionTo(mEnabledState);
break;
default:
return NOT_HANDLED;
}
return HANDLED;
}
}
class EnabledState extends State {
@Override
public void enter() {
@@ -311,10 +290,6 @@ public class NsdService extends INsdManager.Stub {
final int clientId = msg.arg2;
final ListenerArgs args;
switch (msg.what) {
case NsdManager.DISABLE:
//TODO: cleanup clients
transitionTo(mDisabledState);
break;
case NsdManager.DISCOVER_SERVICES:
if (DBG) Log.d(TAG, "Discover services");
args = (ListenerArgs) msg.obj;