From 1af65ef7ba362ba9ed1f60914e522913d16da940 Mon Sep 17 00:00:00 2001 From: Alex Stetson Date: Wed, 20 Nov 2024 14:04:41 -0800 Subject: Update API to only modify specified inset types When there are multiple controllers that update the visible insets, explicitly setting all the requested visibilities may cause conflicts with what is set elsewhere when each controller only cares about a subset of the inset types. This API change will allow controllers to only modify the visibility of a specific subset of insets while leaving the rest as they previously were. Bug: 376131165 Test: manual Flag: NONE bugfix Change-Id: Ia12f8b68ad132cc1e40094ba0680ea53fc7b5c65 --- .../src/com/android/wm/shell/common/DisplayImeController.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java index 38b859220256..ec3c0b83fe2d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java @@ -228,7 +228,6 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged public class PerDisplay implements DisplayInsetsController.OnInsetsChangedListener { final int mDisplayId; final InsetsState mInsetsState = new InsetsState(); - @InsetsType int mRequestedVisibleTypes = WindowInsets.Type.defaultVisible(); boolean mImeRequestedVisible = (WindowInsets.Type.defaultVisible() & WindowInsets.Type.ime()) != 0; InsetsSourceControl mImeSourceControl = null; @@ -426,12 +425,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged */ private void setVisibleDirectly(boolean visible, @Nullable ImeTracker.Token statsToken) { mInsetsState.setSourceVisible(InsetsSource.ID_IME, visible); - mRequestedVisibleTypes = visible - ? mRequestedVisibleTypes | WindowInsets.Type.ime() - : mRequestedVisibleTypes & ~WindowInsets.Type.ime(); + int visibleTypes = visible ? WindowInsets.Type.ime() : 0; try { mWmService.updateDisplayWindowRequestedVisibleTypes(mDisplayId, - mRequestedVisibleTypes, statsToken); + visibleTypes, WindowInsets.Type.ime(), statsToken); } catch (RemoteException e) { } } -- cgit v1.2.3-59-g8ed1b