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

Commit aca87804 authored by Stanislav Zholnin's avatar Stanislav Zholnin Committed by Android (Google) Code Review
Browse files

Merge "Fix NotificationManagerServiceTest to properly use DeviceConfig API...

Merge "Fix NotificationManagerServiceTest to properly use DeviceConfig API with shell permission identity in preparation to enforcement of permissions through ag/6055289."
parents b116b207 872afd48
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ import android.util.ArraySet;
import android.util.AtomicFile;

import androidx.annotation.Nullable;
import androidx.test.InstrumentationRegistry;

import com.android.internal.R;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
@@ -311,6 +312,9 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {

    @Before
    public void setUp() throws Exception {
        InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity(
                "android.permission.WRITE_DEVICE_CONFIG", "android.permission.READ_DEVICE_CONFIG");

        MockitoAnnotations.initMocks(this);

        LocalServices.removeServiceForTest(UriGrantsManagerInternal.class);
@@ -392,6 +396,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
    public void tearDown() throws Exception {
        mFile.delete();
        clearDeviceConfig();
        InstrumentationRegistry.getInstrumentation()
                .getUiAutomation().dropShellPermissionIdentity();
    }

    public void waitForIdle() {