diff options
author | Jimmy Chen <jimmycmchen@google.com> | 2018-11-05 16:17:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-11-05 16:17:18 +0000 |
commit | 163e683668606f6b0a30535fb2e4219d0e0180a5 (patch) | |
tree | dd851040a7780adc7af66ee31fe1a4a0973cd743 /service | |
parent | b7ebdfc8f1b12864f180fdc6f444954b6525de41 (diff) | |
parent | 6d9d62a0edf91ec72639556e0d3a36be4b4ba501 (diff) |
Merge "ClientModeImpl: Remove CMD_ENABLE_P2P & CMD_DISABLE_P2P with P2P service"
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 48 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java | 15 |
2 files changed, 0 insertions, 63 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index d79d37806..dd852945b 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -503,20 +503,6 @@ public class ClientModeImpl extends StateMachine { int mDisconnectingWatchdogCount = 0; static final int DISCONNECTING_GUARD_TIMER_MSEC = 5000; - /* Disable p2p watchdog */ - static final int CMD_DISABLE_P2P_WATCHDOG_TIMER = BASE + 112; - - int mDisableP2pWatchdogCount = 0; - static final int DISABLE_P2P_GUARD_TIMER_MSEC = 2000; - - /* P2p commands */ - /* We are ok with no response here since we wont do much with it anyway */ - public static final int CMD_ENABLE_P2P = BASE + 131; - /* In order to shut down supplicant cleanly, we wait till p2p has - * been disabled */ - public static final int CMD_DISABLE_P2P_REQ = BASE + 132; - public static final int CMD_DISABLE_P2P_RSP = BASE + 133; - /** * Indicates the end of boot process, should be used to trigger load from config store, * initiate connection attempt, etc. @@ -2339,13 +2325,6 @@ public class ClientModeImpl extends StateMachine { sb.append(Integer.toString(msg.arg2)); sb.append(" cur=").append(mDisconnectingWatchdogCount); break; - case CMD_DISABLE_P2P_WATCHDOG_TIMER: - sb.append(" "); - sb.append(Integer.toString(msg.arg1)); - sb.append(" "); - sb.append(Integer.toString(msg.arg2)); - sb.append(" cur=").append(mDisableP2pWatchdogCount); - break; case CMD_START_RSSI_MONITORING_OFFLOAD: case CMD_STOP_RSSI_MONITORING_OFFLOAD: case CMD_RSSI_THRESHOLD_BREACHED: @@ -3204,15 +3183,6 @@ public class ClientModeImpl extends StateMachine { if (ac == mWifiP2pChannel) { if (message.arg1 == AsyncChannel.STATUS_SUCCESSFUL) { p2pSendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION); - // since the p2p channel is connected, we should enable p2p if we are in - // connect mode. We may not be in connect mode yet, we may have just - // set the operational mode and started to set up for connect mode. - if (mOperationalMode == CONNECT_MODE) { - // This message will only be handled if we are in Connect mode. - // If we are not in connect mode yet, this will be dropped and the - // ConnectMode.enter method will call to enable p2p. - sendMessage(CMD_ENABLE_P2P); - } } else { // TODO: We should probably do some cleanup or attempt a retry // b/34283611 @@ -3305,8 +3275,6 @@ public class ClientModeImpl extends StateMachine { case DhcpClient.CMD_PRE_DHCP_ACTION: case DhcpClient.CMD_PRE_DHCP_ACTION_COMPLETE: case DhcpClient.CMD_POST_DHCP_ACTION: - case CMD_ENABLE_P2P: - case CMD_DISABLE_P2P_RSP: case WifiMonitor.SUP_REQUEST_IDENTITY: case WifiMonitor.SUP_REQUEST_SIM_AUTH: case CMD_TARGET_BSSID: @@ -3316,7 +3284,6 @@ public class ClientModeImpl extends StateMachine { case CMD_UNWANTED_NETWORK: case CMD_DISCONNECTING_WATCHDOG_TIMER: case CMD_ROAM_WATCHDOG_TIMER: - case CMD_DISABLE_P2P_WATCHDOG_TIMER: case CMD_DISABLE_EPHEMERAL_NETWORK: mMessageHandlingStatus = MESSAGE_HANDLING_STATUS_DISCARD; break; @@ -3635,10 +3602,6 @@ public class ClientModeImpl extends StateMachine { mWifiNative.setPowerSave(mInterfaceName, true); - if (mP2pSupported) { - p2pSendMessage(ClientModeImpl.CMD_ENABLE_P2P); - } - // Disable wpa_supplicant from auto reconnecting. mWifiNative.enableStaAutoReconnect(mInterfaceName, false); // STA has higher priority over P2P @@ -3652,12 +3615,6 @@ public class ClientModeImpl extends StateMachine { // exiting supplicant started state is now only applicable to client mode mWifiDiagnostics.stopLogging(); - if (mP2pSupported) { - // we are not going to wait for a response - will still temporarily send the - // disable command until p2p can detect the interface up/down on its own. - p2pSendMessage(ClientModeImpl.CMD_DISABLE_P2P_REQ); - } - mIsRunning = false; updateBatteryWorkSource(null); @@ -3754,8 +3711,6 @@ public class ClientModeImpl extends StateMachine { // Inform metrics that Wifi is Enabled (but not yet connected) mWifiMetrics.setWifiState(WifiMetricsProto.WifiLog.WIFI_DISCONNECTED); mWifiMetrics.logStaEvent(StaEvent.TYPE_WIFI_ENABLED); - // Inform p2p service that wifi is up and ready when applicable - p2pSendMessage(ClientModeImpl.CMD_ENABLE_P2P); // Inform sar manager that wifi is Enabled mSarManager.setClientWifiState(WifiManager.WIFI_STATE_ENABLED); } @@ -4297,9 +4252,6 @@ public class ClientModeImpl extends StateMachine { replyToMessage(message, message.what, FAILURE); } break; - case CMD_ENABLE_P2P: - p2pSendMessage(ClientModeImpl.CMD_ENABLE_P2P); - break; case CMD_GET_ALL_MATCHING_CONFIGS: replyToMessage(message, message.what, mPasspointManager.getAllMatchingWifiConfigs((ScanResult) message.obj)); diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java index e7f3bc979..1a1ec8c4e 100644 --- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java +++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java @@ -79,7 +79,6 @@ import com.android.internal.util.AsyncChannel; import com.android.internal.util.Protocol; import com.android.internal.util.State; import com.android.internal.util.StateMachine; -import com.android.server.wifi.ClientModeImpl; import com.android.server.wifi.WifiInjector; import com.android.server.wifi.util.WifiAsyncChannel; import com.android.server.wifi.util.WifiHandler; @@ -978,11 +977,6 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { break; case DISABLE_P2P: // If we end up handling in default, p2p is not enabled - if (mWifiChannel != null) { - mWifiChannel.sendMessage(ClientModeImpl.CMD_DISABLE_P2P_RSP); - } else { - loge("Unexpected disable request when WifiChannel is null"); - } break; case WifiP2pMonitor.P2P_GROUP_STARTED_EVENT: // unexpected group created, remove @@ -1133,15 +1127,6 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { } return HANDLED; } - - @Override - public void exit() { - if (mWifiChannel != null) { - mWifiChannel.sendMessage(ClientModeImpl.CMD_DISABLE_P2P_RSP); - } else { - loge("P2pDisablingState exit(): WifiChannel is null"); - } - } } class P2pDisabledState extends State { |