diff options
author | Tom Natan <tomnatan@google.com> | 2021-07-03 11:56:43 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-07-03 11:56:43 +0000 |
commit | b295cc900b8c796c89192cd3d14d08f53703ee04 (patch) | |
tree | 1fc72e0c2cebaa2a622753e6f349196ec16ccd44 /tests | |
parent | 881dc456c823393dc3adec20bc5c0a031d28365d (diff) | |
parent | 4d859f35bc67da7f8a1baecca51c2f32d46885e3 (diff) |
Merge "Handle multiple users when adding and rechecking overrides." into sc-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PlatformCompatGating/src/com/android/tests/gating/PlatformCompatPermissionsTest.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/PlatformCompatGating/src/com/android/tests/gating/PlatformCompatPermissionsTest.java b/tests/PlatformCompatGating/src/com/android/tests/gating/PlatformCompatPermissionsTest.java index 9b9e5815a588..060133df0a40 100644 --- a/tests/PlatformCompatGating/src/com/android/tests/gating/PlatformCompatPermissionsTest.java +++ b/tests/PlatformCompatGating/src/com/android/tests/gating/PlatformCompatPermissionsTest.java @@ -16,6 +16,7 @@ package com.android.tests.gating; +import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static android.Manifest.permission.LOG_COMPAT_CHANGE; import static android.Manifest.permission.OVERRIDE_COMPAT_CHANGE_CONFIG; import static android.Manifest.permission.READ_COMPAT_CHANGE_CONFIG; @@ -261,13 +262,15 @@ public final class PlatformCompatPermissionsTest { public void clearOverrides_noOverridesPermission_throwsSecurityException() throws Throwable { thrown.expect(SecurityException.class); + mUiAutomation.adoptShellPermissionIdentity(INTERACT_ACROSS_USERS_FULL); mPlatformCompat.clearOverrides("foo.bar"); } @Test public void clearOverrides_overridesPermission_noThrow() throws Throwable { - mUiAutomation.adoptShellPermissionIdentity(OVERRIDE_COMPAT_CHANGE_CONFIG); + mUiAutomation.adoptShellPermissionIdentity(OVERRIDE_COMPAT_CHANGE_CONFIG, + INTERACT_ACROSS_USERS_FULL); mPlatformCompat.clearOverrides("foo.bar"); } @@ -276,13 +279,15 @@ public final class PlatformCompatPermissionsTest { public void clearOverridesForTest_noOverridesPermission_throwsSecurityException() throws Throwable { thrown.expect(SecurityException.class); + mUiAutomation.adoptShellPermissionIdentity(INTERACT_ACROSS_USERS_FULL); mPlatformCompat.clearOverridesForTest("foo.bar"); } @Test public void clearOverridesForTest_overridesPermission_noThrow() throws Throwable { - mUiAutomation.adoptShellPermissionIdentity(OVERRIDE_COMPAT_CHANGE_CONFIG); + mUiAutomation.adoptShellPermissionIdentity(OVERRIDE_COMPAT_CHANGE_CONFIG, + INTERACT_ACROSS_USERS_FULL); mPlatformCompat.clearOverridesForTest("foo.bar"); } @@ -291,13 +296,15 @@ public final class PlatformCompatPermissionsTest { public void clearOverride_noOverridesPermission_throwsSecurityException() throws Throwable { thrown.expect(SecurityException.class); + mUiAutomation.adoptShellPermissionIdentity(INTERACT_ACROSS_USERS_FULL); mPlatformCompat.clearOverride(1, "foo.bar"); } @Test public void clearOverride_overridesPermission_noThrow() throws Throwable { - mUiAutomation.adoptShellPermissionIdentity(OVERRIDE_COMPAT_CHANGE_CONFIG); + mUiAutomation.adoptShellPermissionIdentity(OVERRIDE_COMPAT_CHANGE_CONFIG, + INTERACT_ACROSS_USERS_FULL); mPlatformCompat.clearOverride(1, "foo.bar"); } |