Merge "Change mODICaptionsTooltipView null check occasion to avoid potential crash" am: 1add3774e4 am: dc350b9593

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2405714

Change-Id: Id15a2fad1cd2d20260b9c538c320623c6df34afe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alison Cichowlas
2023-02-09 16:12:09 +00:00
committed by Automerger Merge Worker

View File

@@ -1228,13 +1228,13 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
rescheduleTimeoutH();
}
if (mODICaptionsTooltipView != null) {
mODICaptionsTooltipView.setAlpha(0.0f);
// We need to wait for layout and then center the caption view. Since the height of the
// dialog is now dynamic (with the variable ringer drawer height changing the height of
// the dialog), we need to do this here in code vs. in XML.
mHandler.post(() -> {
if (mODICaptionsTooltipView != null) {
mODICaptionsTooltipView.setAlpha(0.0f);
// We need to wait for layout and then center the caption view. Since the height of the
// dialog is now dynamic (with the variable ringer drawer height changing the height of
// the dialog), we need to do this here in code vs. in XML.
mHandler.post(() -> {
final int[] odiTooltipLocation = mODICaptionsTooltipView.getLocationOnScreen();
final int[] odiButtonLocation = mODICaptionsIcon.getLocationOnScreen();
@@ -1260,8 +1260,8 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
}
})
.start();
});
}
}
});
}
private void hideCaptionsTooltip() {