summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ibrahim Yilmaz <iyz@google.com> 2023-04-24 10:31:00 +0000
committer Ibrahim Yilmaz <iyz@google.com> 2023-04-24 20:27:28 +0000
commit8c6e100d6985cf2bb5f274b26ee945923272c743 (patch)
treee02cfe0cb0fa154d7bd8773a287b4c0e1a9713eb
parent66a64d23038ac4d603c04329c0fb405923b84082 (diff)
Add Last Applied RemoteInput Active value to dump
As RemoteInputController holds weak reference, isRemoteInputActive in dump may not reflect the last applied value of RemoteInputActive. It will help us directly see its last applied value and have better assumptions when isRemoteInputActive matters. Fixes: b/279397202 Test: Code Review Change-Id: I9c33a05a697ac59e2112a37d464f82c0551415bb
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
index a37b2a9e530a..58d705417632 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar;
+import android.annotation.Nullable;
import android.app.Notification;
import android.app.RemoteInput;
import android.content.Context;
@@ -55,6 +56,13 @@ public class RemoteInputController {
private final RemoteInputControllerLogger mLogger;
+ /**
+ * RemoteInput Active's last emitted value. It's added for debugging purpose to directly see
+ * its last emitted value. As RemoteInputController holds weak reference, isRemoteInputActive
+ * in dump may not reflect the last emitted value of Active.
+ */
+ @Nullable private Boolean mLastAppliedRemoteInputActive = null;
+
public RemoteInputController(Delegate delegate,
RemoteInputUriController remoteInputUriController,
RemoteInputControllerLogger logger) {
@@ -217,6 +225,7 @@ public class RemoteInputController {
for (int i = 0; i < N; i++) {
mCallbacks.get(i).onRemoteInputActive(remoteInputActive);
}
+ mLastAppliedRemoteInputActive = remoteInputActive;
}
/**
@@ -323,6 +332,8 @@ public class RemoteInputController {
/** dump debug info; called by {@link NotificationRemoteInputManager} */
public void dump(@NonNull IndentingPrintWriter pw) {
+ pw.print("mLastAppliedRemoteInputActive: ");
+ pw.println((Object) mLastAppliedRemoteInputActive);
pw.print("isRemoteInputActive: ");
pw.println(isRemoteInputActive()); // Note that this prunes the mOpen list, printed later.
pw.println("mOpen: " + mOpen.size());