Merge "Dismiss lingering volume dialog" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e0f91b9e48
@@ -414,6 +414,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
Log.d(TAG, "destroy() called");
|
||||
mController.removeCallback(mControllerCallbackH);
|
||||
mHandler.removeCallbacksAndMessages(null);
|
||||
mConfigurationController.removeCallback(this);
|
||||
@@ -488,6 +489,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
||||
}
|
||||
|
||||
private void initDialog(int lockTaskModeState) {
|
||||
Log.d(TAG, "initDialog: called!");
|
||||
mDialog = new CustomDialog(mContext);
|
||||
|
||||
initDimens();
|
||||
@@ -1281,7 +1283,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
||||
}
|
||||
|
||||
protected void tryToRemoveCaptionsTooltip() {
|
||||
if (mHasSeenODICaptionsTooltip && mODICaptionsTooltipView != null) {
|
||||
if (mHasSeenODICaptionsTooltip && mODICaptionsTooltipView != null && mDialog != null) {
|
||||
ViewGroup container = mDialog.findViewById(R.id.volume_dialog_container);
|
||||
container.removeView(mODICaptionsTooltipView);
|
||||
mODICaptionsTooltipView = null;
|
||||
@@ -1471,8 +1473,16 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
||||
|
||||
mHandler.removeMessages(H.DISMISS);
|
||||
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();
|
||||
return;
|
||||
}
|
||||
@@ -1490,8 +1500,12 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
|
||||
.setDuration(mDialogHideAnimationDurationMs)
|
||||
.setInterpolator(new SystemUIInterpolators.LogAccelerateInterpolator())
|
||||
.withEndAction(() -> mHandler.postDelayed(() -> {
|
||||
mController.notifyVisible(false);
|
||||
mDialog.dismiss();
|
||||
if (mController != null) {
|
||||
mController.notifyVisible(false);
|
||||
}
|
||||
if (mDialog != null) {
|
||||
mDialog.dismiss();
|
||||
}
|
||||
tryToRemoveCaptionsTooltip();
|
||||
mIsAnimatingDismiss = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user