am 8e6d735f: am b8df8a29: Bluetooth: Acquire wakelock to turn on LCD for MAP authorization

* commit '8e6d735f98b12aaffbb01e39ffc9d87617a799b3':
  Bluetooth: Acquire wakelock to turn on LCD for MAP authorization
This commit is contained in:
Hemant Gupta
2015-06-02 14:24:52 +00:00
committed by Android Git Automerger

View File

@@ -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