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

Commit 1e7b32f0 authored by Lin Guo's avatar Lin Guo
Browse files

Set mShowing to false after the dialog dismissed

And make sure all the show/dismiss events are in a sequence.

BUG: 109936524
Test: manual
Change-Id: I1c20cb1cfb84c97fb386857680399cd74ed063f9
(cherry picked from commit fdc4cab04e56c3813ded8f362cd4a3603d92a7f5)
parent a68473ac
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -193,11 +193,11 @@ public class CarVolumeDialogImpl implements VolumeDialog {
  }

  public void show(int reason) {
    mHandler.obtainMessage(H.SHOW, reason, 0).sendToTarget();
    mHandler.obtainMessage(H.SHOW, reason).sendToTarget();
  }

  public void dismiss(int reason) {
    mHandler.obtainMessage(H.DISMISS, reason, 0).sendToTarget();
    mHandler.obtainMessage(H.DISMISS, reason).sendToTarget();
  }

  private void showH(int reason) {
@@ -223,7 +223,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
    mHandler.removeMessages(H.DISMISS);
    final int timeout = computeTimeoutH();
    mHandler.sendMessageDelayed(mHandler
        .obtainMessage(H.DISMISS, Events.DISMISS_REASON_TIMEOUT, 0), timeout);
        .obtainMessage(H.DISMISS, Events.DISMISS_REASON_TIMEOUT), timeout);

    if (D.BUG) {
      Log.d(TAG, "rescheduleTimeout " + timeout + " " + Debug.getCaller());
@@ -246,7 +246,6 @@ public class CarVolumeDialogImpl implements VolumeDialog {
    }

    mListView.animate().cancel();
    mShowing = false;

    mListView.setTranslationY(0);
    mListView.setAlpha(1);
@@ -260,6 +259,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
            Log.d(TAG, "mDialog.dismiss()");
          }
          mDialog.dismiss();
          mShowing = false;
        }, DISMISS_DELAY_IN_MILLIS))
        .start();

@@ -436,7 +436,8 @@ public class CarVolumeDialogImpl implements VolumeDialog {
    public boolean onTouchEvent(MotionEvent event) {
      if (isShowing()) {
        if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
          dismissH(Events.DISMISS_REASON_TOUCH_OUTSIDE);
          mHandler.obtainMessage(
            H.DISMISS, Events.DISMISS_REASON_TOUCH_OUTSIDE).sendToTarget();
          return true;
        }
      }