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

Commit 64d9d6eb authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Automerger Merge Worker
Browse files

Merge "Send attributionTag to notification APIs" into rvc-dev am: 7443e3de

Change-Id: I978b101a36a251d9428dd2d17711d30511c6f2b9
parents 558095e5 7443e3de
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -397,9 +397,9 @@ public class NotificationBackend {
        return false;
    }

    public NotificationHistory getNotificationHistory(String pkg) {
    public NotificationHistory getNotificationHistory(String pkg, String attributionTag) {
        try {
            return sINM.getNotificationHistory(pkg);
            return sINM.getNotificationHistory(pkg, attributionTag);
        } catch (Exception e) {
            Log.w(TAG, "Error calling NoMan", e);
        }
+2 −1
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ public class HistoryLoader {
            try {
                Map<String, NotificationHistoryPackage> historicalNotifications = new HashMap<>();
                NotificationHistory history =
                        mBackend.getNotificationHistory(mContext.getPackageName());
                        mBackend.getNotificationHistory(mContext.getPackageName(),
                                mContext.getAttributionTag());
                while (history.hasNextNotification()) {
                    HistoricalNotification hn = history.getNextNotification();

+3 −2
Original line number Diff line number Diff line
@@ -246,8 +246,9 @@ public class NotificationHistoryActivity extends Activity {
            StatusBarNotification[] dismissed = null;
            try {
                snoozed = getSnoozedNotifications();
                dismissed = mNm.getHistoricalNotifications(
                    NotificationHistoryActivity.this.getPackageName(), 6, false);
                dismissed = mNm.getHistoricalNotificationsWithAttribution(
                        NotificationHistoryActivity.this.getPackageName(),
                        NotificationHistoryActivity.this.getAttributionTag(), 6, false);
            } catch (SecurityException | RemoteException e) {
                Log.d(TAG, "OnPaused called while trying to retrieve notifications");
            }
+4 −4
Original line number Diff line number Diff line
@@ -372,10 +372,10 @@ public class NotificationStation extends SettingsPreferenceFragment {
     */
    private void loadNotifications() {
        try {
            StatusBarNotification[] active = mNoMan.getActiveNotifications(
                    mContext.getPackageName());
            StatusBarNotification[] dismissed = mNoMan.getHistoricalNotifications(
                    mContext.getPackageName(), 50, false);
            StatusBarNotification[] active = mNoMan.getActiveNotificationsWithAttribution(
                    mContext.getPackageName(), mContext.getAttributionTag());
            StatusBarNotification[] dismissed = mNoMan.getHistoricalNotificationsWithAttribution(
                    mContext.getPackageName(), mContext.getAttributionTag(), 50, false);

            List<HistoricalNotificationInfo> list
                    = new ArrayList<>(active.length + dismissed.length);