2024-08-17 12:35:07 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-08-05 16:03:46 -04:00
|
|
|
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
|
2024-08-17 12:35:07 -04:00
|
|
|
index 905c7811e457..39395074b916 100644
|
2024-08-05 16:03:46 -04:00
|
|
|
--- a/core/java/android/service/notification/StatusBarNotification.java
|
|
|
|
+++ b/core/java/android/service/notification/StatusBarNotification.java
|
2024-08-17 12:35:07 -04:00
|
|
|
@@ -273,6 +273,18 @@ public class StatusBarNotification implements Parcelable {
|
2024-08-05 16:03:46 -04:00
|
|
|
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;
|