summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2009-12-14 10:42:27 -0800
committerMichael Chan <mchan@android.com>2009-12-14 10:42:27 -0800
commit052ad24219bbb170d9d028a460741524a768915a (patch)
treebd64f0cfc0b385f9de8d6c439dc2285eed969b71 /src/com/android/settings/bluetooth
parent9463c2f8d5f09ef9cc015405640bbf845f0f7a8a (diff)
downloadpackages_apps_Settings-052ad24219bbb170d9d028a460741524a768915a.zip
packages_apps_Settings-052ad24219bbb170d9d028a460741524a768915a.tar.gz
packages_apps_Settings-052ad24219bbb170d9d028a460741524a768915a.tar.bz2
b/2323277 Fixed race condition where the user clicks on the dialog before dismiss() is processed.
Change-Id: Iae98c45e4c1c5d36f33d6519ee2adba515f6b9aa
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r--src/com/android/settings/bluetooth/DockService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/settings/bluetooth/DockService.java b/src/com/android/settings/bluetooth/DockService.java
index 484ce86..8e3af9d 100644
--- a/src/com/android/settings/bluetooth/DockService.java
+++ b/src/com/android/settings/bluetooth/DockService.java
@@ -331,7 +331,9 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
// Called when the "Remember" Checkbox is clicked
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (DEBUG) Log.d(TAG, "onCheckedChanged: Remember Settings = " + isChecked);
- mBtManager.saveDockAutoConnectSetting(mDevice.getAddress(), isChecked);
+ if (mDevice != null) {
+ mBtManager.saveDockAutoConnectSetting(mDevice.getAddress(), isChecked);
+ }
}
// Called when the dialog is dismissed
@@ -346,7 +348,7 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
// Called when clicked on the OK button
public void onClick(DialogInterface dialog, int which) {
- if (which == DialogInterface.BUTTON_POSITIVE) {
+ if (which == DialogInterface.BUTTON_POSITIVE && mDevice != null) {
if (!mBtManager.hasDockAutoConnectSetting(mDevice.getAddress())) {
mBtManager.saveDockAutoConnectSetting(mDevice.getAddress(), true);
}