The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: pass
Bug: 33844934
Change-Id: I7c1691daf029fb426873be79553a235c43df9f42
Type-c ports can quickly toggle between connected/disconnected
states. Introduce debounce to prevent sending spurious notifications.
Cherry-pick: https://android-review.googlesource.com/#/c/338266/
Bug: 34972898
Test: notification should not be queued for a pixel-c charger not connected
to the power outlet.
Change-Id: I4aa19f9f864fe5b77e65f6a07a3184d8aba1f5fc
UsbPort.POWER_ROLE_SINK is orthogonal to the type of the charger
attached. POWER_ROLE_SINK would be the case for AC charging and
USB charging. Therefore query BatteryManager for the charger
type.
Cherry-pick: https://android-review.googlesource.com/#/c/338265/
Bug: 34972898
Test: Charging notification should not show for pixel-c chargers.
Change-Id: I8dddcd7727b6af973bd173d2c6e325aa4be2ca3a
Before N, when MTP device is connected to Android, it opened the
activity selector for applications that could handle the MTP device.
For N, we updated the behavior to make it consistent with other storage
devices like USB mass storage. In N, the system showed the notification
first, then showed the activity selector after a user taps the
notification.
The N behavior causes a problem that the user always needs to tap the
MTP notification even after the user select a default application for
the MTP device.
The CLs tweaks the behavior for O so that the system can skip the MTP
notification if the system has the default app for the connected MTP
device.
The default app is one of them:
* App selected by a user by clicking "Always use" in the activity
selector
* System app that is an only application which can handle the MTP
device in the system
* App that is an only application which can handle the MTP device in
the system where config_disableUsbPermissionDialogs=true.
Bug: 32119378
Test: Connecting MTP device to Android, which automatically opens system
app. Connecting PTP device to Android, which shows a notification.
Tapping the notifiction opens the acitivity selector.
Change-Id: I51f1d55e8c7d1db87d91ddf966631d275a171546
Adapts all notifications used by system services to use channels.
Channels are initialized by SystemServer after the NotificationService
has started.
Test: runtest systemui-notification
Change-Id: I25c45293b786adb57787aeab4c2613c9d7c89dab
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: boots
Test: hidl_test
Bug: 33844934
Change-Id: I5774469712d70de4b2629258fe54d7f8c280d9d0
Type-c ports can quickly toggle between connected/disconnected
states. Introduce debounce to prevent sending spurious notifications.
Bug: 34972898
Test: notification should not be queued for a pixel-c charger not connected
to the power outlet.
Change-Id: I4aa19f9f864fe5b77e65f6a07a3184d8aba1f5fc
UsbPort.POWER_ROLE_SINK is orthogonal to the type of the charger
attached. POWER_ROLE_SINK would be the case for AC charging and
USB charging. Therefore query BatteryManager for the charger
type.
Bug: 34972898
Test: Charging notification should not show for pixel-c chargers.
Change-Id: I8dddcd7727b6af973bd173d2c6e325aa4be2ca3a
Type-c ports can quickly toggle between connected/disconnected
states. Introduce debounce to prevent sending spurious notifications.
Bug: 34972898
Test: notification should not be queued for a pixel-c charger not connected
to the power outlet.
Change-Id: I4aa19f9f864fe5b77e65f6a07a3184d8aba1f5fc
UsbPort.POWER_ROLE_SINK is orthogonal to the type of the charger
attached. POWER_ROLE_SINK would be the case for AC charging and
USB charging. Therefore query BatteryManager for the charger
type.
Bug: 34972898
Test: Charging notification should not show for pixel-c chargers.
Change-Id: I8dddcd7727b6af973bd173d2c6e325aa4be2ca3a
Broadcasts are not sent until BOOT_COMPLETED is received.
When the device boots with usb plugged, the UPDATE_STATE
for connted and configured would be received way before
BOOT_COMPLETED is received. Since, devices can continue
to stay in same usb configuration(set through persistent
property trigger), check and send a usb state broadcast
if needed.
BUG: 34451258
Test: Manually checked to verify the broadcasts sent.
Change-Id: I8eca5f241ad758f5c4f1afa6c9807868dfd6195a
This prevents cases where the device starts up and attempts
to change the config, but intents cannot yet be sent.
A patch to resend this skipped intent is necessary to
finish fixing the bug.
Bug: 34451258
Test: Check that usb state is properly handled on boot
Change-Id: I9d79c67ce8982fd5b43fa40781b66bb9ae820694
This gets rid of an extraneous configuration change when going from
adb to adb + file transfer as previously the config would have been
reset once for functions and once for data unlocked.
It also simplifies some of the code.
Bug: 31814300
Test: manually changing usb configurations
Change-Id: Ica10a195338b2189db13113f44657393db110bee
(cherry picked from commit 7a396be6d5ba8914933a54b5bfac25e118db0e9f)
Move to a USB HAL to handle type-c ports as upstream is
considering in merging a generic type-c interface to mainline
kernel. However, the new sysfs interface can see minor changes
in the future as the sysfs interface is sitll going to land
in testing and it is still under review.
Bug: 31015010
Test: Manually tested on Angler and sailfish for type-c role switches.
Change-Id: I26771074c4b4f79a133e519bc6d35a4864a696d8
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.
Apps with these properties are exempted from background restrictions:
- persistent process
- currently on the idle battery whitelist
- global whitelist for things like bluetooth services
Bug 30953212
Change-Id: Icc19b2fbc05f40dcf8c3fc4abf718c373dc8d4f6