Merge "Log result of notification pending intent launch" into tm-dev

This commit is contained in:
Steve Elliott
2022-04-05 21:02:51 +00:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 7 deletions

View File

@@ -489,7 +489,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte
ExpandableNotificationRow row, ExpandableNotificationRow row,
boolean animate, boolean animate,
boolean isActivityIntent) { boolean isActivityIntent) {
mLogger.logStartNotificationIntent(entry.getKey(), intent); mLogger.logStartNotificationIntent(entry.getKey());
try { try {
Runnable onFinishAnimationCallback = animate Runnable onFinishAnimationCallback = animate
? () -> mLaunchEventsEmitter.notifyFinishLaunchNotifActivity(entry) ? () -> mLaunchEventsEmitter.notifyFinishLaunchNotifActivity(entry)
@@ -513,8 +513,10 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte
mKeyguardStateController.isShowing(), mKeyguardStateController.isShowing(),
eventTime) eventTime)
: getActivityOptions(mCentralSurfaces.getDisplayId(), adapter); : getActivityOptions(mCentralSurfaces.getDisplayId(), adapter);
return intent.sendAndReturnResult(mContext, 0, fillInIntent, null, int result = intent.sendAndReturnResult(mContext, 0, fillInIntent, null,
null, null, options); null, null, options);
mLogger.logSendPendingIntent(entry.getKey(), intent, result);
return result;
}); });
} catch (PendingIntent.CanceledException e) { } catch (PendingIntent.CanceledException e) {
// the stack trace isn't very helpful here. // the stack trace isn't very helpful here.

View File

@@ -32,7 +32,7 @@ class StatusBarNotificationActivityStarterLogger @Inject constructor(
buffer.log(TAG, DEBUG, { buffer.log(TAG, DEBUG, {
str1 = key str1 = key
}, { }, {
"(1/4) onNotificationClicked: $str1" "(1/5) onNotificationClicked: $str1"
}) })
} }
@@ -40,7 +40,7 @@ class StatusBarNotificationActivityStarterLogger @Inject constructor(
buffer.log(TAG, DEBUG, { buffer.log(TAG, DEBUG, {
str1 = key str1 = key
}, { }, {
"(2/4) handleNotificationClickAfterKeyguardDismissed: $str1" "(2/5) handleNotificationClickAfterKeyguardDismissed: $str1"
}) })
} }
@@ -48,16 +48,25 @@ class StatusBarNotificationActivityStarterLogger @Inject constructor(
buffer.log(TAG, DEBUG, { buffer.log(TAG, DEBUG, {
str1 = key str1 = key
}, { }, {
"(3/4) handleNotificationClickAfterPanelCollapsed: $str1" "(3/5) handleNotificationClickAfterPanelCollapsed: $str1"
}) })
} }
fun logStartNotificationIntent(key: String, pendingIntent: PendingIntent) { fun logStartNotificationIntent(key: String) {
buffer.log(TAG, INFO, {
str1 = key
}, {
"(4/5) startNotificationIntent: $str1"
})
}
fun logSendPendingIntent(key: String, pendingIntent: PendingIntent, result: Int) {
buffer.log(TAG, INFO, { buffer.log(TAG, INFO, {
str1 = key str1 = key
str2 = pendingIntent.intent.toString() str2 = pendingIntent.intent.toString()
int1 = result
}, { }, {
"(4/4) Starting $str2 for notification $str1" "(5/5) Started intent $str2 for notification $str1 with result code $int1"
}) })
} }