summaryrefslogtreecommitdiff
path: root/core/java/android/view/InsetsSourceConsumer.java
diff options
context:
space:
mode:
authorIoana Stefan <ioanastefan@google.com>2020-12-01 10:34:36 +0000
committerIoana Stefan <ioanastefan@google.com>2020-12-02 16:48:40 +0000
commit09bd8a6e386c19a0e6e6afa38074bf335eefea49 (patch)
tree4837dfd0c00a987da549fff9b83d8353bde2b59b /core/java/android/view/InsetsSourceConsumer.java
parentcfa7acdf8e233c4bcb1038b5772bc4ee52263028 (diff)
Add extra methods to trigger IME tracing dumps
This change adds extra methods for triggering IME dumps, based on the places decided on go/ime-tracing-opt. Bug: 154348613 Test: record an IME trace through ADB Connect in Winscope and visualize dumps at the new places added Change-Id: Idbe8d512c0f1b3d3aca525f160f6e45d657e3724
Diffstat (limited to 'core/java/android/view/InsetsSourceConsumer.java')
-rw-r--r--core/java/android/view/InsetsSourceConsumer.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java
index 537fd42d7135..7ee337137176 100644
--- a/core/java/android/view/InsetsSourceConsumer.java
+++ b/core/java/android/view/InsetsSourceConsumer.java
@@ -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;
@@ -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;
@@ -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());
+ }
if (mSourceControl == control) {
return;
}
@@ -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());
+ }
+
// 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.