DivestOS/Patches/LineageOS-17.1/android_frameworks_base/399082.patch
Tavi 7251c3f1d1
Churn
Signed-off-by: Tavi <tavi@divested.dev>
2024-08-17 12:35:07 -04:00

38 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Julia Reynolds <juliacr@google.com>
Date: Mon, 13 Apr 2020 11:03:44 -0400
Subject: [PATCH] Add StatusBarNotification::getNormalizedUserId
Required for ASB 2024-06
Cherry-picked from I9b2ae1ecd1cc8b42ab715ee033879f295949a9ba
Change-Id: Ife602cee53c303dd3f841004d8ffc84b38c7677b
---
.../service/notification/StatusBarNotification.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java
index 905c7811e457..39395074b916 100644
--- a/core/java/android/service/notification/StatusBarNotification.java
+++ b/core/java/android/service/notification/StatusBarNotification.java
@@ -273,6 +273,18 @@ public class StatusBarNotification implements Parcelable {
return this.user.getIdentifier();
}
+ /**
+ * Like {@link #getUserId()} but handles special users.
+ * @hide
+ */
+ public int getNormalizedUserId() {
+ int userId = getUserId();
+ if (userId == UserHandle.USER_ALL) {
+ userId = UserHandle.USER_SYSTEM;
+ }
+ return userId;
+ }
+
/** The package that the notification belongs to. */
public String getPackageName() {
return pkg;