Loading core/java/android/view/InsetsController.java +17 −2 Original line number Diff line number Diff line Loading @@ -1057,6 +1057,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation boolean canRun = false; if (show) { // Show request if (fromIme) { ImeTracing.getInstance().triggerClientDump( "ImeInsetsSourceConsumer#requestShow", mHost.getInputMethodManager(), null /* icProto */); } switch(consumer.requestShow(fromIme)) { case ShowResult.SHOW_IMMEDIATELY: canRun = true; Loading Loading @@ -1096,8 +1101,18 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation + fromIme); // We don't have a control at the moment. However, we still want to update requested // visibility state such that in case we get control, we can apply show animation. if (fromIme) { ImeTracing.getInstance().triggerClientDump( "InsetsSourceConsumer#show", mHost.getInputMethodManager(), null /* icProto */); } consumer.show(fromIme); } else if (animationType == ANIMATION_TYPE_HIDE) { if (fromIme) { ImeTracing.getInstance().triggerClientDump( "InsetsSourceConsumer#hide", mHost.getInputMethodManager(), null /* icProto */); } consumer.hide(); } } Loading Loading @@ -1217,8 +1232,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private void applyLocalVisibilityOverride() { for (int i = mSourceConsumers.size() - 1; i >= 0; i--) { final InsetsSourceConsumer controller = mSourceConsumers.valueAt(i); controller.applyLocalVisibilityOverride(); final InsetsSourceConsumer consumer = mSourceConsumers.valueAt(i); consumer.applyLocalVisibilityOverride(); } } Loading core/java/android/view/InsetsSourceConsumer.java +12 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.view.InsetsSourceConsumerProto.IS_REQUESTED_VISIBLE; import static android.view.InsetsSourceConsumerProto.PENDING_FRAME; import static android.view.InsetsSourceConsumerProto.PENDING_VISIBLE_FRAME; import static android.view.InsetsSourceConsumerProto.SOURCE_CONTROL; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.getDefaultVisibility; import static android.view.InsetsState.toPublicType; Loading @@ -34,6 +35,7 @@ import android.annotation.IntDef; import android.annotation.Nullable; import android.graphics.Rect; import android.util.Log; import android.util.imetracing.ImeTracing; import android.util.proto.ProtoOutputStream; import android.view.InsetsState.InternalInsetsType; import android.view.SurfaceControl.Transaction; Loading Loading @@ -108,6 +110,10 @@ public class InsetsSourceConsumer { */ public void setControl(@Nullable InsetsSourceControl control, @InsetsType int[] showTypes, @InsetsType int[] hideTypes) { if (mType == ITYPE_IME) { ImeTracing.getInstance().triggerClientDump("InsetsSourceConsumer#setControl", mController.getHost().getInputMethodManager(), null /* icProto */); } if (mSourceControl == control) { return; } Loading Loading @@ -237,6 +243,12 @@ public class InsetsSourceConsumer { final boolean isVisible = source != null ? source.isVisible() : getDefaultVisibility(mType); final boolean hasControl = mSourceControl != null; if (mType == ITYPE_IME) { ImeTracing.getInstance().triggerClientDump( "InsetsSourceConsumer#applyLocalVisibilityOverride", mController.getHost().getInputMethodManager(), null /* icProto */); } // We still need to let the legacy app know the visibility change even if we don't have the // control. If we don't have the source, we don't change the requested visibility for making // the callback behavior compatible. Loading core/java/android/view/ViewRootImpl.java +9 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.InputDevice.SOURCE_CLASS_NONE; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.InsetsState.SIZE; Loading Loading @@ -7931,6 +7932,10 @@ public final class ViewRootImpl implements ViewParent, if (mTranslator != null) { mTranslator.translateInsetsStateInScreenToAppWindow(insetsState); } if (insetsState != null && insetsState.getSource(ITYPE_IME).isVisible()) { ImeTracing.getInstance().triggerClientDump("ViewRootImpl#dispatchInsetsChanged", getInsetsController().getHost().getInputMethodManager(), null /* icProto */); } mHandler.obtainMessage(MSG_INSETS_CHANGED, insetsState).sendToTarget(); } Loading @@ -7947,6 +7952,10 @@ public final class ViewRootImpl implements ViewParent, if (mTranslator != null) { mTranslator.translateInsetsStateInScreenToAppWindow(insetsState); } if (insetsState != null && insetsState.getSource(ITYPE_IME).isVisible()) { ImeTracing.getInstance().triggerClientDump("ViewRootImpl#dispatchInsetsControlChanged", getInsetsController().getHost().getInputMethodManager(), null /* icProto */); } SomeArgs args = SomeArgs.obtain(); args.arg1 = insetsState; args.arg2 = activeControls; Loading core/java/android/view/inputmethod/InputMethodManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,9 @@ public final class InputMethodManager { */ @Override public void finishInput() { ImeTracing.getInstance().triggerClientDump( "InputMethodManager.DelegateImpl#finishInput", InputMethodManager.this, null /* icProto */); synchronized (mH) { finishInputLocked(); } Loading Loading @@ -641,6 +644,10 @@ public final class InputMethodManager { int startInputFlags = getStartInputFlags(focusedView, 0); startInputFlags |= StartInputFlags.WINDOW_GAINED_FOCUS; ImeTracing.getInstance().triggerClientDump( "InputMethodManager.DelegateImpl#startInputAsyncOnWindowFocusGain", InputMethodManager.this, null /* icProto */); final ImeFocusController controller = getFocusController(); if (controller == null) { return; Loading Loading @@ -950,6 +957,9 @@ public final class InputMethodManager { case MSG_APPLY_IME_VISIBILITY: { synchronized (mH) { if (mImeInsetsConsumer != null) { ImeTracing.getInstance().triggerClientDump( "ImeInsetsSourceConsumer#applyImeVisibility", InputMethodManager.this, null /* icProto */); mImeInsetsConsumer.applyImeVisibility(msg.arg1 != 0); } } Loading Loading @@ -1860,6 +1870,9 @@ public final class InputMethodManager { * {@link #HIDE_NOT_ALWAYS} bit set. **/ public void toggleSoftInputFromWindow(IBinder windowToken, int showFlags, int hideFlags) { ImeTracing.getInstance().triggerClientDump( "InputMethodManager#toggleSoftInputFromWindow", InputMethodManager.this, null /* icProto */); synchronized (mH) { final View servedView = getServedViewLocked(); if (servedView == null || servedView.getWindowToken() != windowToken) { Loading Loading @@ -1887,6 +1900,9 @@ public final class InputMethodManager { * {@link #HIDE_NOT_ALWAYS} bit set. */ public void toggleSoftInput(int showFlags, int hideFlags) { ImeTracing.getInstance().triggerClientDump( "InputMethodManager#toggleSoftInput", InputMethodManager.this, null /* icProto */); if (mCurMethod != null) { try { mCurMethod.toggleSoftInput(showFlags, hideFlags); Loading Loading
core/java/android/view/InsetsController.java +17 −2 Original line number Diff line number Diff line Loading @@ -1057,6 +1057,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation boolean canRun = false; if (show) { // Show request if (fromIme) { ImeTracing.getInstance().triggerClientDump( "ImeInsetsSourceConsumer#requestShow", mHost.getInputMethodManager(), null /* icProto */); } switch(consumer.requestShow(fromIme)) { case ShowResult.SHOW_IMMEDIATELY: canRun = true; Loading Loading @@ -1096,8 +1101,18 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation + fromIme); // We don't have a control at the moment. However, we still want to update requested // visibility state such that in case we get control, we can apply show animation. if (fromIme) { ImeTracing.getInstance().triggerClientDump( "InsetsSourceConsumer#show", mHost.getInputMethodManager(), null /* icProto */); } consumer.show(fromIme); } else if (animationType == ANIMATION_TYPE_HIDE) { if (fromIme) { ImeTracing.getInstance().triggerClientDump( "InsetsSourceConsumer#hide", mHost.getInputMethodManager(), null /* icProto */); } consumer.hide(); } } Loading Loading @@ -1217,8 +1232,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private void applyLocalVisibilityOverride() { for (int i = mSourceConsumers.size() - 1; i >= 0; i--) { final InsetsSourceConsumer controller = mSourceConsumers.valueAt(i); controller.applyLocalVisibilityOverride(); final InsetsSourceConsumer consumer = mSourceConsumers.valueAt(i); consumer.applyLocalVisibilityOverride(); } } Loading
core/java/android/view/InsetsSourceConsumer.java +12 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.view.InsetsSourceConsumerProto.IS_REQUESTED_VISIBLE; import static android.view.InsetsSourceConsumerProto.PENDING_FRAME; import static android.view.InsetsSourceConsumerProto.PENDING_VISIBLE_FRAME; import static android.view.InsetsSourceConsumerProto.SOURCE_CONTROL; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.getDefaultVisibility; import static android.view.InsetsState.toPublicType; Loading @@ -34,6 +35,7 @@ import android.annotation.IntDef; import android.annotation.Nullable; import android.graphics.Rect; import android.util.Log; import android.util.imetracing.ImeTracing; import android.util.proto.ProtoOutputStream; import android.view.InsetsState.InternalInsetsType; import android.view.SurfaceControl.Transaction; Loading Loading @@ -108,6 +110,10 @@ public class InsetsSourceConsumer { */ public void setControl(@Nullable InsetsSourceControl control, @InsetsType int[] showTypes, @InsetsType int[] hideTypes) { if (mType == ITYPE_IME) { ImeTracing.getInstance().triggerClientDump("InsetsSourceConsumer#setControl", mController.getHost().getInputMethodManager(), null /* icProto */); } if (mSourceControl == control) { return; } Loading Loading @@ -237,6 +243,12 @@ public class InsetsSourceConsumer { final boolean isVisible = source != null ? source.isVisible() : getDefaultVisibility(mType); final boolean hasControl = mSourceControl != null; if (mType == ITYPE_IME) { ImeTracing.getInstance().triggerClientDump( "InsetsSourceConsumer#applyLocalVisibilityOverride", mController.getHost().getInputMethodManager(), null /* icProto */); } // We still need to let the legacy app know the visibility change even if we don't have the // control. If we don't have the source, we don't change the requested visibility for making // the callback behavior compatible. Loading
core/java/android/view/ViewRootImpl.java +9 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.InputDevice.SOURCE_CLASS_NONE; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.InsetsState.SIZE; Loading Loading @@ -7931,6 +7932,10 @@ public final class ViewRootImpl implements ViewParent, if (mTranslator != null) { mTranslator.translateInsetsStateInScreenToAppWindow(insetsState); } if (insetsState != null && insetsState.getSource(ITYPE_IME).isVisible()) { ImeTracing.getInstance().triggerClientDump("ViewRootImpl#dispatchInsetsChanged", getInsetsController().getHost().getInputMethodManager(), null /* icProto */); } mHandler.obtainMessage(MSG_INSETS_CHANGED, insetsState).sendToTarget(); } Loading @@ -7947,6 +7952,10 @@ public final class ViewRootImpl implements ViewParent, if (mTranslator != null) { mTranslator.translateInsetsStateInScreenToAppWindow(insetsState); } if (insetsState != null && insetsState.getSource(ITYPE_IME).isVisible()) { ImeTracing.getInstance().triggerClientDump("ViewRootImpl#dispatchInsetsControlChanged", getInsetsController().getHost().getInputMethodManager(), null /* icProto */); } SomeArgs args = SomeArgs.obtain(); args.arg1 = insetsState; args.arg2 = activeControls; Loading
core/java/android/view/inputmethod/InputMethodManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,9 @@ public final class InputMethodManager { */ @Override public void finishInput() { ImeTracing.getInstance().triggerClientDump( "InputMethodManager.DelegateImpl#finishInput", InputMethodManager.this, null /* icProto */); synchronized (mH) { finishInputLocked(); } Loading Loading @@ -641,6 +644,10 @@ public final class InputMethodManager { int startInputFlags = getStartInputFlags(focusedView, 0); startInputFlags |= StartInputFlags.WINDOW_GAINED_FOCUS; ImeTracing.getInstance().triggerClientDump( "InputMethodManager.DelegateImpl#startInputAsyncOnWindowFocusGain", InputMethodManager.this, null /* icProto */); final ImeFocusController controller = getFocusController(); if (controller == null) { return; Loading Loading @@ -950,6 +957,9 @@ public final class InputMethodManager { case MSG_APPLY_IME_VISIBILITY: { synchronized (mH) { if (mImeInsetsConsumer != null) { ImeTracing.getInstance().triggerClientDump( "ImeInsetsSourceConsumer#applyImeVisibility", InputMethodManager.this, null /* icProto */); mImeInsetsConsumer.applyImeVisibility(msg.arg1 != 0); } } Loading Loading @@ -1860,6 +1870,9 @@ public final class InputMethodManager { * {@link #HIDE_NOT_ALWAYS} bit set. **/ public void toggleSoftInputFromWindow(IBinder windowToken, int showFlags, int hideFlags) { ImeTracing.getInstance().triggerClientDump( "InputMethodManager#toggleSoftInputFromWindow", InputMethodManager.this, null /* icProto */); synchronized (mH) { final View servedView = getServedViewLocked(); if (servedView == null || servedView.getWindowToken() != windowToken) { Loading Loading @@ -1887,6 +1900,9 @@ public final class InputMethodManager { * {@link #HIDE_NOT_ALWAYS} bit set. */ public void toggleSoftInput(int showFlags, int hideFlags) { ImeTracing.getInstance().triggerClientDump( "InputMethodManager#toggleSoftInput", InputMethodManager.this, null /* icProto */); if (mCurMethod != null) { try { mCurMethod.toggleSoftInput(showFlags, hideFlags); Loading