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

Commit 86cdcd33 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use userid of sender, not notification target."

parents 311eb20b d5261e1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ public class StatusBarNotification implements Parcelable {
    }

    /**
     * Returns a userHandle for the instance of the app that posted this notification.
     * Returns a userid for whom this notification is intended.
     *
     * @deprecated Use {@link #getUser()} instead.
     */
+3 −8
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.app.Notification;
import android.app.NotificationChannel;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.graphics.Bitmap;
@@ -136,15 +137,9 @@ public final class NotificationRecord {
    private boolean isPreChannelsNotification() {
        try {
            if (NotificationChannel.DEFAULT_CHANNEL_ID.equals(getChannel().getId())) {
                final boolean isSystemNotification =
                        NotificationManagerService.isUidSystem(sbn.getUid())
                                || ("android".equals(sbn.getPackageName()));
                if (isSystemNotification) {
                    return false;
                }
                  final ApplicationInfo applicationInfo =
                        mContext.getPackageManager().getApplicationInfoAsUser(sbn.getPackageName(),
                                0, sbn.getUserId());
                                0, UserHandle.getUserId(sbn.getUid()));
                if (applicationInfo.targetSdkVersion <= Build.VERSION_CODES.N_MR1) {
                    return true;
                }
+0 −5
Original line number Diff line number Diff line
@@ -784,11 +784,6 @@ public class RankingHelper implements RankingConfig {
        }
    }

    private static boolean isUidSystem(int uid) {
        final int appid = UserHandle.getAppId(uid);
        return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID || uid == 0);
    }

    private static class Record {
        static int UNKNOWN_UID = UserHandle.USER_NULL;