mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-01-22 13:21:08 -05:00
af360bc9ea
wgetc873988898
.patch -O telecomm-01.patch wget0fb5786dbf
.patch -O mediaprovider-01.patch wget1a4b9ef510
.patch -O wifi-01.patch wget364a1d9962
.patch -O bluetooth-01.patch wget87a06448b9
.patch -O settings-01.patch wgetaaba724a68
.patch -O settings-02.patch wget507304e1f5
.patch -O native-01.patch wget89489ff5dd
.patch -O base-01.patch wgetd1765c4715
.patch -O base-02.patch wgetcbb1a0ecd6
.patch -O base-03.patch wget4725772c0b
.patch -O base-04.patch wget19747f6923
.patch -O base-05.patch wgete7a1aa9ed0
.patch -O base-06.patch wget922a7860b1
.patch -O base-07.patch wgeted183ed912
.patch -O base-08.patch wgetc6fbe1330a
.patch -O base-09.patch wget9141cac175
.patch -O base-10.patch wget41235bcc67
.patch -O av-01.patch wgeta89f704701
.patch -O av-02.patch wget6d7cd80d77
.patch -O av-03.patch wget75fc175a08
.patch -O av-04.patch wgetb023ec300f
.patch -O av-05.patch wgetc8117d1539
.patch -O av-06.patch wgetf06d23d824
.patch -O av-07.patch wget9c7408ab07
.patch -O av-08.patch wgetcfbfcefb3c
.patch -O launcher-01.patch wget4a27a7f162
.patch -O libxml-01.patch Signed-off-by: Tad <tad@spotco.us>
54 lines
2.9 KiB
Plaintext
54 lines
2.9 KiB
Plaintext
From cbb1a0ecd6b67735bdb735d76606bc03f6b955bf Mon Sep 17 00:00:00 2001
|
|
From: Ioana Alexandru <aioana@google.com>
|
|
Date: Mon, 8 May 2023 18:39:35 +0000
|
|
Subject: [PATCH] Verify URI permissions for EXTRA_REMOTE_INPUT_HISTORY_ITEMS.
|
|
|
|
Also added a step to serialize & deserialize the notification in the
|
|
test, to prevent exceptions about not being able to cast e.g.
|
|
Parcelable[] to RemoteInputHistoryItem[].
|
|
|
|
Test: atest NotificationManagerServiceTest & tested with POC from bug
|
|
Bug: 276729064
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4e19431a60300c6ea6c7f7dd64299916e4eb09bc)
|
|
Merged-In: I7053ca59f9c7f1df5226418594109cfb8b609b1e
|
|
Change-Id: I7053ca59f9c7f1df5226418594109cfb8b609b1e
|
|
---
|
|
core/java/android/app/Notification.java | 5 +++--
|
|
.../notification/NotificationManagerServiceTest.java | 7 +++++++
|
|
2 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
|
|
index 8a730fb0deaa..01528ae06cf5 100644
|
|
--- a/core/java/android/app/Notification.java
|
|
+++ b/core/java/android/app/Notification.java
|
|
@@ -2858,8 +2858,9 @@ public void visitUris(@NonNull Consumer<Uri> visitor) {
|
|
visitor.accept(person.getIconUri());
|
|
}
|
|
|
|
- final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
|
|
- extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS);
|
|
+ final RemoteInputHistoryItem[] history = extras.getParcelableArray(
|
|
+ Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS,
|
|
+ RemoteInputHistoryItem.class);
|
|
if (history != null) {
|
|
for (int i = 0; i < history.length; i++) {
|
|
RemoteInputHistoryItem item = history[i];
|
|
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
|
|
index dcaca51c176b..cf33eb5b3647 100755
|
|
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
|
|
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
|
|
@@ -5439,6 +5439,13 @@ public void testVisitUris() throws Exception {
|
|
.addExtras(extras)
|
|
.build();
|
|
|
|
+ // Serialize and deserialize the notification to make sure nothing breaks in the process,
|
|
+ // since that's what will usually happen before we get to call visitUris.
|
|
+ Parcel parcel = Parcel.obtain();
|
|
+ n.writeToParcel(parcel, 0);
|
|
+ parcel.setDataPosition(0);
|
|
+ n = new Notification(parcel);
|
|
+
|
|
Consumer<Uri> visitor = (Consumer<Uri>) spy(Consumer.class);
|
|
n.visitUris(visitor);
|
|
verify(visitor, times(1)).accept(eq(audioContents));
|