diff options
| author | 2024-05-21 08:26:07 +0000 | |
|---|---|---|
| committer | 2024-05-29 03:29:59 +0000 | |
| commit | debccf10d59704ce9dbd264023e76ac417495ec0 (patch) | |
| tree | 77f281bb08e44c2651fb4e591e23894e351f541d | |
| parent | b2f6997ebaabf16ee94a43bb6c7d6787c7ae1e7c (diff) | |
Dispatch WindowStateInsetsControlChangeItem
Bug: 339380439
Test: refactor, pass existing tests
Flag: com.android.window.flags.insets_control_changed_item
Change-Id: If95ba8f513f9c8d09a73f67b88cf840920e893ed
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 90c287c056e8..6953c60d0d74 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -188,6 +188,7 @@ import android.annotation.Nullable; import android.app.ActivityTaskManager; import android.app.AppOpsManager; import android.app.admin.DevicePolicyCache; +import android.app.servertransaction.WindowStateInsetsControlChangeItem; import android.app.servertransaction.WindowStateResizeItem; import android.content.Context; import android.content.res.Configuration; @@ -3818,11 +3819,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP } final InsetsStateController stateController = getDisplayContent().getInsetsStateController(); + final InsetsState insetsState = getCompatInsetsState(); mLastReportedActiveControls.set(stateController.getControlsForDispatch(this)); - try { - mClient.insetsControlChanged(getCompatInsetsState(), mLastReportedActiveControls); - } catch (RemoteException e) { - Slog.w(TAG, "Failed to deliver inset control state change to w=" + this, e); + if (Flags.insetsControlChangedItem()) { + getProcess().scheduleClientTransactionItem(WindowStateInsetsControlChangeItem.obtain( + mClient, insetsState, mLastReportedActiveControls)); + } else { + try { + mClient.insetsControlChanged(insetsState, mLastReportedActiveControls); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to deliver inset control state change to w=" + this, e); + } } } |