Merge "Dismiss lingering volume dialog" into udc-dev am: aba85c443c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23367527 Change-Id: Iadb9a0aaae6c433fdff7d756b99be57145bfeb61 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
7657bcbeae
@@ -404,6 +404,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
|
Log.d(TAG, "destroy() called");
|
||||||
mController.removeCallback(mControllerCallbackH);
|
mController.removeCallback(mControllerCallbackH);
|
||||||
mHandler.removeCallbacksAndMessages(null);
|
mHandler.removeCallbacksAndMessages(null);
|
||||||
mConfigurationController.removeCallback(this);
|
mConfigurationController.removeCallback(this);
|
||||||
@@ -465,6 +466,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initDialog(int lockTaskModeState) {
|
private void initDialog(int lockTaskModeState) {
|
||||||
|
Log.d(TAG, "initDialog: called!");
|
||||||
mDialog = new CustomDialog(mContext);
|
mDialog = new CustomDialog(mContext);
|
||||||
initDimens();
|
initDimens();
|
||||||
|
|
||||||
@@ -1269,7 +1271,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void tryToRemoveCaptionsTooltip() {
|
protected void tryToRemoveCaptionsTooltip() {
|
||||||
if (mHasSeenODICaptionsTooltip && mODICaptionsTooltipView != null) {
|
if (mHasSeenODICaptionsTooltip && mODICaptionsTooltipView != null && mDialog != null) {
|
||||||
ViewGroup container = mDialog.findViewById(R.id.volume_dialog_container);
|
ViewGroup container = mDialog.findViewById(R.id.volume_dialog_container);
|
||||||
container.removeView(mODICaptionsTooltipView);
|
container.removeView(mODICaptionsTooltipView);
|
||||||
mODICaptionsTooltipView = null;
|
mODICaptionsTooltipView = null;
|
||||||
@@ -1476,8 +1478,16 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
|
|
||||||
mHandler.removeMessages(H.DISMISS);
|
mHandler.removeMessages(H.DISMISS);
|
||||||
mHandler.removeMessages(H.SHOW);
|
mHandler.removeMessages(H.SHOW);
|
||||||
if (mIsAnimatingDismiss) {
|
|
||||||
Log.d(TAG, "dismissH: isAnimatingDismiss");
|
boolean showingStateInconsistent = !mShowing && mDialog != null && mDialog.isShowing();
|
||||||
|
// If incorrectly assuming dialog is not showing, continue and make the state consistent.
|
||||||
|
if (showingStateInconsistent) {
|
||||||
|
Log.d(TAG, "dismissH: volume dialog possible in inconsistent state:"
|
||||||
|
+ "mShowing=" + mShowing + ", mDialog==null?" + (mDialog == null));
|
||||||
|
}
|
||||||
|
if (mIsAnimatingDismiss && !showingStateInconsistent) {
|
||||||
|
Log.d(TAG, "dismissH: skipping dismiss because isAnimatingDismiss is true"
|
||||||
|
+ " and showingStateInconsistent is false");
|
||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1495,8 +1505,12 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
|||||||
.setDuration(mDialogHideAnimationDurationMs)
|
.setDuration(mDialogHideAnimationDurationMs)
|
||||||
.setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
|
.setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
|
||||||
.withEndAction(() -> mHandler.postDelayed(() -> {
|
.withEndAction(() -> mHandler.postDelayed(() -> {
|
||||||
mController.notifyVisible(false);
|
if (mController != null) {
|
||||||
mDialog.dismiss();
|
mController.notifyVisible(false);
|
||||||
|
}
|
||||||
|
if (mDialog != null) {
|
||||||
|
mDialog.dismiss();
|
||||||
|
}
|
||||||
tryToRemoveCaptionsTooltip();
|
tryToRemoveCaptionsTooltip();
|
||||||
mIsAnimatingDismiss = false;
|
mIsAnimatingDismiss = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user