summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ibrahim Yilmaz <iyz@google.com> 2023-10-13 19:42:33 +0000
committer Ibrahim Yilmaz <iyz@google.com> 2023-10-16 14:46:36 +0000
commit59852c0735ff2bc9127df3b802b1781bfa660ddf (patch)
tree53f3876685bcb42c4f402c4a14d923c108d49d03
parentd3f3084d75a6a1e02ddffd2487161fc76fb4270f (diff)
Add Reason to addRemoteInput Logs
This CL improves addRemoteInput logs and make similar them to removeRemoteInputs. Example output: 1. addRemoteInput reason:RemoteInputView#focus entry: key, style:BigTextStyle .. 2. removeRemoteInput reason: RemoteInputViewController#sendRemoteInput entry:key, style: BigTextStyle .. 3. removeRemoteInput reason: RemoteInputView#onDefocus entry: key, style: BigTextStyle .. 4. removeRemoteInput reason: RemoteInputView$WindowInsetAnimation#onEnd entry: key, style: BigTextStyle .. 5. removeRemoteInput reason: RemoteInputView$WindowInsetAnimation#onEnd entry: key, style: BigTextStyle .. 6. removeRemoteInput reason: RemoteInputView#onDetachedFromWindow entry:key, style: BigTextStyle.. Bug: 290068526 Test: RemoteInputLogger addRemoteInput logs in BR Change-Id: I863be99cb386d3b04a06b5445614225eee840610
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/RemoteInputControllerLogger.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java2
3 files changed, 15 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
index 63282d2904e8..17da015789ea 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
@@ -71,7 +71,8 @@ public class RemoteInputController {
* @param entry the entry for which a remote input is now active.
* @param token a token identifying the view that is managing the remote input
*/
- public void addRemoteInput(NotificationEntry entry, Object token) {
+ public void addRemoteInput(NotificationEntry entry, Object token,
+ @CompileTimeConstant String reason) {
Objects.requireNonNull(entry);
Objects.requireNonNull(token);
boolean isActive = isRemoteInputActive(entry);
@@ -79,7 +80,9 @@ public class RemoteInputController {
entry /* contains */, null /* remove */, token /* removeToken */);
mLogger.logAddRemoteInput(entry.getKey()/* entryKey */,
isActive /* isRemoteInputAlreadyActive */,
- found /* isRemoteInputFound */);
+ found /* isRemoteInputFound */,
+ reason /* reason */,
+ entry.getNotificationStyle()/* notificationStyle */);
if (!found) {
mOpen.add(new Pair<>(new WeakReference<>(entry), token));
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/RemoteInputControllerLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/RemoteInputControllerLogger.kt
index 97770316442c..ff89c62ab496 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/RemoteInputControllerLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/RemoteInputControllerLogger.kt
@@ -32,17 +32,24 @@ constructor(@NotificationRemoteInputLog private val logBuffer: LogBuffer) {
fun logAddRemoteInput(
entryKey: String,
isRemoteInputAlreadyActive: Boolean,
- isRemoteInputFound: Boolean
+ isRemoteInputFound: Boolean,
+ reason: String,
+ notificationStyle: String
) =
logBuffer.log(
TAG,
DEBUG,
{
str1 = entryKey
+ str2 = reason
+ str3 = notificationStyle
bool1 = isRemoteInputAlreadyActive
bool2 = isRemoteInputFound
},
- { "addRemoteInput entry: $str1, isAlreadyActive: $bool1, isFound:$bool2" }
+ {
+ "addRemoteInput reason:$str2 entry: $str1, style:$str3" +
+ ", isAlreadyActive: $bool1, isFound:$bool2"
+ }
)
/** logs removeRemoteInput invocation of [RemoteInputController] */
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
index 7c96029cfe15..ceed81a182aa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
@@ -657,7 +657,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
mEditText.setText(mEntry.remoteInputText);
mEditText.setSelection(mEditText.length());
mEditText.requestFocus();
- mController.addRemoteInput(mEntry, mToken);
+ mController.addRemoteInput(mEntry, mToken, "RemoteInputView#focus");
setAttachment(mEntry.remoteInputAttachment);
updateSendButton();