diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-08-22 22:44:22 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-08-22 22:44:22 +0000 |
commit | cd13f0e77660088ac8df013a4aa52aa32f5009b6 (patch) | |
tree | 0a8c61463bd806338ecf1bca0d7e131d01b36676 /service | |
parent | f6e0f26cc0823b628f887c651a906fa3ebbab070 (diff) | |
parent | 2946076de20c9a6bf101eb2f453c4ef952280ff2 (diff) |
Merge "Remove wificond related code from RttService" into oc-mr1-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/RttService.java | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/service/java/com/android/server/wifi/RttService.java b/service/java/com/android/server/wifi/RttService.java index b96c1862b..bd2736726 100644 --- a/service/java/com/android/server/wifi/RttService.java +++ b/service/java/com/android/server/wifi/RttService.java @@ -6,11 +6,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; -import android.net.wifi.IApInterface; -import android.net.wifi.IClientInterface; -import android.net.wifi.IInterfaceEventCallback; import android.net.wifi.IRttManager; -import android.net.wifi.IWificond; import android.net.wifi.RttManager; import android.net.wifi.RttManager.ResponderConfig; import android.net.wifi.WifiManager; @@ -41,14 +37,12 @@ import java.io.PrintWriter; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; -import java.util.List; import java.util.Queue; import java.util.Set; public final class RttService extends SystemService { public static final boolean DBG = true; - private static final String WIFICOND_SERVICE_NAME = "wificond"; static class RttServiceImpl extends IRttManager.Stub { private int mCurrentKey = 100; // increment on each usage @@ -364,37 +358,11 @@ public final class RttService extends SystemService { private static final int CMD_DRIVER_UNLOADED = BASE + 1; private static final int CMD_ISSUE_NEXT_REQUEST = BASE + 2; private static final int CMD_RTT_RESPONSE = BASE + 3; - private static final int CMD_CLIENT_INTERFACE_READY = BASE + 4; - private static final int CMD_CLIENT_INTERFACE_DOWN = BASE + 5; // Maximum duration for responder role. private static final int MAX_RESPONDER_DURATION_SECONDS = 60 * 10; - private static class InterfaceEventHandler extends IInterfaceEventCallback.Stub { - InterfaceEventHandler(RttStateMachine rttStateMachine) { - mRttStateMachine = rttStateMachine; - } - @Override - public void OnClientTorndownEvent(IClientInterface networkInterface) { - mRttStateMachine.sendMessage(CMD_CLIENT_INTERFACE_DOWN, networkInterface); - } - @Override - public void OnClientInterfaceReady(IClientInterface networkInterface) { - mRttStateMachine.sendMessage(CMD_CLIENT_INTERFACE_READY, networkInterface); - } - @Override - public void OnApTorndownEvent(IApInterface networkInterface) { } - @Override - public void OnApInterfaceReady(IApInterface networkInterface) { } - - private RttStateMachine mRttStateMachine; - } - class RttStateMachine extends StateMachine { - private IWificond mWificond; - private InterfaceEventHandler mInterfaceEventHandler; - private IClientInterface mClientInterface; - DefaultState mDefaultState = new DefaultState(); EnabledState mEnabledState = new EnabledState(); InitiatorEnabledState mInitiatorEnabledState = new InitiatorEnabledState(); @@ -456,39 +424,9 @@ public final class RttService extends SystemService { class EnabledState extends State { @Override public void enter() { - // This allows us to tolerate wificond restarts. - // When wificond restarts WifiStateMachine is supposed to go - // back to initial state and restart. - // 1) RttService watches for WIFI_STATE_ENABLED broadcasts - // 2) WifiStateMachine sends these broadcasts in the SupplicantStarted state - // 3) Since WSM will only be in SupplicantStarted for as long as wificond is - // alive, we refresh our wificond handler here and we don't subscribe to - // wificond's death explicitly. - mWificond = mWifiInjector.makeWificond(); - if (mWificond == null) { - Log.w(TAG, "Failed to get wificond binder handler"); - transitionTo(mDefaultState); - } - mInterfaceEventHandler = new InterfaceEventHandler(mStateMachine); - try { - mWificond.RegisterCallback(mInterfaceEventHandler); - // Get the current client interface, assuming there is at most - // one client interface for now. - List<IBinder> interfaces = mWificond.GetClientInterfaces(); - if (interfaces.size() > 0) { - mStateMachine.sendMessage( - CMD_CLIENT_INTERFACE_READY, - IClientInterface.Stub.asInterface(interfaces.get(0))); - } - } catch (RemoteException e1) { } - } @Override public void exit() { - try { - mWificond.UnregisterCallback(mInterfaceEventHandler); - } catch (RemoteException e1) { } - mInterfaceEventHandler = null; } @Override public boolean processMessage(Message msg) { @@ -552,14 +490,6 @@ public final class RttService extends SystemService { break; case RttManager.CMD_OP_DISABLE_RESPONDER: break; - case CMD_CLIENT_INTERFACE_DOWN: - if (mClientInterface == (IClientInterface) msg.obj) { - mClientInterface = null; - } - break; - case CMD_CLIENT_INTERFACE_READY: - mClientInterface = (IClientInterface) msg.obj; - break; default: return NOT_HANDLED; } |