Always reevaluate whether to show the notification for USB_DEVICE_* intents
The decision whether to show or hide the "Usb supplying power.." notification is based on two different broadcasts 1. USB_DEVICE_ATTACHED/DETACHED 2. USB_PORT_CHANGED Depending on how long the port takes to enumerate, the required intents might arrive in different order. Previously, it was assumed that the ATTACHED broadcast would arrive before the PORT_CHANGED broadcast and the code was aggressive to reduce the number of times the decision to display/hide the notification is made. This might cause the notification to be displayed in some instances when it is not supposed to be displayed. This CL makes the usb service to always reevaluate whenever USB_DEVICE_ATTACHED/DETACHED is received. Also, adding logs to print whenever the notification in enqueued/ dequeued. Bug: 63785369 Test: Verified that the notification is displayed when connecting to another pixel device and hidden when mouse or headset is connected. Change-Id: I30650a2d9923d01a1fce4b9450e65ec7f4e6557b
Loading
Please register or sign in to comment