summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Ljungberg <erik.ljungberg@sonyericsson.com>2010-09-01 22:04:59 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-01 22:04:59 -0700
commit6e6d05801e68e8d2cee2c708274dc8226f04f756 (patch)
tree81733e0477b63e4c34de2724e47e9a3f38e3cb3c
parent16339b6f3515684cc02c422c52ec189eda0d30b3 (diff)
parent83c3b64ff7235e1382712a899ab0a269ce8a28d6 (diff)
downloadpackages_apps_settings-6e6d05801e68e8d2cee2c708274dc8226f04f756.zip
packages_apps_settings-6e6d05801e68e8d2cee2c708274dc8226f04f756.tar.gz
packages_apps_settings-6e6d05801e68e8d2cee2c708274dc8226f04f756.tar.bz2
am 83c3b64f: BT: The Phone doesn\'t "wake up" when trying to pair with it.
Merge commit '83c3b64ff7235e1382712a899ab0a269ce8a28d6' into gingerbread-plus-aosp * commit '83c3b64ff7235e1382712a899ab0a269ce8a28d6': BT: The Phone doesn't "wake up" when trying to pair with it.
-rw-r--r--src/com/android/settings/bluetooth/BluetoothPairingRequest.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java
index 4253c5d..55f492e 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java
@@ -27,6 +27,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.text.TextUtils;
+import android.os.PowerManager;
/**
* BluetoothPairingRequest is a receiver for any Bluetooth pairing request. It
@@ -61,9 +62,13 @@ public class BluetoothPairingRequest extends BroadcastReceiver {
pairingIntent.setAction(BluetoothDevice.ACTION_PAIRING_REQUEST);
pairingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ PowerManager powerManager =
+ (PowerManager)context.getSystemService(Context.POWER_SERVICE);
String deviceAddress = device != null ? device.getAddress() : null;
- if (localManager.shouldShowDialogInForeground(deviceAddress)) {
- // Since the BT-related activity is in the foreground, just open the dialog
+ if (powerManager.isScreenOn() &&
+ localManager.shouldShowDialogInForeground(deviceAddress)) {
+ // Since the screen is on and the BT-related activity is in the foreground,
+ // just open the dialog
context.startActivity(pairingIntent);
} else {
@@ -88,6 +93,7 @@ public class BluetoothPairingRequest extends BroadcastReceiver {
res.getString(R.string.bluetooth_notif_message) + name,
pending);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
+ notification.defaults |= Notification.DEFAULT_SOUND;
NotificationManager manager = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);