Skip to content

Commit 287b11e

Browse files
committed
SystemUI: Fix display cutout handling in expanding volume panel
Devices with display cutouts in the status bar area usually have a taller status bar to accomodate them. The custom volume panel dialog insets don't account for that when using the location of the dialog, resulting in incorrect insets that block touch at the top edge of the volume panel. Custom insets are unnecessary anyway, especially when they just return a rectangle encompassing the entire visible region of the volume panel, so remove the custom inset code to fix the display cutout handling issue. Collapsed volume controls aren't touchable regardless of insets because they're inside the collapsed container. Change-Id: I6b8f2f796a99c7d28c0660988e208a5d831379b6
1 parent e66281d commit 287b11e

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@
8181
import android.view.ViewGroup;
8282
import android.view.ViewPropertyAnimator;
8383
import android.view.ViewStub;
84-
import android.view.ViewTreeObserver;
85-
import android.view.ViewTreeObserver.InternalInsetsInfo;
86-
import android.view.ViewTreeObserver.OnComputeInternalInsetsListener;
8784
import android.view.Window;
8885
import android.view.WindowManager;
8986
import android.view.accessibility.AccessibilityEvent;
@@ -348,22 +345,6 @@ private void initDialog() {
348345
mMusicHidden = false;
349346
}
350347

351-
private final OnComputeInternalInsetsListener mInsetsListener = internalInsetsInfo -> {
352-
internalInsetsInfo.touchableRegion.setEmpty();
353-
internalInsetsInfo.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
354-
View main = mDialog.findViewById(R.id.main);
355-
int[] mainLocation = new int[2];
356-
main.getLocationOnScreen(mainLocation);
357-
int[] dialogLocation = new int[2];
358-
mDialogView.getLocationOnScreen(dialogLocation);
359-
internalInsetsInfo.touchableRegion.set(new Region(
360-
mainLocation[0],
361-
dialogLocation[1],
362-
mainLocation[0] + main.getWidth(),
363-
dialogLocation[1] + mDialogView.getHeight()
364-
));
365-
};
366-
367348
// Helper to set layout gravity.
368349
// Particular useful when the ViewGroup in question
369350
// is different for portait vs landscape.
@@ -835,7 +816,6 @@ private void showH(int reason) {
835816

836817
initSettingsH();
837818
mIsAnimatingDismiss = false;
838-
mDialog.getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsListener);
839819

840820
if (!mShowing && !mDialog.isShown()) {
841821
if (!isLandscape()) {

0 commit comments

Comments
 (0)