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

Commit f9d8830e authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

DO NOT MERGE Revert "Verify URI permissions for EXTRA_REMOTE_INPUT_HISTORY_ITEMS."

This reverts commit 43b17113.

Reason for revert: regression reported at b/289223315

Bug: 289223315
Bug: 276729064
Change-Id: I101938fbc51592537023345ba1e642827510981b
parent 7e6c75cc
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -2533,17 +2533,6 @@ public class Notification implements Parcelable
            if (person != null && person.getIconUri() != null) {
            if (person != null && person.getIconUri() != null) {
                visitor.accept(person.getIconUri());
                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 (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) {
        if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) {
+0 −11
Original line number Original line Diff line number Diff line
@@ -102,7 +102,6 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.app.Person;
import android.app.Person;
import android.app.RemoteInput;
import android.app.RemoteInput;
import android.app.RemoteInputHistoryItem;
import android.app.StatsManager;
import android.app.StatsManager;
import android.app.admin.DevicePolicyManagerInternal;
import android.app.admin.DevicePolicyManagerInternal;
import android.app.usage.UsageStatsManagerInternal;
import android.app.usage.UsageStatsManagerInternal;
@@ -4290,12 +4289,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
                .setName("People List Person 2")
                .setName("People List Person 2")
                .setIcon(personIcon3)
                .setIcon(personIcon3)
                .build();
                .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();
        Bundle extras = new Bundle();
        extras.putParcelable(Notification.EXTRA_AUDIO_CONTENTS_URI, audioContents);
        extras.putParcelable(Notification.EXTRA_AUDIO_CONTENTS_URI, audioContents);
@@ -4303,8 +4296,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        extras.putParcelable(Notification.EXTRA_MESSAGING_PERSON, person1);
        extras.putParcelable(Notification.EXTRA_MESSAGING_PERSON, person1);
        extras.putParcelableArrayList(Notification.EXTRA_PEOPLE_LIST,
        extras.putParcelableArrayList(Notification.EXTRA_PEOPLE_LIST,
                new ArrayList<>(Arrays.asList(person2, person3)));
                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")
        Notification n = new Notification.Builder(mContext, "a")
                .setContentTitle("notification with uris")
                .setContentTitle("notification with uris")
@@ -4322,8 +4313,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        verify(visitor, times(1)).accept(eq(personIcon1.getUri()));
        verify(visitor, times(1)).accept(eq(personIcon1.getUri()));
        verify(visitor, times(1)).accept(eq(personIcon2.getUri()));
        verify(visitor, times(1)).accept(eq(personIcon2.getUri()));
        verify(visitor, times(1)).accept(eq(personIcon3.getUri()));
        verify(visitor, times(1)).accept(eq(personIcon3.getUri()));
        verify(visitor, times(1)).accept(eq(historyUri1));
        verify(visitor, times(1)).accept(eq(historyUri2));
    }
    }


    @Test
    @Test