Home
last modified time | relevance | path

Searched refs:permission (Results 1 – 25 of 156) sorted by relevance

1234567

/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/
DUsePermissionTest23.java76 grantPermission(Manifest.permission.READ_CALENDAR); in testGranted()
80 .checkSelfPermission(Manifest.permission.READ_CALENDAR)); in testGranted()
82 .checkSelfPermission(Manifest.permission.WRITE_CALENDAR)); in testGranted()
93 .checkSelfPermission(Manifest.permission.READ_CALENDAR)); in testInteractiveGrant()
95 .checkSelfPermission(Manifest.permission.WRITE_CALENDAR)); in testInteractiveGrant()
109 Manifest.permission.READ_CALENDAR, in testInteractiveGrant()
110 Manifest.permission.WRITE_CALENDAR}, in testInteractiveGrant()
123 assertEquals(Manifest.permission.READ_CALENDAR, result.permissions[0]); in testInteractiveGrant()
124 assertEquals(Manifest.permission.WRITE_CALENDAR, result.permissions[1]); in testInteractiveGrant()
130 .checkSelfPermission(Manifest.permission.READ_CALENDAR)); in testInteractiveGrant()
[all …]
DBasePermissionsTest.java126 Manifest.permission.READ_CONTACTS, "@android:string/permgrouplab_contacts"); in initPermissionToLabelMap()
128 Manifest.permission.WRITE_CONTACTS, "@android:string/permgrouplab_contacts"); in initPermissionToLabelMap()
131 Manifest.permission.READ_CALENDAR, "@android:string/permgrouplab_calendar"); in initPermissionToLabelMap()
133 Manifest.permission.WRITE_CALENDAR, "@android:string/permgrouplab_calendar"); in initPermissionToLabelMap()
136 Manifest.permission.SEND_SMS, "@android:string/permgrouplab_sms"); in initPermissionToLabelMap()
138 Manifest.permission.RECEIVE_SMS, "@android:string/permgrouplab_sms"); in initPermissionToLabelMap()
140 Manifest.permission.READ_SMS, "@android:string/permgrouplab_sms"); in initPermissionToLabelMap()
142 Manifest.permission.RECEIVE_WAP_PUSH, "@android:string/permgrouplab_sms"); in initPermissionToLabelMap()
144 Manifest.permission.RECEIVE_MMS, "@android:string/permgrouplab_sms"); in initPermissionToLabelMap()
149 Manifest.permission.READ_EXTERNAL_STORAGE, in initPermissionToLabelMap()
[all …]
/cts/tools/release-parser/tests/resources/
Dplatform.xml.pb.txt71 key: "permission"
73 name: "permission"
75 name: "android.permission.BLUETOOTH_ADMIN"
82 name: "android.permission.BLUETOOTH"
89 name: "android.permission.BLUETOOTH_STACK"
104 name: "android.permission.NET_TUNNELING"
111 name: "android.permission.INTERNET"
118 name: "android.permission.READ_LOGS"
125 name: "android.permission.WRITE_MEDIA_STORAGE"
132 name: "android.permission.ACCESS_MTP"
[all …]
/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp22/src/com/android/cts/usepermission/
DUsePermissionTest22.java47 mContext.checkPermission(android.Manifest.permission.READ_CALENDAR, in testCompatDefault()
50 mContext.checkPermission(android.Manifest.permission.WRITE_CALENDAR, in testCompatDefault()
63 revokePermissions(new String[] {Manifest.permission.WRITE_CALENDAR}, true); in testCompatRevoked_part1()
70 mContext.checkPermission(android.Manifest.permission.READ_CALENDAR, in testCompatRevoked_part2()
73 mContext.checkPermission(android.Manifest.permission.WRITE_CALENDAR, in testCompatRevoked_part2()
86 .checkSelfPermission(Manifest.permission.SEND_SMS)); in testAllPermissionsGrantedByDefault()
88 .checkSelfPermission(Manifest.permission.RECEIVE_SMS)); in testAllPermissionsGrantedByDefault()
91 .checkSelfPermission(Manifest.permission.WRITE_CONTACTS)); in testAllPermissionsGrantedByDefault()
93 .checkSelfPermission(Manifest.permission.READ_CALENDAR)); in testAllPermissionsGrantedByDefault()
95 .checkSelfPermission(Manifest.permission.WRITE_CALENDAR)); in testAllPermissionsGrantedByDefault()
[all …]
/cts/tests/tests/permission/src/android/permission/cts/
DServicePermissionTest.java17 package android.permission.cts;
38 android.Manifest.permission.ACCOUNT_MANAGER,
39 android.Manifest.permission.BIND_ACCESSIBILITY_SERVICE,
40 android.Manifest.permission.BIND_AUTOFILL_SERVICE,
41 android.Manifest.permission.BIND_CHOOSER_TARGET_SERVICE,
42 android.Manifest.permission.BIND_CONDITION_PROVIDER_SERVICE,
44 android.Manifest.permission.BIND_DREAM_SERVICE,
45 android.Manifest.permission.BIND_INPUT_METHOD,
46 android.Manifest.permission.BIND_MIDI_DEVICE_SERVICE,
48 android.Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE,
[all …]
DSplitPermissionsSystemTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
21 import static android.Manifest.permission.ACCESS_FINE_LOCATION;
22 import static android.Manifest.permission.ACCESS_MEDIA_LOCATION;
23 import static android.Manifest.permission.READ_CALL_LOG;
24 import static android.Manifest.permission.READ_CONTACTS;
25 import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
26 import static android.Manifest.permission.WRITE_CALL_LOG;
27 import static android.Manifest.permission.WRITE_CONTACTS;
[all …]
DBackgroundPermissionsTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
21 import static android.Manifest.permission.ACCESS_FINE_LOCATION;
26 import static android.permission.cts.PermissionUtils.eventually;
27 import static android.permission.cts.PermissionUtils.getAppOp;
28 import static android.permission.cts.PermissionUtils.grantPermission;
29 import static android.permission.cts.PermissionUtils.install;
30 import static android.permission.cts.PermissionUtils.uninstallApp;
87 PermissionInfo permission = pkg.permissions[i]; in verifybackgroundPermissionsProperties() local
[all …]
DProviderPermissionTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
20 import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
76 android.Manifest.permission.READ_CONTACTS); in testReadContacts()
87 android.Manifest.permission.WRITE_CONTACTS); in testWriteContacts()
98 android.Manifest.permission.READ_CALL_LOG); in testReadCallLog()
109 android.Manifest.permission.WRITE_CALL_LOG); in testWriteCallLog()
150 android.Manifest.permission.READ_SMS); in testReadSms()
174 final String permission = android.Manifest.permission.WRITE_SETTINGS; in testWriteSettings() local
181 fail("expected SecurityException requiring " + permission); in testWriteSettings()
[all …]
DSplitPermissionTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
21 import static android.Manifest.permission.READ_CALL_LOG;
22 import static android.Manifest.permission.READ_CONTACTS;
27 import static android.permission.cts.PermissionUtils.eventually;
28 import static android.permission.cts.PermissionUtils.getAppOp;
29 import static android.permission.cts.PermissionUtils.getPermissionFlags;
30 import static android.permission.cts.PermissionUtils.getPermissions;
31 import static android.permission.cts.PermissionUtils.grantPermission;
[all …]
DPermissionFlagsTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
21 import static android.Manifest.permission.READ_CALL_LOG;
22 import static android.Manifest.permission.READ_CONTACTS;
28 import static android.permission.cts.PermissionUtils.clearAppState;
29 import static android.permission.cts.PermissionUtils.eventually;
30 import static android.permission.cts.PermissionUtils.getPermissionFlags;
31 import static android.permission.cts.PermissionUtils.install;
32 import static android.permission.cts.PermissionUtils.isGranted;
[all …]
DSharedUidPermissionsTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.INTERNET;
20 import static android.Manifest.permission.READ_CONTACTS;
21 import static android.permission.cts.PermissionUtils.grantPermission;
22 import static android.permission.cts.PermissionUtils.install;
23 import static android.permission.cts.PermissionUtils.isPermissionGranted;
24 import static android.permission.cts.PermissionUtils.revokePermission;
25 import static android.permission.cts.PermissionUtils.uninstallApp;
DShellPermissionTest.java17 package android.permission.cts;
73 for (String permission : packageInfo.requestedPermissions) { in testBlacklistedPermissions()
74 Log.d(LOG_TAG, "SHELL as " + pkg + " uses permission " + permission); in testBlacklistedPermissions()
75 assertFalse("SHELL as " + pkg + " contains the illegal permission " + permission, in testBlacklistedPermissions()
76 blacklist.contains(permission)); in testBlacklistedPermissions()
DPermissionControllerTest.java17 package android.permission.cts;
19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
21 import static android.Manifest.permission.ACCESS_FINE_LOCATION;
22 import static android.Manifest.permission.BODY_SENSORS;
23 import static android.Manifest.permission.READ_CONTACTS;
24 import static android.Manifest.permission.WRITE_CALENDAR;
29 import static android.permission.PermissionControllerManager.REASON_INSTALLER_POLICY_VIOLATION;
30 import static android.permission.PermissionControllerManager.REASON_MALWARE;
42 import android.permission.PermissionControllerManager;
[all …]
/cts/tests/tests/permission2/src/android/permission2/cts/
DRestrictedPermissionsTest.java19 import static android.Manifest.permission.READ_SMS;
20 import static android.permission.cts.PermissionUtils.eventually;
21 import static android.permission.cts.PermissionUtils.isGranted;
22 import static android.permission.cts.PermissionUtils.isPermissionGranted;
31 import android.Manifest.permission;
45 import android.permission.cts.PermissionUtils.ThrowingRunnable;
157 whitelistedPermissions.add(Manifest.permission.SEND_SMS); in testSomeRestrictedPermissionsWhitelistedAtInstall29()
158 whitelistedPermissions.add(Manifest.permission.READ_CALL_LOG); in testSomeRestrictedPermissionsWhitelistedAtInstall29()
200 whitelistedPermissions.add(Manifest.permission.SEND_SMS); in testSomeRestrictedPermissionsWhitelistedAtInstall22()
201 whitelistedPermissions.add(Manifest.permission.READ_CALL_LOG); in testSomeRestrictedPermissionsWhitelistedAtInstall22()
[all …]
/cts/tests/tests/permission/permissionTestUtilLib/src/android/permission/cts/
DPermissionUtils.java17 package android.permission.cts;
19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
80 public static int getAppOp(@NonNull String packageName, @NonNull String permission) in getAppOp() argument
84 permissionToOp(permission), in getAppOp()
113 public static void setAppOp(@NonNull String packageName, @NonNull String permission, int mode) { in setAppOp() argument
114 setAppOpByName(packageName, permissionToOp(permission), mode); in setAppOp()
141 @NonNull String permission) throws Exception { in isPermissionGranted() argument
142 return sContext.checkPermission(permission, Process.myPid(), in isPermissionGranted()
159 public static boolean isGranted(@NonNull String packageName, @NonNull String permission) in isGranted() argument
[all …]
/cts/tests/tests/appop/src/android/app/appops/cts/
DAppOpsTest.kt44 import android.Manifest.permission
74 permissionToOpStr[permission.ACCESS_COARSE_LOCATION] =
76 permissionToOpStr[permission.ACCESS_FINE_LOCATION] =
78 permissionToOpStr[permission.READ_CONTACTS] =
80 permissionToOpStr[permission.WRITE_CONTACTS] =
82 permissionToOpStr[permission.READ_CALL_LOG] =
84 permissionToOpStr[permission.WRITE_CALL_LOG] =
86 permissionToOpStr[permission.READ_CALENDAR] =
88 permissionToOpStr[permission.WRITE_CALENDAR] =
90 permissionToOpStr[permission.CALL_PHONE] =
[all …]
/cts/tests/tests/content/BinderPermissionTestService/src/com/android/cts/
DBinderPermissionTestService.java36 public void doEnforceCallingPermission(String permission) {
37 enforceCallingPermission(permission, TEST_NOT_ALLOWED_MESSAGE);
41 public int doCheckCallingPermission(String permission) {
42 return checkCallingPermission(permission);
46 public void doEnforceCallingOrSelfPermission(String permission) {
47 enforceCallingOrSelfPermission(permission, TEST_NOT_ALLOWED_MESSAGE);
51 public int doCheckCallingOrSelfPermission(String permission) {
52 return checkCallingOrSelfPermission(permission);
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DTelephonyLocationTests.java73 cellLocationAccess, Manifest.permission.ACCESS_FINE_LOCATION); in testCellLocationFinePermission()
75 Manifest.permission.ACCESS_BACKGROUND_LOCATION); in testCellLocationFinePermission()
92 Manifest.permission.ACCESS_COARSE_LOCATION); in testServiceStateLocationSanitization()
94 Manifest.permission.ACCESS_FINE_LOCATION); in testServiceStateLocationSanitization()
101 Manifest.permission.ACCESS_BACKGROUND_LOCATION); in testServiceStateLocationSanitization()
119 Manifest.permission.ACCESS_COARSE_LOCATION); in testServiceStateListeningWithoutPermissions()
121 Manifest.permission.ACCESS_FINE_LOCATION); in testServiceStateListeningWithoutPermissions()
129 Manifest.permission.ACCESS_BACKGROUND_LOCATION); in testServiceStateListeningWithoutPermissions()
141 Manifest.permission.ACCESS_FINE_LOCATION); in testRegistryPermissionsForCellLocation()
148 Manifest.permission.ACCESS_BACKGROUND_LOCATION); in testRegistryPermissionsForCellLocation()
[all …]
/cts/tests/backup/src/android/backup/cts/
DPermissionTest.java19 import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
20 import static android.Manifest.permission.ACCESS_FINE_LOCATION;
21 import static android.Manifest.permission.READ_CONTACTS;
22 import static android.Manifest.permission.WRITE_CONTACTS;
358 private void setFlag(String app, String permission, int flag) { in setFlag() argument
360 () -> sContext.getPackageManager().updatePermissionFlags(permission, app, in setFlag()
364 private void clearFlag(String app, String permission, int flag) { in clearFlag() argument
366 () -> sContext.getPackageManager().updatePermissionFlags(permission, app, in clearFlag()
370 private boolean isFlagSet(String app, String permission, int flag) { in isFlagSet() argument
373 () -> sContext.getPackageManager().getPermissionFlags(permission, app, in isFlagSet()
[all …]
/cts/tests/tests/display/src/android/display/cts/
DBrightnessTest.java85 revokePermission(Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS); in tearDown()
86 revokePermission(Manifest.permission.BRIGHTNESS_SLIDER_USAGE); in tearDown()
91 if (numberOfSystemAppsWithPermission(Manifest.permission.BRIGHTNESS_SLIDER_USAGE) == 0) { in testBrightnessSliderTracking()
105 grantPermission(Manifest.permission.BRIGHTNESS_SLIDER_USAGE); in testBrightnessSliderTracking()
142 if (numberOfSystemAppsWithPermission(Manifest.permission.BRIGHTNESS_SLIDER_USAGE) == 0) { in testNoTrackingForManualBrightness()
155 grantPermission(Manifest.permission.BRIGHTNESS_SLIDER_USAGE); in testNoTrackingForManualBrightness()
175 revokePermission(Manifest.permission.BRIGHTNESS_SLIDER_USAGE); in testSliderUsagePermission()
188 revokePermission(Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS); in testConfigureBrightnessPermission()
207 Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) == 0) { in testSetGetSimpleCurve()
212 grantPermission(Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS); in testSetGetSimpleCurve()
[all …]
/cts/tests/tests/content/BinderPermissionTestService/aidl/com/android/cts/
DIBinderPermissionTestService.aidl21 void doEnforceCallingPermission(String permission); in doEnforceCallingPermission() argument
22 int doCheckCallingPermission(String permission); in doCheckCallingPermission() argument
23 void doEnforceCallingOrSelfPermission(String permission); in doEnforceCallingOrSelfPermission() argument
24 int doCheckCallingOrSelfPermission(String permission); in doCheckCallingOrSelfPermission() argument
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/
DStepSensorPermissionTestActivity.java118 if (hasPermission(Manifest.permission.ACTIVITY_RECOGNITION) != permissionGranted) { in runTest()
123 checkPermission(Manifest.permission.ACTIVITY_RECOGNITION, permissionGranted); in runTest()
149 private boolean hasPermission(String permission) { in hasPermission() argument
150 return getApplicationContext().checkSelfPermission(permission) == in hasPermission()
154 private void checkPermission(String permission, boolean expected) { in checkPermission() argument
155 if (expected && !hasPermission(permission)) { in checkPermission()
156 throw new AssertionError(String.format("Should not have '%s' permission", permission)); in checkPermission()
157 } else if (!expected && hasPermission(permission)) { in checkPermission()
158 throw new AssertionError(String.format("Should have '%s' permission", permission)); in checkPermission()
/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp26/src/com/android/cts/usepermission/
DUsePermissionTest26.java36 .checkSelfPermission(Manifest.permission.RECEIVE_SMS)); in testRuntimeGroupGrantNoExpansion()
38 .checkSelfPermission(Manifest.permission.SEND_SMS)); in testRuntimeGroupGrantNoExpansion()
40 String[] permissions = new String[]{Manifest.permission.RECEIVE_SMS}; in testRuntimeGroupGrantNoExpansion()
62 .checkSelfPermission(Manifest.permission.SEND_SMS)); in testRuntimeGroupGrantNoExpansion()
/cts/tests/tests/telephony/sdk28/src/android/telephony/sdk28/cts/
DCellInfoTest.java45 android.Manifest.permission.READ_PHONE_STATE,
46 android.Manifest.permission.ACCESS_COARSE_LOCATION};
63 for (String permission : sPermissions) { in setUp()
64 assertTrue("Something (not this test) has denied needed permission=" + permission, in setUp()
65 getContext().checkSelfPermission(permission) in setUp()
/cts/tests/tests/uiautomation/src/android/app/uiautomation/cts/
DUiAutomationTest.java102 Manifest.permission.CAMERA, Process.myUserHandle()); in testAdoptAllShellPermissions()
116 assertSame(packageManager.checkPermission(Manifest.permission.CAMERA, in testAdoptAllShellPermissions()
119 Manifest.permission.CAMERA, Process.myUserHandle()); in testAdoptAllShellPermissions()
126 assertSame(packageManager.checkPermission(Manifest.permission.CAMERA, in testAdoptAllShellPermissions()
139 Manifest.permission.CAMERA, Process.myUserHandle()); in testAdoptAllShellPermissions()
153 Manifest.permission.BATTERY_STATS)); in testAdoptSomeShellPermissions()
155 Manifest.permission.PACKAGE_USAGE_STATS)); in testAdoptSomeShellPermissions()
160 Manifest.permission.BATTERY_STATS); in testAdoptSomeShellPermissions()
163 Manifest.permission.BATTERY_STATS)); in testAdoptSomeShellPermissions()
165 Manifest.permission.PACKAGE_USAGE_STATS)); in testAdoptSomeShellPermissions()
[all …]

1234567