summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2009-12-14 15:33:50 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-14 15:33:50 -0800
commit3a3ad7364089056e2c2628634ab6789926d4e7aa (patch)
treeff157fe0a75eee6ce7e387167df26f5bbb8f0157
parent3418cb4df5c1ada031ca06d84374abe6a16e6dd3 (diff)
parent483deed6f3d91329d02bb37af64f032e4eaa3621 (diff)
downloadpackages_apps_settings-3a3ad7364089056e2c2628634ab6789926d4e7aa.zip
packages_apps_settings-3a3ad7364089056e2c2628634ab6789926d4e7aa.tar.gz
packages_apps_settings-3a3ad7364089056e2c2628634ab6789926d4e7aa.tar.bz2
am 483deed6: am 2321e1dc: am 052ad242: b/2323277 Fixed race condition where the user clicks on the dialog before dismiss() is processed.
Merge commit '483deed6f3d91329d02bb37af64f032e4eaa3621' * commit '483deed6f3d91329d02bb37af64f032e4eaa3621': b/2323277 Fixed race condition where the user clicks on the dialog before dismiss() is processed.
-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);
}