Home
last modified time | relevance | path

Searched refs:mAppOpsManager (Results 1 – 25 of 63) sorted by relevance

123

/aosp14/frameworks/base/core/tests/coretests/src/android/content/
H A DPermissionCheckerTest.java40 private final AppOpsManager mAppOpsManager = mContext.getSystemService(AppOpsManager.class); field in PermissionCheckerTest
54 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForPreflight_appOpPermission_modeDefaultAndPermissionGranted_returnsGranted()
66 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForPreflight_appOpPermission_modeDefaultAndPermissionNotGranted_returnsHardDenied()
78 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForPreflight_appOpPermission_modeAllowed_returnsGranted()
90 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForPreflight_appOpPermission_packageNameIsNull_returnsGranted()
102 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForPreflight_appOpPermission_modeIgnored_returnsHardDenied()
114 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForPreflight_appOpPermission_modeErrored_returnsHardDenied()
127 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForDataDelivery_appOpPermission_modeDefaultAndPermissionGranted_returnsGranted()
139 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForDataDelivery_appOpPermission_modeDefaultAndPermissionNotGranted_returnsHardDenied()
151 mAppOpsManager.setMode(AppOpsManager.permissionToOp(INTERACT_ACROSS_PROFILES_PERMISSION), in testCheckPermissionForDataDelivery_appOpPermission_modeAllowed_returnsGranted()
[all …]
/aosp14/frameworks/base/services/autofill/java/com/android/server/autofill/ui/
H A DOverlayControl.java35 private final @NonNull AppOpsManager mAppOpsManager; field in OverlayControl
38 mAppOpsManager = context.getSystemService(AppOpsManager.class); in OverlayControl()
50 if (mAppOpsManager != null) { in setOverlayAllowed()
51 mAppOpsManager.setUserRestrictionForUser(AppOpsManager.OP_SYSTEM_ALERT_WINDOW, !allowed, in setOverlayAllowed()
53 mAppOpsManager.setUserRestrictionForUser(AppOpsManager.OP_TOAST_WINDOW, !allowed, in setOverlayAllowed()
/aosp14/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/
H A DPipAppOpsListener.kt28 private val mAppOpsManager: AppOpsManager = checkNotNull(
39 mAppOpsManager.checkOpNoThrow(
63 mAppOpsManager.startWatchingMode(
70 mAppOpsManager.stopWatchingMode(mAppOpsChangedListener)
/aosp14/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/
H A DPowerAllowlistBackendTest.java62 private AppOpsManager mAppOpsManager; field in PowerAllowlistBackendTest
80 doReturn(mAppOpsManager).when(mContext).getSystemService(AppOpsManager.class); in setUp()
81 doReturn(AppOpsManager.MODE_DEFAULT).when(mAppOpsManager).checkOpNoThrow( in setUp()
83 doReturn(AppOpsManager.MODE_DEFAULT).when(mAppOpsManager).checkOpNoThrow( in setUp()
156 doReturn(AppOpsManager.MODE_ALLOWED).when(mAppOpsManager).checkOpNoThrow( in isAllowlisted_shouldAllowlistAppWithSystemExemptAppOp()
/aosp14/frameworks/base/packages/SettingsLib/src/com/android/settingslib/
H A DRestrictedSwitchPreference.java52 AppOpsManager mAppOpsManager; field in RestrictedSwitchPreference
106 mAppOpsManager = appOps; in setAppOps()
250 if (mAppOpsManager == null) { in updateState()
251 mAppOpsManager = getContext().getSystemService(AppOpsManager.class); in updateState()
253 final int mode = mAppOpsManager.noteOpNoThrow( in updateState()
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/sensorprivacy/
H A DCameraPrivacyLightControllerTest.java82 private AppOpsManager mAppOpsManager; field in CameraPrivacyLightControllerTest
143 doReturn(mAppOpsManager).when(context).getSystemService(AppOpsManager.class); in prepareCameraPrivacyLightController()
180 verifyZeroInteractions(mAppOpsManager); in testNoInteractionsWithServicesIfNoColorsSpecified()
188 verify(mAppOpsManager, times(0)).startWatchingActive(any(), any(), any()); in testAppsOpsListenerNotRegisteredWithoutCameraLights()
195 verify(mAppOpsManager, times(1)).startWatchingActive(any(), any(), any()); in testAppsOpsListenerRegisteredWithCameraLight()
343 verify(mAppOpsManager).startWatchingActive(any(), any(), mAppOpsListenerCaptor.capture()); in notifyCamOpChanged()
367 verify(mAppOpsManager).startWatchingActive(any(), any(), mAppOpsListenerCaptor.capture()); in openCamera()
/aosp14/frameworks/base/services/incremental/test/
H A DIncrementalServiceTest.cpp704 return std::move(mAppOpsManager); in getAppOpsManager()
742 mAppOpsManager = appOps.get(); in SetUp()
1451 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1475 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1501 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1542 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1583 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1659 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1685 mAppOpsManager->checkPermissionFails(); in TEST_F()
1726 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
[all …]
/aosp14/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/location/
H A DRecentLocationAppsTest.java52 private AppOpsManager mAppOpsManager; field in RecentLocationAppsTest
65 when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp()
79 when(mAppOpsManager.getPackagesForOps(RecentLocationApps.LOCATION_REQUEST_OPS)).thenReturn( in setUp()
112 when(mAppOpsManager.getPackagesForOps(RecentLocationApps.LOCATION_REQUEST_OPS)).thenReturn( in testGetAppList_shouldNotShowAndroidOS()
/aosp14/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/
H A DRecentAppOpsAccessesTest.java71 private AppOpsManager mAppOpsManager; field in RecentAppOpsAccessesTest
86 when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp()
112 when(mAppOpsManager.getPackagesForOps(RecentAppOpsAccess.LOCATION_OPS)).thenReturn( in setUp()
146 when(mAppOpsManager.getPackagesForOps(RecentAppOpsAccess.LOCATION_OPS)).thenReturn( in testGetAppList_shouldNotShowAndroidOS()
/aosp14/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
H A DAssistDataRequesterTest.java97 private AppOpsManager mAppOpsManager; field in AssistDataRequesterTest
112 mAppOpsManager = mock(AppOpsManager.class); in setUp()
117 mAppOpsManager, mCallbacks, mCallbacksLock, OP_ASSIST_STRUCTURE, in setUp()
150 doReturn(assistStructureAllowed ? MODE_ALLOWED : MODE_ERRORED).when(mAppOpsManager) in setupMocks()
152 doReturn(assistScreenshotAllowed ? MODE_ALLOWED : MODE_ERRORED).when(mAppOpsManager) in setupMocks()
/aosp14/frameworks/base/services/core/java/com/android/server/am/
H A DAssistDataRequester.java62 private AppOpsManager mAppOpsManager; field in AssistDataRequester
141 mAppOpsManager = appOpsManager; in AssistDataRequester()
240 if (mAppOpsManager.noteOpNoThrow(mRequestStructureAppOps, callingUid, in requestData()
291 if (mAppOpsManager.noteOpNoThrow(mRequestScreenshotAppOps, callingUid, in requestData()
H A DBaseAppStateTracker.java290 AppOpsManager mAppOpsManager; field in BaseAppStateTracker.Injector
311 mAppOpsManager = context.getSystemService(AppOpsManager.class); in onSystemReady()
371 return mAppOpsManager; in getAppOpsManager()
/aosp14/frameworks/base/services/core/java/com/android/server/sensorprivacy/
H A DCameraPrivacyLightController.java59 private final AppOpsManager mAppOpsManager; field in CameraPrivacyLightController
104 mAppOpsManager = null; in CameraPrivacyLightController()
118 mAppOpsManager = mContext.getSystemService(AppOpsManager.class); in CameraPrivacyLightController()
149 mAppOpsManager.startWatchingActive( in CameraPrivacyLightController()
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/pm/permission/
H A DLegacyPermissionManagerServiceTest.java64 private AppOpsManager mAppOpsManager; field in LegacyPermissionManagerServiceTest
146 when(mAppOpsManager.noteOpNoThrow(eq(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS), in checkDeviceIdentifierAccess_hasAppOp_returnsGranted()
440 when(mAppOpsManager.noteOpNoThrow(anyString(), anyInt(), anyString(), any(), in setupAccessTest()
442 when(mInjector.getSystemService(eq(Context.APP_OPS_SERVICE))).thenReturn(mAppOpsManager); in setupAccessTest()
465 when(mAppOpsManager.noteOpNoThrow(eq(appop), eq(APP_UID), eq(mPackageName), any(), in grantPermissionAndAppop()
/aosp14/frameworks/base/services/voiceinteraction/java/com/android/server/voiceinteraction/
H A DHotwordAudioStreamCopier.java72 private final AppOpsManager mAppOpsManager; field in HotwordAudioStreamCopier
82 mAppOpsManager = appOpsManager; in HotwordAudioStreamCopier()
203 if (mAppOpsManager.startOpNoThrow(AppOpsManager.OPSTR_RECORD_AUDIO_HOTWORD, in run()
247 mAppOpsManager.finishOp(AppOpsManager.OPSTR_RECORD_AUDIO_HOTWORD, in run()
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/job/
H A DBackgroundRestrictionsTest.java76 private AppOpsManager mAppOpsManager; field in BackgroundRestrictionsTest
108 mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE); in setUp()
188 mAppOpsManager.setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, mTestPackageUid, in setAppOpsModeAllowed()
/aosp14/frameworks/base/tests/TelephonyCommonTests/src/com/android/internal/telephony/tests/
H A DSmsApplicationTest.java114 @Mock private AppOpsManager mAppOpsManager; field in SmsApplicationTest
124 when(mContext.getSystemService(AppOpsManager.class)).thenReturn(mAppOpsManager); in setUp()
151 when(mAppOpsManager.unsafeCheckOp( in setUp()
201 when(mAppOpsManager.unsafeCheckOp(AppOpsManager.OPSTR_READ_SMS, SMS_APP_UID, in testGetDefaultSmsApplicationWithAppOpsFix()
209 verify(mAppOpsManager, atLeastOnce()).setUidMode(AppOpsManager.OPSTR_READ_SMS, SMS_APP_UID, in testGetDefaultSmsApplicationWithAppOpsFix()
/aosp14/frameworks/base/services/musicrecognition/java/com/android/server/musicrecognition/
H A DMusicRecognitionManagerPerUserService.java77 private final AppOpsManager mAppOpsManager; field in MusicRecognitionManagerPerUserService
92 mAppOpsManager = getContext().createAttributionContext( in MusicRecognitionManagerPerUserService()
363 int status = mAppOpsManager.startProxyOp( in startRecordAudioOp()
383 mAppOpsManager.finishProxyOp( in finishRecordAudioOp()
/aosp14/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/appops/
H A DAppOpsControllerTest.java86 private AppOpsManager mAppOpsManager; field in AppOpsControllerTest
117 getContext().addMockSystemService(AppOpsManager.class, mAppOpsManager); in setUp()
150 verify(mAppOpsManager, times(1)).startWatchingActive(AppOpsControllerImpl.OPS, mController); in testOnlyListenForFewOps()
158 verify(mAppOpsManager, times(1)).stopWatchingActive(mController); in testStopListening()
165 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_none()
181 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_oneActive()
213 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_multiplePackages()
260 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_multipleEntries()
299 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_multipleAttributes()
334 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in addCallback_existingCallbacksNotifiedOfCurrentActive()
/aosp14/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/
H A DPackageInstallerActivity.java98 AppOpsManager mAppOpsManager; field in PackageInstallerActivity
240 int appOpMode = mAppOpsManager.noteOpNoThrow(appOpStr, mOriginatingUid, in onActivityResult()
349 mAppOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE); in onCreate()
537 final int appOpMode = mAppOpsManager.noteOpNoThrow(appOpStr, mOriginatingUid, in handleUnknownSources()
543 mAppOpsManager.setMode(appOpStr, mOriginatingUid, in handleUnknownSources()
809 mAppOpsManager.startWatchingMode(
816 mAppOpsManager.stopWatchingMode(listener);
/aosp14/frameworks/base/services/accessibility/java/com/android/server/accessibility/
H A DAccessibilitySecurityPolicy.java107 private final AppOpsManager mAppOpsManager; field in AccessibilitySecurityPolicy
130 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in AccessibilitySecurityPolicy()
619 if (mAppOpsManager.noteOpNoThrow(AppOpsManager.OPSTR_BIND_ACCESSIBILITY_SERVICE, in canRegisterService()
653 return mAppOpsManager.noteOpNoThrow(AppOpsManager.OPSTR_ACCESS_ACCESSIBILITY, in checkAccessibilityAccess()
658 return mAppOpsManager.noteOp(AppOpsManager.OPSTR_ACCESS_ACCESSIBILITY, in checkAccessibilityAccess()
/aosp14/frameworks/base/services/tests/voiceinteractiontests/src/com/android/server/voiceinteraction/
H A DHotwordAudioStreamCopierTest.java67 private AppOpsManager mAppOpsManager; field in HotwordAudioStreamCopierTest
71 mAppOpsManager = mock(AppOpsManager.class); in setUp()
72 mCopier = new HotwordAudioStreamCopier(mAppOpsManager, DETECTOR_TYPE, VOICE_INTERACTOR_UID, in setUp()
/aosp14/frameworks/base/core/java/android/permission/
H A DPermissionUsageHelper.java171 private AppOpsManager mAppOpsManager; field in PermissionUsageHelper
184 mAppOpsManager = context.getSystemService(AppOpsManager.class); in PermissionUsageHelper()
189 mAppOpsManager.startWatchingActive(opStrs, context.getMainExecutor(), this); in PermissionUsageHelper()
191 mAppOpsManager.startWatchingStarted(ops, this); in PermissionUsageHelper()
202 mAppOpsManager.stopWatchingActive(this); in tearDown()
203 mAppOpsManager.stopWatchingStarted(this); in tearDown()
461 ops = mAppOpsManager.getPackagesForOps(opNames.toArray(new String[opNames.size()])); in getOpUsages()
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/biometrics/
H A DAuthServiceTest.java106 AppOpsManager mAppOpsManager; field in AuthServiceTest
140 when(mInjector.getAppOps(any())).thenReturn(mAppOpsManager); in setUp()
204 when(mAppOpsManager.noteOp(eq(AppOpsManager.OP_USE_BIOMETRIC), anyInt(), any(), any(), in testAuthenticate_appOpsOk_callsBiometricServiceAuthenticate()
233 when(mAppOpsManager.noteOp(eq(AppOpsManager.OP_USE_BIOMETRIC), anyInt(), any(), any(), in testAuthenticate_appOpsDenied_doesNotCallBiometricService()
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/
H A DFingerprintServiceTest.java98 private AppOpsManager mAppOpsManager; field in FingerprintServiceTest
143 mContext.addMockSystemService(AppOpsManager.class, mAppOpsManager); in setup()
145 when(mAppOpsManager.noteOp(eq(permission), anyInt(), any(), any(), any())) in setup()

123