diff options
| author | Hemant Gupta <hemantg@codeaurora.org> | 2014-04-17 20:10:28 +0530 |
|---|---|---|
| committer | Andre Eisenbach <eisenbach@google.com> | 2015-06-02 02:24:28 -0700 |
| commit | b8df8a29bf26a500d2f83a79bc09e78c8811041b (patch) | |
| tree | 658765b11ce937e162824d58860261d91a6c44d7 /src/com/android/settings/bluetooth | |
| parent | 7292d89280f7c4814e8fa93903dc73e3515b6558 (diff) | |
| download | packages_apps_Settings-b8df8a29bf26a500d2f83a79bc09e78c8811041b.tar.gz packages_apps_Settings-b8df8a29bf26a500d2f83a79bc09e78c8811041b.tar.bz2 packages_apps_Settings-b8df8a29bf26a500d2f83a79bc09e78c8811041b.zip | |
Bluetooth: Acquire wakelock to turn on LCD for MAP authorization
This patch acquires a wakelock to turn on the LCD display if the screen
is off during an access request for MAP. Without this patch it was
observed that if the screen was off, the LCD remained off for incoming
connection access request from remote devices and the user only heard
the notification sound without the LDC being lit up.
Change-Id: I87c296fce4cd8e0c133f74169d991eee263fed08
Diffstat (limited to 'src/com/android/settings/bluetooth')
| -rw-r--r-- | src/com/android/settings/bluetooth/BluetoothPermissionRequest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java index 372f9a5da..074e0bd0f 100644 --- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java @@ -117,6 +117,13 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { context, deviceAddress)) { context.startActivity(connectionAccessIntent); } else { + // Acquire wakelock so that LCD comes up since screen is off + PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK | + PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, + "ConnectionAccessActivity"); + wakeLock.setReferenceCounted(false); + wakeLock.acquire(); + // Put up a notification that leads to the dialog // Create an intent triggered by clicking on the @@ -173,6 +180,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver { notificationManager.notify(getNotificationTag(mRequestType), NOTIFICATION_ID, notification); + wakeLock.release(); } } else if (action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL)) { // Remove the notification |
