Loading packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java +9 −3 Original line number Diff line number Diff line Loading @@ -108,13 +108,18 @@ public class TouchInsetManager { private void updateTouchRegions() { mExecutor.execute(() -> { final HashMap<AttachedSurfaceControl, Region> affectedSurfaces = new HashMap<>(); mTrackedViews.stream().forEach(view -> { if (!view.isAttachedToWindow()) { if (mTrackedViews.isEmpty()) { return; } mTrackedViews.stream().forEach(view -> { final AttachedSurfaceControl surface = view.getRootSurfaceControl(); // Detached views will not have a surface control. if (surface == null) { return; } if (!affectedSurfaces.containsKey(surface)) { affectedSurfaces.put(surface, Region.obtain()); } Loading Loading @@ -179,6 +184,7 @@ public class TouchInsetManager { mSessionRegions.values().stream().forEach(regionMapping -> { regionMapping.entrySet().stream().forEach(entry -> { final AttachedSurfaceControl surface = entry.getKey(); if (!affectedSurfaces.containsKey(surface)) { affectedSurfaces.put(surface, Region.obtain()); } Loading packages/SystemUI/tests/src/com/android/systemui/touch/TouchInsetManagerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -110,13 +110,14 @@ public class TouchInsetManagerTest extends SysuiTestCase { clearInvocations(mAttachedSurfaceControl); when(view.isAttachedToWindow()).thenReturn(false); when(view.getRootSurfaceControl()).thenReturn(null); // Trigger detachment and verify touchable region is set. listener.getValue().onViewDetachedFromWindow(view); mFakeExecutor.runAllReady(); verify(mAttachedSurfaceControl).setTouchableRegion(any()); verify(mAttachedSurfaceControl).setTouchableRegion(eq(null)); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/touch/TouchInsetManager.java +9 −3 Original line number Diff line number Diff line Loading @@ -108,13 +108,18 @@ public class TouchInsetManager { private void updateTouchRegions() { mExecutor.execute(() -> { final HashMap<AttachedSurfaceControl, Region> affectedSurfaces = new HashMap<>(); mTrackedViews.stream().forEach(view -> { if (!view.isAttachedToWindow()) { if (mTrackedViews.isEmpty()) { return; } mTrackedViews.stream().forEach(view -> { final AttachedSurfaceControl surface = view.getRootSurfaceControl(); // Detached views will not have a surface control. if (surface == null) { return; } if (!affectedSurfaces.containsKey(surface)) { affectedSurfaces.put(surface, Region.obtain()); } Loading Loading @@ -179,6 +184,7 @@ public class TouchInsetManager { mSessionRegions.values().stream().forEach(regionMapping -> { regionMapping.entrySet().stream().forEach(entry -> { final AttachedSurfaceControl surface = entry.getKey(); if (!affectedSurfaces.containsKey(surface)) { affectedSurfaces.put(surface, Region.obtain()); } Loading
packages/SystemUI/tests/src/com/android/systemui/touch/TouchInsetManagerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -110,13 +110,14 @@ public class TouchInsetManagerTest extends SysuiTestCase { clearInvocations(mAttachedSurfaceControl); when(view.isAttachedToWindow()).thenReturn(false); when(view.getRootSurfaceControl()).thenReturn(null); // Trigger detachment and verify touchable region is set. listener.getValue().onViewDetachedFromWindow(view); mFakeExecutor.runAllReady(); verify(mAttachedSurfaceControl).setTouchableRegion(any()); verify(mAttachedSurfaceControl).setTouchableRegion(eq(null)); } @Test Loading