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

Commit 8ca7b557 authored by Steve Elliott's avatar Steve Elliott
Browse files

Log result of notification pending intent launch

Bug: 225884919
Test: click a notification, verify new logging is present
Change-Id: I50c36d930de2c3cc8f080616ffd01a786e366013
parent dd992609
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"
        })
    }