Skip to content

Commit

Permalink
DO NOT MERGE Revert "Verify URI permissions for EXTRA_REMOTE_INPUT_HI…
Browse files Browse the repository at this point in the history
…STORY_ITEMS."

This reverts commit 43b1711.

Reason for revert: regression reported at b/289223315

Bug: 289223315
Bug: 276729064
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bdc9b977e376fb3b6047530a179d00fd77f2aec1)
Merged-In: I101938fbc51592537023345ba1e642827510981b
Change-Id: I101938fbc51592537023345ba1e642827510981b
  • Loading branch information
Ioana Alexandru authored and thestinger committed Sep 6, 2023
1 parent d92b6bc commit df4a936
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
11 changes: 0 additions & 11 deletions core/java/android/app/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -2857,17 +2857,6 @@ public void visitUris(@NonNull Consumer<Uri> visitor) {
if (person != null) {
visitor.accept(person.getIconUri());
}

final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS);
if (history != null) {
for (int i = 0; i < history.length; i++) {
RemoteInputHistoryItem item = history[i];
if (item.getUri() != null) {
visitor.accept(item.getUri());
}
}
}
}

if (isStyle(MessagingStyle.class) && extras != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
import android.app.PendingIntent;
import android.app.Person;
import android.app.RemoteInput;
import android.app.RemoteInputHistoryItem;
import android.app.StatsManager;
import android.app.admin.DevicePolicyManagerInternal;
import android.app.usage.UsageStatsManagerInternal;
Expand Down Expand Up @@ -5391,21 +5390,13 @@ public void testVisitUris() throws Exception {
.setName("People List Person 2")
.setIcon(personIcon3)
.build();
final Uri historyUri1 = Uri.parse("content://com.example/history1");
final Uri historyUri2 = Uri.parse("content://com.example/history2");
final RemoteInputHistoryItem historyItem1 = new RemoteInputHistoryItem(null, historyUri1,
"a");
final RemoteInputHistoryItem historyItem2 = new RemoteInputHistoryItem(null, historyUri2,
"b");

Bundle extras = new Bundle();
extras.putParcelable(Notification.EXTRA_AUDIO_CONTENTS_URI, audioContents);
extras.putString(Notification.EXTRA_BACKGROUND_IMAGE_URI, backgroundImage.toString());
extras.putParcelable(Notification.EXTRA_MESSAGING_PERSON, person1);
extras.putParcelableArrayList(Notification.EXTRA_PEOPLE_LIST,
new ArrayList<>(Arrays.asList(person2, person3)));
extras.putParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS,
new RemoteInputHistoryItem[]{historyItem1, historyItem2});

Notification n = new Notification.Builder(mContext, "a")
.setContentTitle("notification with uris")
Expand All @@ -5423,8 +5414,6 @@ public void testVisitUris() throws Exception {
verify(visitor, times(1)).accept(eq(personIcon1.getUri()));
verify(visitor, times(1)).accept(eq(personIcon2.getUri()));
verify(visitor, times(1)).accept(eq(personIcon3.getUri()));
verify(visitor, times(1)).accept(eq(historyUri1));
verify(visitor, times(1)).accept(eq(historyUri2));
}

@Test
Expand Down

0 comments on commit df4a936

Please sign in to comment.