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

Commit 07db86bf authored by Valentin Iftime's avatar Valentin Iftime
Browse files

Fix userId for PreferencesHelperTest sound Uri tests

 Match the uid of the test packages used as params.
 Fixes test failure when running on HSUM devices.

Flag: com.android.server.notification.notification_verify_channel_sound_uri
Test: atest com.android.server.notification.PreferencesHelperTest#testCreateChannel_noSoundUriPermission_contentSchemeVerified
Bug: 383202391
Change-Id: Ic000acaa602f10ea8d983ce5d355ccaadeadf970
parent 6ee3b28e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3169,7 +3169,7 @@ public class PreferencesHelperTest extends UiServiceTestCase {

        doThrow(new SecurityException("no access")).when(mUgmInternal)
                .checkGrantUriPermission(eq(UID_N_MR1), any(), eq(sound),
                    anyInt(), eq(Process.myUserHandle().getIdentifier()));
                    anyInt(), eq(UserHandle.getUserId(UID_N_MR1)));

        final NotificationChannel channel = new NotificationChannel("id2", "name2",
                NotificationManager.IMPORTANCE_DEFAULT);
@@ -3189,7 +3189,7 @@ public class PreferencesHelperTest extends UiServiceTestCase {

        doThrow(new SecurityException("no access")).when(mUgmInternal)
                .checkGrantUriPermission(eq(UID_N_MR1), any(), any(),
                    anyInt(), eq(Process.myUserHandle().getIdentifier()));
                    anyInt(), eq(UserHandle.getUserId(UID_N_MR1)));

        final NotificationChannel channel = new NotificationChannel("id2", "name2",
                NotificationManager.IMPORTANCE_DEFAULT);
@@ -3208,7 +3208,7 @@ public class PreferencesHelperTest extends UiServiceTestCase {

        doThrow(new SecurityException("no access")).when(mUgmInternal)
                .checkGrantUriPermission(eq(UID_N_MR1), any(), any(),
                    anyInt(), eq(Process.myUserHandle().getIdentifier()));
                    anyInt(), eq(UserHandle.getUserId(UID_N_MR1)));

        final NotificationChannel channel = new NotificationChannel("id2", "name2",
                NotificationManager.IMPORTANCE_DEFAULT);