Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 052ad242 authored by Michael Chan's avatar Michael Chan
Browse files

b/2323277 Fixed race condition where the user clicks on the dialog before dismiss() is processed.

Change-Id: Iae98c45e4c1c5d36f33d6519ee2adba515f6b9aa
parent 9463c2f8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -331,8 +331,10 @@ 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);
        if (mDevice != null) {
            mBtManager.saveDockAutoConnectSetting(mDevice.getAddress(), isChecked);
        }
    }

    // Called when the dialog is dismissed
    public void onDismiss(DialogInterface dialog) {
@@ -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);
            }