diff options
| author | Adrian Roos <roosa@google.com> | 2020-06-12 18:48:10 +0200 |
|---|---|---|
| committer | Adrian Roos <roosa@google.com> | 2020-06-22 16:55:54 +0200 |
| commit | c22eec9d35e797417b8630fff178ec53e7c29b65 (patch) | |
| tree | 83a64bdab7c328cd3d2e0ad87d54580323f090c2 /core/java/android/view/ViewRootInsetsControllerHost.java | |
| parent | 70ad33113fdfcb77edcc2120e108cad4d2e3d7bf (diff) | |
IME animation: hide IME-related navbar icons until perceptible
During transitions and while the IME is controlled by the app,
the IME may be "visible" as far as the IME framework is concerned,
but not actually perceptible by the user due to offsets or alpha
applied to the leash.
This may lead to out-of-place navbar symbols for the IME, especially
in gesture nav.
To avoid this, the ImeInsetsSourceConsumer now notifies the IMF of
whether it has made the IME unperceptible to the user.
For now, we ignore the cases where the IME is controlled by something
other than the client window - in that case, we just revert to the
previous behavior of it being always considered perceptible.
Fixes: 158079255
Test: manual, launch email compose activity, observe that back button only indicates once IME appears
Test: atest InsetsAnimationControlImplTest
Change-Id: I4dc9d6513d0559156f7da39244f3fc5ebc952ed4
Diffstat (limited to 'core/java/android/view/ViewRootInsetsControllerHost.java')
| -rw-r--r-- | core/java/android/view/ViewRootInsetsControllerHost.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootInsetsControllerHost.java b/core/java/android/view/ViewRootInsetsControllerHost.java index f7ca3c2b7ddf..90a80cefc54d 100644 --- a/core/java/android/view/ViewRootInsetsControllerHost.java +++ b/core/java/android/view/ViewRootInsetsControllerHost.java @@ -22,6 +22,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_BEHAVIOR_CONT import android.annotation.NonNull; import android.os.Handler; +import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import android.view.inputmethod.InputMethodManager; @@ -236,4 +237,16 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host { } return 0; } + + @Override + public IBinder getWindowToken() { + if (mViewRoot == null) { + return null; + } + final View view = mViewRoot.getView(); + if (view == null) { + return null; + } + return view.getWindowToken(); + } } |
