Merge "Fix handling usb notification after pr_swap complete" am: b681fec035 am: d68e9ab715 am: 2ac83c4e47
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1984546 Change-Id: Ic6901932eaa7d410700be980dc37ae37621d24e6
This commit is contained in:
@@ -498,6 +498,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
|
||||
|
||||
// current USB state
|
||||
private boolean mHostConnected;
|
||||
private boolean mUsbAccessoryConnected;
|
||||
private boolean mSourcePower;
|
||||
private boolean mSinkPower;
|
||||
private boolean mConfigured;
|
||||
@@ -964,10 +965,10 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
|
||||
break;
|
||||
case MSG_UPDATE_HOST_STATE:
|
||||
Iterator devices = (Iterator) msg.obj;
|
||||
boolean connected = (msg.arg1 == 1);
|
||||
mUsbAccessoryConnected = (msg.arg1 == 1);
|
||||
|
||||
if (DEBUG) {
|
||||
Slog.i(TAG, "HOST_STATE connected:" + connected);
|
||||
Slog.i(TAG, "HOST_STATE connected:" + mUsbAccessoryConnected);
|
||||
}
|
||||
|
||||
mHideUsbNotification = false;
|
||||
@@ -1221,7 +1222,7 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
|
||||
} else if (mSourcePower) {
|
||||
titleRes = com.android.internal.R.string.usb_supplying_notification_title;
|
||||
id = SystemMessage.NOTE_USB_SUPPLYING;
|
||||
} else if (mHostConnected && mSinkPower && mUsbCharging) {
|
||||
} else if (mHostConnected && mSinkPower && (mUsbCharging || mUsbAccessoryConnected)) {
|
||||
titleRes = com.android.internal.R.string.usb_charging_notification_title;
|
||||
id = SystemMessage.NOTE_USB_CHARGING;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user