Home
last modified time | relevance | path

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

1234

/frameworks/base/core/tests/coretests/src/android/content/
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 …]
/frameworks/base/services/autofill/java/com/android/server/autofill/ui/
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()
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/
DPipAppOpsListener.kt28 private val mAppOpsManager: AppOpsManager = checkNotNull( in <lambda>() constant in com.android.wm.shell.common.pip.PipAppOpsListener
39 mAppOpsManager.checkOpNoThrow( in <lambda>()
63 mAppOpsManager.startWatchingMode( in <lambda>()
70 mAppOpsManager.stopWatchingMode(mAppOpsChangedListener) in <lambda>()
/frameworks/av/services/camera/libcameraservice/api2/
DCameraOfflineSessionClient.cpp237 if (mAppOpsManager != nullptr) { in startCameraOps()
242 mAppOpsManager->startWatchingMode(AppOpsManager::OP_CAMERA, in startCameraOps()
245 res = mAppOpsManager->startOpNoThrow(AppOpsManager::OP_CAMERA, in startCameraOps()
278 if (mAppOpsManager != nullptr) { in finishCameraOps()
280 mAppOpsManager->finishOp(AppOpsManager::OP_CAMERA, mClientUid, in finishCameraOps()
286 if (mOpsCallback != nullptr && mAppOpsManager != nullptr) { in finishCameraOps()
287 mAppOpsManager->stopWatchingMode(mOpsCallback); in finishCameraOps()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/fuelgauge/
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()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/
DRestrictedSwitchPreference.java51 AppOpsManager mAppOpsManager; field in RestrictedSwitchPreference
104 mAppOpsManager = appOps; in setAppOps()
284 if (mAppOpsManager == null) { in updateState()
285 mAppOpsManager = getContext().getSystemService(AppOpsManager.class); in updateState()
287 final int mode = mAppOpsManager.noteOpNoThrow( in updateState()
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/sensorprivacy/
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()
/frameworks/av/services/audiopolicy/service/
DAudioRecordClient.cpp102 mAppOpsManager.stopWatchingMode(mOpCallback); in ~OpRecordAudioMonitor()
118 mAppOpsManager.startWatchingMode(mAppOp, VALUE_OR_FATAL(aidl2legacy_string_view_String16( in onFirstRef()
138 const int32_t mode = mAppOpsManager.checkOp(mAppOp, in checkOp()
/frameworks/base/services/tests/servicestests/src/com/android/server/appop/
DAppOpsDeviceAwareServiceTest.java66 private final AppOpsManager mAppOpsManager = mContext.getSystemService(AppOpsManager.class); field in AppOpsDeviceAwareServiceTest
124 int mode = mAppOpsManager.noteProxyOp(OP_CAMERA, proxyAttributionSource, null, false); in noteProxyOpWithDeviceId()
128 mAppOpsManager.getPackagesForOps( in noteProxyOpWithDeviceId()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/location/
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()
/frameworks/base/services/incremental/test/
DIncrementalServiceTest.cpp691 mAppOpsManager(std::move(appOpsManager)), in MockServiceManager()
704 return std::move(mAppOpsManager); in getAppOpsManager()
719 std::unique_ptr<MockAppOpsManager> mAppOpsManager; member in android::os::incremental::MockServiceManager
742 mAppOpsManager = appOps.get(); in SetUp()
856 NiceMock<MockAppOpsManager>* mAppOpsManager = nullptr; member in android::os::incremental::IncrementalServiceTest
1451 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1460 EXPECT_CALL(*mAppOpsManager, startWatchingMode(_, _, _)).Times(1); in TEST_F()
1462 EXPECT_CALL(*mAppOpsManager, stopWatchingMode(_)).Times(0); in TEST_F()
1475 mAppOpsManager->checkPermissionSuccess(); in TEST_F()
1483 EXPECT_CALL(*mAppOpsManager, startWatchingMode(_, _, _)).Times(1); in TEST_F()
[all …]
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
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()
/frameworks/base/services/core/java/com/android/server/am/
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()
DBaseAppStateTracker.java290 AppOpsManager mAppOpsManager; field in BaseAppStateTracker.Injector
312 mAppOpsManager = context.getSystemService(AppOpsManager.class); in onSystemReady()
373 return mAppOpsManager; in getAppOpsManager()
/frameworks/base/services/core/java/com/android/server/sensorprivacy/
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()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/
DRecentAppOpsAccessesTest.java77 private AppOpsManager mAppOpsManager; field in RecentAppOpsAccessesTest
94 when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp()
120 when(mAppOpsManager.getPackagesForOps(RecentAppOpsAccess.LOCATION_OPS)).thenReturn( in setUp()
206 when(mAppOpsManager.getPackagesForOps(RecentAppOpsAccess.LOCATION_OPS)).thenReturn( in testGetAppList_shouldNotShowAndroidOS()
/frameworks/base/services/voiceinteraction/java/com/android/server/voiceinteraction/
DHotwordAudioStreamCopier.java72 private final AppOpsManager mAppOpsManager; field in HotwordAudioStreamCopier
82 mAppOpsManager = appOpsManager; in HotwordAudioStreamCopier()
227 && mAppOpsManager.startOpNoThrow( in run()
287 mAppOpsManager.finishOp( in run()
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/permission/
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()
/frameworks/base/tests/TelephonyCommonTests/src/com/android/internal/telephony/tests/
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()
/frameworks/base/services/musicrecognition/java/com/android/server/musicrecognition/
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()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/appops/
DAppOpsControllerTest.java90 private AppOpsManager mAppOpsManager; field in AppOpsControllerTest
122 getContext().addMockSystemService(AppOpsManager.class, mAppOpsManager); in setUp()
158 verify(mAppOpsManager, times(1)).startWatchingActive(AppOpsControllerImpl.OPS, mController); in testOnlyListenForFewOps()
167 verify(mAppOpsManager, times(1)).stopWatchingActive(mController); in testStopListening()
174 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_none()
186 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)).thenReturn(null); in startListening_fetchCurrentActive_nullPackageOps()
202 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_oneActive()
235 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_multiplePackages()
283 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_multipleEntries()
323 when(mAppOpsManager.getPackagesForOps(AppOpsControllerImpl.OPS)) in startListening_fetchesCurrentActive_multipleAttributes()
[all …]
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/
DPackageInstallerActivity.java105 AppOpsManager mAppOpsManager; field in PackageInstallerActivity
256 int appOpMode = mAppOpsManager.noteOpNoThrow(appOpStr, mOriginatingUid, in onActivityResult()
372 mAppOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE); in onCreate()
569 final int appOpMode = mAppOpsManager.noteOpNoThrow(appOpStr, mOriginatingUid, in handleUnknownSources()
575 mAppOpsManager.setMode(appOpStr, mOriginatingUid, in handleUnknownSources()
843 mAppOpsManager.startWatchingMode(
850 mAppOpsManager.stopWatchingMode(listener);
/frameworks/base/services/accessibility/java/com/android/server/accessibility/
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()
/frameworks/base/core/java/android/permission/
DPermissionUsageHelper.java167 private AppOpsManager mAppOpsManager; field in PermissionUsageHelper
181 mAppOpsManager = context.getSystemService(AppOpsManager.class); in PermissionUsageHelper()
187 mAppOpsManager.startWatchingActive(opStrs, context.getMainExecutor(), this); in PermissionUsageHelper()
189 mAppOpsManager.startWatchingStarted(ops, this); in PermissionUsageHelper()
200 mAppOpsManager.stopWatchingActive(this); in tearDown()
201 mAppOpsManager.stopWatchingStarted(this); in tearDown()
489 ops = mAppOpsManager.getPackagesForOps(opNames.toArray(new String[opNames.size()]), in getOpUsagesByDevice()
498 ops = mAppOpsManager.getPackagesForOps(opNames.toArray(new String[opNames.size()])); in getOpUsagesByDevice()
/frameworks/base/services/tests/voiceinteractiontests/src/com/android/server/voiceinteraction/
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()

1234