diff options
| author | Tiger Huang <tigerhuang@google.com> | 2020-08-06 21:11:46 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-08-06 21:11:46 +0000 |
| commit | c8f8eefeabdd69d7b72e8c1fb4de12418ae9b3ea (patch) | |
| tree | b292a980f7d42610fee842ae8576bb38de0f6649 /core/java/android | |
| parent | 1d95dc53bc7e6baf751c32019fbc6f838d58245a (diff) | |
| parent | 046b604fd4332fff4ff92f8d17a5ad89e79b75a0 (diff) | |
Merge "Dispatch insets to client if mState is changed" into rvc-qpr-dev am: 046b604fd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12239625
Change-Id: I836a29f8662ab19756d3e7401f2582c26b7fdd8e
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/InsetsController.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java index c383bc7a4d70..7f45c044408a 100644 --- a/core/java/android/view/InsetsController.java +++ b/core/java/android/view/InsetsController.java @@ -618,16 +618,20 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation return false; } if (DEBUG) Log.d(TAG, "onStateChanged: " + state); - updateState(state); - - boolean localStateChanged = !mState.equals(mLastDispatchedState, - true /* excludingCaptionInsets */, true /* excludeInvisibleIme */); mLastDispatchedState.set(state, true /* copySources */); + final InsetsState lastState = new InsetsState(mState, true /* copySources */); + updateState(state); applyLocalVisibilityOverride(); - if (localStateChanged) { - if (DEBUG) Log.d(TAG, "onStateChanged, notifyInsetsChanged, send state to WM: " + mState); + + if (!mState.equals(lastState, true /* excludingCaptionInsets */, + true /* excludeInvisibleIme */)) { + if (DEBUG) Log.d(TAG, "onStateChanged, notifyInsetsChanged"); mHost.notifyInsetsChanged(); + } + if (!mState.equals(state, true /* excludingCaptionInsets */, + true /* excludeInvisibleIme */)) { + if (DEBUG) Log.d(TAG, "onStateChanged, send state to WM: " + mState); updateRequestedState(); } return true; |
