Loading services/core/java/com/android/server/adb/AdbDebuggingManager.java +20 −3 Original line number Diff line number Diff line Loading @@ -543,6 +543,8 @@ public class AdbDebuggingManager { } } // TODO: Change the name of this method. This is not always a response. It should be called // sendMessage. void sendResponse(String msg) { synchronized (this) { Slog.d(TAG, "Send packet " + msg); Loading Loading @@ -772,6 +774,8 @@ public class AdbDebuggingManager { // === Messages we can send to adbd =========== static final String MSG_DISCONNECT_DEVICE = "DD"; static final String MSG_START_ADB_WIFI = "W1"; static final String MSG_STOP_ADB_WIFI = "W0"; @Nullable @VisibleForTesting AdbKeyStore mAdbKeyStore; Loading Loading @@ -822,6 +826,18 @@ public class AdbDebuggingManager { } } private void startAdbdWifi() { if (mThread != null) { mThread.sendResponse(MSG_START_ADB_WIFI); } } private void stopAdbdWifi() { if (mThread != null) { mThread.sendResponse(MSG_STOP_ADB_WIFI); } } private void startAdbDebuggingThread() { ++mAdbEnabledRefCount; Slog.i(TAG, "startAdbDebuggingThread ref=" + mAdbEnabledRefCount); Loading Loading @@ -1058,9 +1074,9 @@ public class AdbDebuggingManager { intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); mContext.registerReceiver(mBroadcastReceiver, intentFilter); SystemProperties.set(AdbService.WIFI_PERSISTENT_CONFIG_PROPERTY, "1"); startAdbDebuggingThread(); startAdbdWifi(); mAdbWifiEnabled = true; Slog.i(TAG, "adb start wireless adb"); Loading @@ -1074,6 +1090,8 @@ public class AdbDebuggingManager { setAdbConnectionInfo(null); mContext.unregisterReceiver(mBroadcastReceiver); stopAdbdWifi(); onAdbdWifiServerDisconnected(-1); stopAdbDebuggingThread(); break; Loading Loading @@ -1102,9 +1120,8 @@ public class AdbDebuggingManager { intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); mContext.registerReceiver(mBroadcastReceiver, intentFilter); SystemProperties.set(AdbService.WIFI_PERSISTENT_CONFIG_PROPERTY, "1"); startAdbDebuggingThread(); startAdbdWifi(); mAdbWifiEnabled = true; Slog.i(TAG, "adb start wireless adb"); Loading services/core/java/com/android/server/adb/AdbService.java +6 −1 Original line number Diff line number Diff line Loading @@ -210,7 +210,12 @@ public class AdbService extends IAdbManager.Stub { * May also contain vendor-specific default functions for testing purposes. */ private static final String USB_PERSISTENT_CONFIG_PROPERTY = "persist.sys.usb.config"; static final String WIFI_PERSISTENT_CONFIG_PROPERTY = "persist.adb.tls_server.enable"; /** * The system property used by both framework and adbd to set if ADB Wifi should be enabled * when either system starts up. */ private static final String WIFI_PERSISTENT_CONFIG_PROPERTY = "persist.adb.tls_server.enable"; private final Context mContext; private final ContentResolver mContentResolver; Loading Loading
services/core/java/com/android/server/adb/AdbDebuggingManager.java +20 −3 Original line number Diff line number Diff line Loading @@ -543,6 +543,8 @@ public class AdbDebuggingManager { } } // TODO: Change the name of this method. This is not always a response. It should be called // sendMessage. void sendResponse(String msg) { synchronized (this) { Slog.d(TAG, "Send packet " + msg); Loading Loading @@ -772,6 +774,8 @@ public class AdbDebuggingManager { // === Messages we can send to adbd =========== static final String MSG_DISCONNECT_DEVICE = "DD"; static final String MSG_START_ADB_WIFI = "W1"; static final String MSG_STOP_ADB_WIFI = "W0"; @Nullable @VisibleForTesting AdbKeyStore mAdbKeyStore; Loading Loading @@ -822,6 +826,18 @@ public class AdbDebuggingManager { } } private void startAdbdWifi() { if (mThread != null) { mThread.sendResponse(MSG_START_ADB_WIFI); } } private void stopAdbdWifi() { if (mThread != null) { mThread.sendResponse(MSG_STOP_ADB_WIFI); } } private void startAdbDebuggingThread() { ++mAdbEnabledRefCount; Slog.i(TAG, "startAdbDebuggingThread ref=" + mAdbEnabledRefCount); Loading Loading @@ -1058,9 +1074,9 @@ public class AdbDebuggingManager { intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); mContext.registerReceiver(mBroadcastReceiver, intentFilter); SystemProperties.set(AdbService.WIFI_PERSISTENT_CONFIG_PROPERTY, "1"); startAdbDebuggingThread(); startAdbdWifi(); mAdbWifiEnabled = true; Slog.i(TAG, "adb start wireless adb"); Loading @@ -1074,6 +1090,8 @@ public class AdbDebuggingManager { setAdbConnectionInfo(null); mContext.unregisterReceiver(mBroadcastReceiver); stopAdbdWifi(); onAdbdWifiServerDisconnected(-1); stopAdbDebuggingThread(); break; Loading Loading @@ -1102,9 +1120,8 @@ public class AdbDebuggingManager { intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); mContext.registerReceiver(mBroadcastReceiver, intentFilter); SystemProperties.set(AdbService.WIFI_PERSISTENT_CONFIG_PROPERTY, "1"); startAdbDebuggingThread(); startAdbdWifi(); mAdbWifiEnabled = true; Slog.i(TAG, "adb start wireless adb"); Loading
services/core/java/com/android/server/adb/AdbService.java +6 −1 Original line number Diff line number Diff line Loading @@ -210,7 +210,12 @@ public class AdbService extends IAdbManager.Stub { * May also contain vendor-specific default functions for testing purposes. */ private static final String USB_PERSISTENT_CONFIG_PROPERTY = "persist.sys.usb.config"; static final String WIFI_PERSISTENT_CONFIG_PROPERTY = "persist.adb.tls_server.enable"; /** * The system property used by both framework and adbd to set if ADB Wifi should be enabled * when either system starts up. */ private static final String WIFI_PERSISTENT_CONFIG_PROPERTY = "persist.adb.tls_server.enable"; private final Context mContext; private final ContentResolver mContentResolver; Loading