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