Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6e47804 authored by Steve Elliott's avatar Steve Elliott Committed by Android (Google) Code Review
Browse files

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

parents d7b7a5a2 8ca7b557
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte
            ExpandableNotificationRow row,
            boolean animate,
            boolean isActivityIntent) {
        mLogger.logStartNotificationIntent(entry.getKey(), intent);
        mLogger.logStartNotificationIntent(entry.getKey());
        try {
            Runnable onFinishAnimationCallback = animate
                    ? () -> mLaunchEventsEmitter.notifyFinishLaunchNotifActivity(entry)
@@ -513,8 +513,10 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte
                                mKeyguardStateController.isShowing(),
                                eventTime)
                                : getActivityOptions(mCentralSurfaces.getDisplayId(), adapter);
                        return intent.sendAndReturnResult(mContext, 0, fillInIntent, null,
                        int result = intent.sendAndReturnResult(mContext, 0, fillInIntent, null,
                                null, null, options);
                        mLogger.logSendPendingIntent(entry.getKey(), intent, result);
                        return result;
                    });
        } catch (PendingIntent.CanceledException e) {
            // the stack trace isn't very helpful here.
+14 −5
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class StatusBarNotificationActivityStarterLogger @Inject constructor(
        buffer.log(TAG, DEBUG, {
            str1 = key
        }, {
            "(1/4) onNotificationClicked: $str1"
            "(1/5) onNotificationClicked: $str1"
        })
    }

@@ -40,7 +40,7 @@ class StatusBarNotificationActivityStarterLogger @Inject constructor(
        buffer.log(TAG, DEBUG, {
            str1 = key
        }, {
            "(2/4) handleNotificationClickAfterKeyguardDismissed: $str1"
            "(2/5) handleNotificationClickAfterKeyguardDismissed: $str1"
        })
    }

@@ -48,16 +48,25 @@ class StatusBarNotificationActivityStarterLogger @Inject constructor(
        buffer.log(TAG, DEBUG, {
            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, {
            str1 = key
            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"
        })
    }