Home
last modified time | relevance | path

Searched refs:appOpsManager (Results 1 – 24 of 24) sorted by relevance

/cts/tests/framework/base/windowmanager/src/android/server/wm/
DAlertWindowsAppOpsTests.java86 final AppOpsManager appOpsManager = getInstrumentation().getContext() in testSystemAlertWindowAppOpsInitiallyAllowed() local
95 appOpsManager.startWatchingActive(new String[] { OPSTR_SYSTEM_ALERT_WINDOW }, in testSystemAlertWindowAppOpsInitiallyAllowed()
99 assertFalse(appOpsManager.isOpActive(OPSTR_SYSTEM_ALERT_WINDOW, uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
111 assertTrue(appOpsManager.isOpActive(OPSTR_SYSTEM_ALERT_WINDOW, in testSystemAlertWindowAppOpsInitiallyAllowed()
127 assertFalse(appOpsManager.isOpActive(OPSTR_SYSTEM_ALERT_WINDOW, uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
134 appOpsManager.stopWatchingActive(listener); in testSystemAlertWindowAppOpsInitiallyAllowed()
145 assertTrue(appOpsManager.isOpActive(OPSTR_SYSTEM_ALERT_WINDOW, uid, packageName)); in testSystemAlertWindowAppOpsInitiallyAllowed()
/cts/tests/tests/permission4/AppThatAccessesCameraAndMic/src/android/permission4/cts/appthataccessescameraandmic/
DAccessCameraOrMicActivity.kt57 private var appOpsManager: AppOpsManager? = null variable in android.permission4.cts.appthataccessescameraandmic.AccessCameraOrMicActivity
91 appOpsManager?.finishOp(AppOpsManager.OPSTR_CAMERA, Process.myUid(), packageName) in finish()
94 appOpsManager?.finishOp(AppOpsManager.OPSTR_RECORD_AUDIO_HOTWORD, Process.myUid(), in finish()
97 appOpsManager = null in finish()
164 appOpsManager = getSystemService(AppOpsManager::class.java) in startBackupCamera()
165 appOpsManager?.startOpNoThrow(AppOpsManager.OPSTR_CAMERA, Process.myUid(), packageName) in startBackupCamera()
204 appOpsManager = getSystemService(AppOpsManager::class.java) in useHotword()
205 appOpsManager?.startOpNoThrow(AppOpsManager.OPSTR_RECORD_AUDIO_HOTWORD, Process.myUid(), in useHotword()
/cts/tests/tests/media/src/android/media/cts/
DAudioRecordAppOpTest.java63 final AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class); in testRecordAppOps() local
85 assertThat(appOpsManager.isOpActive(OPSTR_RECORD_AUDIO, in testRecordAppOps()
89 appOpsManager.startWatchingActive(new String[] { OPSTR_RECORD_AUDIO }, in testRecordAppOps()
102 assertThat(appOpsManager.isOpActive(OPSTR_RECORD_AUDIO, in testRecordAppOps()
120 assertThat(appOpsManager.isOpActive(OPSTR_RECORD_AUDIO, in testRecordAppOps()
128 appOpsManager.stopWatchingActive(listener); in testRecordAppOps()
/cts/tests/tests/activityrecognition/src/android/activityrecognition/cts/
DActivityRecognizerAttributionTags.kt69 val appOpsManager = context.getSystemService(AppOpsManager::class.java)!! in setUpTest() constant
71 appOpsManager.resetPackageOpsNoHistory(context.packageName) in setUpTest()
104 val appOpsManager = context.getSystemService(AppOpsManager::class.java) in accessActivityRecognition() constant
105 appOpsManager?.noteOp(AppOpsManager.OPSTR_ACTIVITY_RECOGNITION, Process.myUid(), in accessActivityRecognition()
114 val appOpsManager: AppOpsManager = context.getSystemService(AppOpsManager::class.java)!! in assertNotedOpsSinceLastArAccess() constant
115 val affectedPackageOps = appOpsManager.getPackagesForOps( in assertNotedOpsSinceLastArAccess()
/cts/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraForSensorPrivacy/src/android/sensorprivacy/cts/usemiccamera/
DUseMicCamera.kt36 private lateinit var appOpsManager: AppOpsManager variable in android.sensorprivacy.cts.usemiccamera.UseMicCamera
61 appOpsManager = applicationContext.getSystemService(AppOpsManager::class.java)!! in onCreate()
68 appOpsManager.finishOp(AppOpsManager.OPSTR_CAMERA, in onCreate()
70 appOpsManager.finishOp(AppOpsManager.OPSTR_RECORD_AUDIO, in onCreate()
/cts/tests/tests/sensorprivacy/test-apps/CtsUseMicOrCameraAndOverlayForSensorPrivacy/src/android/sensorprivacy/cts/usemiccamera/overlay/
DUseMicCamera.kt36 private lateinit var appOpsManager: AppOpsManager variable in android.sensorprivacy.cts.usemiccamera.overlay.UseMicCamera
59 appOpsManager = applicationContext.getSystemService(AppOpsManager::class.java)!! in onCreate()
66 appOpsManager.finishOp(AppOpsManager.OPSTR_CAMERA, in onCreate()
/cts/tests/tests/appop/src/android/app/appops/cts/
DAttributionTest.kt50 private val appOpsManager = context.getSystemService(AppOpsManager::class.java) constant
69 appOpsManager.noteOp(OPSTR_WIFI_SCAN, appUid, APP_PKG, attribution, null) in noteForAttribution()
86 appOpsManager.noteOp(OPSTR_READ_CONTACTS, uid, PKG, ATTRIBUTION_1, null) in manifestReceiverTagging()
87 appOpsManager.noteOp(OPSTR_READ_CONTACTS, uid, PKG, ATTRIBUTION_2, null) in manifestReceiverTagging()
88 appOpsManager.noteOp(OPSTR_READ_CONTACTS, uid, PKG, ATTRIBUTION_3, null) in manifestReceiverTagging()
/cts/hostsidetests/content/test-apps/ContextCrossProfileApps/ContextCrossProfileApp/src/com/android/cts/context/
DContextCrossProfileDeviceTest.java140 final AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossProfilesPermission_bindsService() local
142 appOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossProfilesPermission_bindsService()
182 final AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossProfilesAppOp_bindsService() local
184 appOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossProfilesAppOp_bindsService()
202 final AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testBindServiceAsUser_sameProfileGroup_differentPackage_withAcrossProfilesAppOp_throwsException() local
204 appOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testBindServiceAsUser_sameProfileGroup_differentPackage_withAcrossProfilesAppOp_throwsException()
269 final AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testBindServiceAsUser_differentProfileGroup_withInteractAcrossProfilesAppOp_throwsException() local
271 appOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testBindServiceAsUser_differentProfileGroup_withInteractAcrossProfilesAppOp_throwsException()
312 final AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testBindServiceAsUser_withInteractAcrossProfilePermission_noAsserts() local
314 appOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testBindServiceAsUser_withInteractAcrossProfilePermission_noAsserts()
/cts/tests/tests/permission3/AccessMicrophoneApp2/src/android/permission3/cts/accessmicrophoneapp2/
DAccessMicActivity2.kt31 private var appOpsManager: AppOpsManager? = null variable in android.permission3.cts.accessmicrophoneapp2.AccessMicActivity2
41 appOpsManager = null in finish()
/cts/tests/tests/permission3/AccessMicrophoneApp/src/android/permission3/cts/accessmicrophoneapp/
DAccessMicActivity.kt31 private var appOpsManager: AppOpsManager? = null variable in android.permission3.cts.accessmicrophoneapp.AccessMicActivity
41 appOpsManager = null in finish()
/cts/tests/tests/appop/jni/android/app/appops/cts/
DAppOpsLoggingTest.cpp33 AppOpsManager appOpsManager; in Java_android_app_appops_cts_AppOpsLoggingTestKt_nativeNoteOp() local
52 appOpsManager.noteOp(op, uid, callingPackageName, attributionTag, message); in Java_android_app_appops_cts_AppOpsLoggingTestKt_nativeNoteOp()
/cts/tests/tests/appop2/src/android/app/appops2/cts/
DAppOpsLoggingTest.kt51 private val appOpsManager = context.getSystemService(AppOpsManager::class.java) in <lambda>() constant
71 appOpsManager.setOnOpNotedCallback(Executor { it.run() }, in <lambda>()
138 appOpsManager.setOnOpNotedCallback(null, null) in <lambda>()
/cts/tests/tests/voiceRecognition/RecognitionService/src/com/android/recognitionservice/service/
DCtsVoiceRecognitionService.java90 final AppOpsManager appOpsManager = getSystemService(AppOpsManager.class); in blameCameraPermission() local
91 appOpsManager.noteProxyOpNoThrow(AppOpsManager.OPSTR_CAMERA, callingPackage, in blameCameraPermission()
/cts/tests/tests/telecom/src/android/telecom/cts/
DTelecomManagerTest.java71 AppOpsManager appOpsManager = mContext.getSystemService(AppOpsManager.class); in testHasManageOngoingCallsPermission() local
75 invokeMethodWithShellPermissionsNoReturn(appOpsManager, in testHasManageOngoingCallsPermission()
79 invokeMethodWithShellPermissionsNoReturn(appOpsManager, in testHasManageOngoingCallsPermission()
/cts/tests/musicrecognition/src/android/musicrecognition/cts/
DMusicRecognitionManagerTest.java216 final AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testRecordAudioOpsAreTracked() local
221 assertFalse(appOpsManager.isOpActive(AppOpsManager.OPSTR_RECORD_AUDIO, uid, packageName)); in testRecordAudioOpsAreTracked()
224 appOpsManager.startWatchingActive(new String[] { AppOpsManager.OPSTR_RECORD_AUDIO }, in testRecordAudioOpsAreTracked()
256 appOpsManager.stopWatchingActive(listener); in testRecordAudioOpsAreTracked()
/cts/tests/tests/sensorprivacy/test-apps/utils/src/android/sensorprivacy/cts/testapp/utils/
DUtils.kt64 val appOpsManager = context.getSystemService(AppOpsManager::class.java)!! in openCam() constant
107 appOpsManager.startOpNoThrow(AppOpsManager.OPSTR_CAMERA, in openCam()
/cts/hostsidetests/statsdatom/apps/statsdapp/src/com/android/server/cts/device/statsdatom/
DAtomTests.java479 AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testForegroundServiceAccessAppOp() local
482 noteAppOp(appOpsManager, AppOpsManager.OPSTR_COARSE_LOCATION); in testForegroundServiceAccessAppOp()
490 noteAppOp(appOpsManager, AppOpsManager.OPSTR_CAMERA); in testForegroundServiceAccessAppOp()
491 noteAppOp(appOpsManager, AppOpsManager.OPSTR_FINE_LOCATION); in testForegroundServiceAccessAppOp()
492 noteAppOp(appOpsManager, AppOpsManager.OPSTR_CAMERA); in testForegroundServiceAccessAppOp()
493 startAppOp(appOpsManager, AppOpsManager.OPSTR_RECORD_AUDIO); in testForegroundServiceAccessAppOp()
494 noteAppOp(appOpsManager, AppOpsManager.OPSTR_RECORD_AUDIO); in testForegroundServiceAccessAppOp()
495 startAppOp(appOpsManager, AppOpsManager.OPSTR_CAMERA); in testForegroundServiceAccessAppOp()
500 noteAppOp(appOpsManager, AppOpsManager.OPSTR_COARSE_LOCATION); in testForegroundServiceAccessAppOp()
509 AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); in testAppOps() local
[all …]
/cts/hostsidetests/devicepolicy/app/common/src/com/android/cts/devicepolicy/
DPermissionUtils.java167 AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class); in checkPermissionAndAppOps() local
168 if (appOpsManager != null && appOpsManager.noteProxyOpNoThrow( in checkPermissionAndAppOps()
/cts/tests/tests/permission2/src/android/permission2/cts/
DRestrictedStoragePermissionTest.java510 AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class); in assertHasFullStorageAccess() local
512 eventually(() -> assertThat(appOpsManager.unsafeCheckOpRawNoThrow( in assertHasFullStorageAccess()
520 AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class); in assertHasIsolatedStorageAccess() local
522 eventually(() -> assertThat(appOpsManager.unsafeCheckOpRawNoThrow( in assertHasIsolatedStorageAccess()
DRestrictedPermissionsTest.java502 final AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class); in assertRestrictedPermissionWhitelisted() local
551 assertWithMessage(op).that(appOpsManager.unsafeCheckOpRawNoThrow(op, in assertRestrictedPermissionWhitelisted()
/cts/tests/tests/permission/src/android/permission/cts/
DLocationAccessCheckTest.java819 AppOpsManager appOpsManager = sContext.getSystemService(AppOpsManager.class); in noNotificationIfBlamerNotSystemOrLocationProvider() local
820 appOpsManager.noteProxyOpNoThrow(OPSTR_FINE_LOCATION, TEST_APP_PKG, in noNotificationIfBlamerNotSystemOrLocationProvider()
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DSmsManagerTest.java549 AppOpsManager appOpsManager = in setModeForOps() local
552 appOpsManager.setUidMode(op, uid, mode); in setModeForOps()
DTelephonyManagerTest.java4624 AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class); in setAppOpsPermissionAllowed() local
4627 appOpsManager, (appOps) -> appOps.setUidMode(op, Process.myUid(), mode)); in setAppOpsPermissionAllowed()
/cts/tests/location/location_fine/src/android/location/cts/fine/
DLocationManagerFineTest.java1796 final AppOpsManager appOpsManager = mContext.getSystemService(AppOpsManager.class); in assertNotedOpsSinceLastLocationAccess() local
1798 appOpsManager.getPackagesForOps(new String[]{expectedOp, unexpectedOp}); in assertNotedOpsSinceLastLocationAccess()
1829 final AppOpsManager appOpsManager = mContext.getSystemService(AppOpsManager.class); in assertNoOpsNotedSinceLastLocationAccess() local
1831 appOpsManager.getPackagesForOps(new String[]{unexpectedOp}); in assertNoOpsNotedSinceLastLocationAccess()