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

Commit 2f0dca39 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Notification history should always be accessed as uid 1000" into...

Merge "Notification history should always be accessed as uid 1000" into rvc-dev am: 6e44121b am: 43c5878b am: 60a8a122

Change-Id: I4b2f9aae85d753dda8a1e6121219ad4b811e4e63
parents 55e5c0d9 60a8a122
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -108,7 +108,9 @@ public class NotificationHistoryDatabase {
    public void init() {
        synchronized (mLock) {
            try {
                mHistoryDir.mkdir();
                if (!mHistoryDir.mkdir()) {
                    throw new IllegalStateException("could not create history directory");
                }
                mVersionFile.createNewFile();
            } catch (Exception e) {
                Slog.e(TAG, "could not create needed files", e);
+13 −9
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.Context;
import android.content.pm.UserInfo;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Binder;
import android.os.Environment;
import android.os.Handler;
import android.os.UserHandle;
@@ -37,6 +38,7 @@ import android.util.SparseBooleanArray;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.FunctionalUtils;
import com.android.server.IoThread;

import java.io.File;
@@ -198,6 +200,7 @@ public class NotificationHistoryManager {
    }

    public void addNotification(@NonNull final HistoricalNotification notification) {
        Binder.withCleanCallingIdentity(() -> {
            synchronized (mLock) {
                final NotificationHistoryDatabase userHistory =
                        getUserHistoryAndInitializeIfNeededLocked(notification.getUserId());
@@ -208,6 +211,7 @@ public class NotificationHistoryManager {
                }
                userHistory.addNotification(notification);
            }
        });
    }

    public @NonNull NotificationHistory readNotificationHistory(@UserIdInt int[] userIds) {