Merge "Don't destroy usb debugging dialog for emulator if usb is not connected." into sc-dev am: b485b356fb am: 2bac27462b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14791950

Change-Id: I137ecf4ec013e6155e8bb507da37a05be0e06702
This commit is contained in:
TreeHugger Robot
2021-06-01 20:46:30 +00:00
committed by Automerger Merge Worker

View File

@@ -68,7 +68,9 @@ public class UsbDebuggingActivity extends AlertActivity
super.onCreate(icicle);
if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0) {
// Emulator does not support reseating the usb cable to reshow the dialog.
boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1");
if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !isEmulator) {
mDisconnectedReceiver = new UsbDisconnectedReceiver(this);
IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE);
mBroadcastDispatcher.registerReceiver(mDisconnectedReceiver, filter);