Merge "usb: Add the boot completed check before broadcasting intent" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
acb5ec3db7
@@ -556,6 +556,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
|
|||||||
protected boolean mCurrentUsbFunctionsReceived;
|
protected boolean mCurrentUsbFunctionsReceived;
|
||||||
protected int mUsbSpeed;
|
protected int mUsbSpeed;
|
||||||
protected int mCurrentGadgetHalVersion;
|
protected int mCurrentGadgetHalVersion;
|
||||||
|
protected boolean mPendingBootAccessoryHandshakeBroadcast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The persistent property which stores whether adb is enabled or not.
|
* The persistent property which stores whether adb is enabled or not.
|
||||||
@@ -1113,7 +1114,13 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
|
|||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Slog.v(TAG, "Accessory handshake timeout");
|
Slog.v(TAG, "Accessory handshake timeout");
|
||||||
}
|
}
|
||||||
|
if (mBootCompleted) {
|
||||||
broadcastUsbAccessoryHandshake();
|
broadcastUsbAccessoryHandshake();
|
||||||
|
} else {
|
||||||
|
if (DEBUG) Slog.v(TAG, "Pending broadcasting intent as "
|
||||||
|
+ "not boot completed yet.");
|
||||||
|
mPendingBootAccessoryHandshakeBroadcast = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MSG_INCREASE_SENDSTRING_COUNT: {
|
case MSG_INCREASE_SENDSTRING_COUNT: {
|
||||||
@@ -1137,8 +1144,11 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
|
|||||||
if (mCurrentAccessory != null) {
|
if (mCurrentAccessory != null) {
|
||||||
mUsbDeviceManager.getCurrentSettings().accessoryAttached(mCurrentAccessory);
|
mUsbDeviceManager.getCurrentSettings().accessoryAttached(mCurrentAccessory);
|
||||||
broadcastUsbAccessoryHandshake();
|
broadcastUsbAccessoryHandshake();
|
||||||
|
} else if (mPendingBootAccessoryHandshakeBroadcast) {
|
||||||
|
broadcastUsbAccessoryHandshake();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mPendingBootAccessoryHandshakeBroadcast = false;
|
||||||
updateUsbNotification(false);
|
updateUsbNotification(false);
|
||||||
updateAdbNotification(false);
|
updateAdbNotification(false);
|
||||||
updateUsbFunctions();
|
updateUsbFunctions();
|
||||||
|
|||||||
Reference in New Issue
Block a user