Loading core/java/android/inputmethodservice/InputMethodService.java +2 −2 Original line number Diff line number Diff line Loading @@ -475,7 +475,7 @@ public class InputMethodService extends AbstractInputMethodService { private InputMethodPrivilegedOperations mPrivOps = new InputMethodPrivilegedOperations(); @NonNull final NavigationBarController mNavigationBarController = private final NavigationBarController mNavigationBarController = new NavigationBarController(this); @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) Loading Loading @@ -1504,7 +1504,7 @@ public class InputMethodService extends AbstractInputMethodService { Context.LAYOUT_INFLATER_SERVICE); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.initSoftInputWindow"); mWindow = new SoftInputWindow(this, mTheme, mDispatcherState); mNavigationBarController.onSoftInputWindowCreated(mWindow); { final Window window = mWindow.getWindow(); { Loading core/java/android/inputmethodservice/NavigationBarController.java +15 −8 Original line number Diff line number Diff line Loading @@ -65,6 +65,9 @@ final class NavigationBarController { @NonNull ViewTreeObserver.InternalInsetsInfo dest) { } default void onSoftInputWindowCreated(@NonNull SoftInputWindow softInputWindow) { } default void onViewInitialized() { } Loading @@ -78,9 +81,6 @@ final class NavigationBarController { boolean shouldShowImeSwitcherWhenImeIsShown) { } default void onSystemBarAppearanceChanged(@Appearance int appearance) { } default String toDebugString() { return "No-op implementation"; } Loading @@ -101,6 +101,10 @@ final class NavigationBarController { mImpl.updateTouchableInsets(originalInsets, dest); } void onSoftInputWindowCreated(@NonNull SoftInputWindow softInputWindow) { mImpl.onSoftInputWindowCreated(softInputWindow); } void onViewInitialized() { mImpl.onViewInitialized(); } Loading @@ -117,15 +121,11 @@ final class NavigationBarController { mImpl.setShouldShowImeSwitcherWhenImeIsShown(shouldShowImeSwitcherWhenImeIsShown); } void onSystemBarAppearanceChanged(@Appearance int appearance) { mImpl.onSystemBarAppearanceChanged(appearance); } String toDebugString() { return mImpl.toDebugString(); } private static final class Impl implements Callback { private static final class Impl implements Callback, Window.DecorCallback { private static final int DEFAULT_COLOR_ADAPT_TRANSITION_TIME = 1700; // Copied from com.android.systemui.animation.Interpolators#LEGACY_DECELERATE Loading Loading @@ -361,6 +361,13 @@ final class NavigationBarController { == WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; } @Override public void onSoftInputWindowCreated(@NonNull SoftInputWindow softInputWindow) { final Window window = softInputWindow.getWindow(); mAppearance = window.getSystemBarAppearance(); window.setDecorCallback(this); } @Override public void onViewInitialized() { if (mDestroyed) { Loading core/java/android/inputmethodservice/SoftInputWindow.java +0 −6 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.util.proto.ProtoOutputStream; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.WindowInsetsController; import android.view.WindowManager; import java.lang.annotation.Retention; Loading Loading @@ -264,11 +263,6 @@ final class SoftInputWindow extends Dialog { } } @Override public void onSystemBarAppearanceChanged(@WindowInsetsController.Appearance int appearance) { mService.mNavigationBarController.onSystemBarAppearanceChanged(appearance); } void dumpDebug(ProtoOutputStream proto, long fieldId) { final long token = proto.start(fieldId); mBounds.dumpDebug(proto, BOUNDS); Loading core/java/android/view/Window.java +34 −11 Original line number Diff line number Diff line Loading @@ -295,6 +295,9 @@ public abstract class Window { private OnWindowDismissedCallback mOnWindowDismissedCallback; private OnWindowSwipeDismissedCallback mOnWindowSwipeDismissedCallback; private WindowControllerCallback mWindowControllerCallback; @WindowInsetsController.Appearance private int mSystemBarAppearance; private DecorCallback mDecorCallback; private OnRestrictedCaptionAreaChangedListener mOnRestrictedCaptionAreaChangedListener; private Rect mRestrictedCaptionAreaRect; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) Loading Loading @@ -607,17 +610,6 @@ public abstract class Window { * @param hasCapture True if the window has pointer capture. */ default public void onPointerCaptureChanged(boolean hasCapture) { }; /** * Called from * {@link com.android.internal.policy.DecorView#onSystemBarAppearanceChanged(int)}. * * @param appearance The newly applied appearance. * @hide */ default void onSystemBarAppearanceChanged( @WindowInsetsController.Appearance int appearance) { } } /** @hide */ Loading Loading @@ -672,6 +664,17 @@ public abstract class Window { void updateNavigationBarColor(int color); } /** @hide */ public interface DecorCallback { /** * Called from * {@link com.android.internal.policy.DecorView#onSystemBarAppearanceChanged(int)}. * * @param appearance The newly applied appearance. */ void onSystemBarAppearanceChanged(@WindowInsetsController.Appearance int appearance); } /** * Callback for clients that want to be aware of where caption draws content. */ Loading Loading @@ -996,6 +999,26 @@ public abstract class Window { return mWindowControllerCallback; } /** @hide */ public final void setDecorCallback(DecorCallback decorCallback) { mDecorCallback = decorCallback; } /** @hide */ @WindowInsetsController.Appearance public final int getSystemBarAppearance() { return mSystemBarAppearance; } /** @hide */ public final void dispatchOnSystemBarAppearanceChanged( @WindowInsetsController.Appearance int appearance) { mSystemBarAppearance = appearance; if (mDecorCallback != null) { mDecorCallback.onSystemBarAppearanceChanged(appearance); } } /** * Set a callback for changes of area where caption will draw its content. * Loading core/java/android/view/WindowCallbackWrapper.java +0 −5 Original line number Diff line number Diff line Loading @@ -163,10 +163,5 @@ public class WindowCallbackWrapper implements Window.Callback { public void onPointerCaptureChanged(boolean hasCapture) { mWrapped.onPointerCaptureChanged(hasCapture); } @Override public void onSystemBarAppearanceChanged(@WindowInsetsController.Appearance int appearance) { mWrapped.onSystemBarAppearanceChanged(appearance); } } Loading
core/java/android/inputmethodservice/InputMethodService.java +2 −2 Original line number Diff line number Diff line Loading @@ -475,7 +475,7 @@ public class InputMethodService extends AbstractInputMethodService { private InputMethodPrivilegedOperations mPrivOps = new InputMethodPrivilegedOperations(); @NonNull final NavigationBarController mNavigationBarController = private final NavigationBarController mNavigationBarController = new NavigationBarController(this); @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) Loading Loading @@ -1504,7 +1504,7 @@ public class InputMethodService extends AbstractInputMethodService { Context.LAYOUT_INFLATER_SERVICE); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.initSoftInputWindow"); mWindow = new SoftInputWindow(this, mTheme, mDispatcherState); mNavigationBarController.onSoftInputWindowCreated(mWindow); { final Window window = mWindow.getWindow(); { Loading
core/java/android/inputmethodservice/NavigationBarController.java +15 −8 Original line number Diff line number Diff line Loading @@ -65,6 +65,9 @@ final class NavigationBarController { @NonNull ViewTreeObserver.InternalInsetsInfo dest) { } default void onSoftInputWindowCreated(@NonNull SoftInputWindow softInputWindow) { } default void onViewInitialized() { } Loading @@ -78,9 +81,6 @@ final class NavigationBarController { boolean shouldShowImeSwitcherWhenImeIsShown) { } default void onSystemBarAppearanceChanged(@Appearance int appearance) { } default String toDebugString() { return "No-op implementation"; } Loading @@ -101,6 +101,10 @@ final class NavigationBarController { mImpl.updateTouchableInsets(originalInsets, dest); } void onSoftInputWindowCreated(@NonNull SoftInputWindow softInputWindow) { mImpl.onSoftInputWindowCreated(softInputWindow); } void onViewInitialized() { mImpl.onViewInitialized(); } Loading @@ -117,15 +121,11 @@ final class NavigationBarController { mImpl.setShouldShowImeSwitcherWhenImeIsShown(shouldShowImeSwitcherWhenImeIsShown); } void onSystemBarAppearanceChanged(@Appearance int appearance) { mImpl.onSystemBarAppearanceChanged(appearance); } String toDebugString() { return mImpl.toDebugString(); } private static final class Impl implements Callback { private static final class Impl implements Callback, Window.DecorCallback { private static final int DEFAULT_COLOR_ADAPT_TRANSITION_TIME = 1700; // Copied from com.android.systemui.animation.Interpolators#LEGACY_DECELERATE Loading Loading @@ -361,6 +361,13 @@ final class NavigationBarController { == WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; } @Override public void onSoftInputWindowCreated(@NonNull SoftInputWindow softInputWindow) { final Window window = softInputWindow.getWindow(); mAppearance = window.getSystemBarAppearance(); window.setDecorCallback(this); } @Override public void onViewInitialized() { if (mDestroyed) { Loading
core/java/android/inputmethodservice/SoftInputWindow.java +0 −6 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.util.proto.ProtoOutputStream; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.WindowInsetsController; import android.view.WindowManager; import java.lang.annotation.Retention; Loading Loading @@ -264,11 +263,6 @@ final class SoftInputWindow extends Dialog { } } @Override public void onSystemBarAppearanceChanged(@WindowInsetsController.Appearance int appearance) { mService.mNavigationBarController.onSystemBarAppearanceChanged(appearance); } void dumpDebug(ProtoOutputStream proto, long fieldId) { final long token = proto.start(fieldId); mBounds.dumpDebug(proto, BOUNDS); Loading
core/java/android/view/Window.java +34 −11 Original line number Diff line number Diff line Loading @@ -295,6 +295,9 @@ public abstract class Window { private OnWindowDismissedCallback mOnWindowDismissedCallback; private OnWindowSwipeDismissedCallback mOnWindowSwipeDismissedCallback; private WindowControllerCallback mWindowControllerCallback; @WindowInsetsController.Appearance private int mSystemBarAppearance; private DecorCallback mDecorCallback; private OnRestrictedCaptionAreaChangedListener mOnRestrictedCaptionAreaChangedListener; private Rect mRestrictedCaptionAreaRect; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) Loading Loading @@ -607,17 +610,6 @@ public abstract class Window { * @param hasCapture True if the window has pointer capture. */ default public void onPointerCaptureChanged(boolean hasCapture) { }; /** * Called from * {@link com.android.internal.policy.DecorView#onSystemBarAppearanceChanged(int)}. * * @param appearance The newly applied appearance. * @hide */ default void onSystemBarAppearanceChanged( @WindowInsetsController.Appearance int appearance) { } } /** @hide */ Loading Loading @@ -672,6 +664,17 @@ public abstract class Window { void updateNavigationBarColor(int color); } /** @hide */ public interface DecorCallback { /** * Called from * {@link com.android.internal.policy.DecorView#onSystemBarAppearanceChanged(int)}. * * @param appearance The newly applied appearance. */ void onSystemBarAppearanceChanged(@WindowInsetsController.Appearance int appearance); } /** * Callback for clients that want to be aware of where caption draws content. */ Loading Loading @@ -996,6 +999,26 @@ public abstract class Window { return mWindowControllerCallback; } /** @hide */ public final void setDecorCallback(DecorCallback decorCallback) { mDecorCallback = decorCallback; } /** @hide */ @WindowInsetsController.Appearance public final int getSystemBarAppearance() { return mSystemBarAppearance; } /** @hide */ public final void dispatchOnSystemBarAppearanceChanged( @WindowInsetsController.Appearance int appearance) { mSystemBarAppearance = appearance; if (mDecorCallback != null) { mDecorCallback.onSystemBarAppearanceChanged(appearance); } } /** * Set a callback for changes of area where caption will draw its content. * Loading
core/java/android/view/WindowCallbackWrapper.java +0 −5 Original line number Diff line number Diff line Loading @@ -163,10 +163,5 @@ public class WindowCallbackWrapper implements Window.Callback { public void onPointerCaptureChanged(boolean hasCapture) { mWrapped.onPointerCaptureChanged(hasCapture); } @Override public void onSystemBarAppearanceChanged(@WindowInsetsController.Appearance int appearance) { mWrapped.onSystemBarAppearanceChanged(appearance); } }