diff options
| author | 2024-11-14 19:37:09 +0000 | |
|---|---|---|
| committer | 2024-11-14 19:37:09 +0000 | |
| commit | 7bf5ada943257b378f69f44996e3c9cb1614c3ae (patch) | |
| tree | 9d273418f59d2f130f13716b10d106c0fd87f295 | |
| parent | 1bdc00b1ab486dc7a1b2461625262a2d4668b3f0 (diff) | |
| parent | 232a55c26950979cfeb227a45775fd9ad338184c (diff) | |
Merge "Add logging to dream gesture exclusion handling" into main
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/ambient/touch/TouchMonitor.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ambient/touch/TouchMonitor.java b/packages/SystemUI/src/com/android/systemui/ambient/touch/TouchMonitor.java index fb00d6e16dcc..db4d613a9101 100644 --- a/packages/SystemUI/src/com/android/systemui/ambient/touch/TouchMonitor.java +++ b/packages/SystemUI/src/com/android/systemui/ambient/touch/TouchMonitor.java @@ -52,6 +52,8 @@ import com.android.systemui.util.display.DisplayHelper; import com.google.common.util.concurrent.ListenableFuture; +import kotlin.Unit; + import kotlinx.coroutines.Job; import java.util.Collection; @@ -87,7 +89,7 @@ public class TouchMonitor { private final ConfigurationInteractor mConfigurationInteractor; private final Lifecycle mLifecycle; - private Rect mExclusionRect = null; + private Rect mExclusionRect = new Rect(); private ISystemGestureExclusionListener mGestureExclusionListener; @@ -298,9 +300,18 @@ public class TouchMonitor { public void onSystemGestureExclusionChanged(int displayId, Region systemGestureExclusion, Region systemGestureExclusionUnrestricted) { - mExclusionRect = systemGestureExclusion.getBounds(); + final Rect bounds = systemGestureExclusion.getBounds(); + if (!mExclusionRect.equals(bounds)) { + mExclusionRect = bounds; + mLogger.i(msg -> "Exclusion rect updated to " + msg.getStr1(), + msg -> { + msg.setStr1(bounds.toString()); + return Unit.INSTANCE; + }); + } } }; + mLogger.i("Registering system gesture exclusion listener"); mWindowManagerService.registerSystemGestureExclusionListener( mGestureExclusionListener, mDisplayId); } catch (RemoteException e) { @@ -320,11 +331,12 @@ public class TouchMonitor { * Destroys any active {@link InputSession}. */ private void stopMonitoring(boolean force) { - mExclusionRect = null; + mExclusionRect = new Rect(); if (bouncerAreaExclusion()) { mBackgroundExecutor.execute(() -> { try { if (mGestureExclusionListener != null) { + mLogger.i("Unregistering system gesture exclusion listener"); mWindowManagerService.unregisterSystemGestureExclusionListener( mGestureExclusionListener, mDisplayId); mGestureExclusionListener = null; |