From 24d103b16af46f7a2b94b5777fe87f2871958d30 Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 18 Feb 2020 17:40:57 -0500 Subject: [PATCH] Add READ_CONTACTS permission to NoManSerTest shell Test: atest SystemUITests Fixes: 149740458 Change-Id: I1ed768ee07dd13bdf6a8b1c8564618606b856ee8 --- .../server/notification/NotificationManagerServiceTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 e5ffb4d67c98d..9d6d442921384 100755 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java @@ -359,8 +359,12 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Before public void setUp() throws Exception { + // Shell permisssions will override permissions of our app, so add all necessary permissions + // fo this test here: InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity( - "android.permission.WRITE_DEVICE_CONFIG", "android.permission.READ_DEVICE_CONFIG"); + "android.permission.WRITE_DEVICE_CONFIG", + "android.permission.READ_DEVICE_CONFIG", + "android.permission.READ_CONTACTS"); MockitoAnnotations.initMocks(this);