Home
last modified time | relevance | path

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

123

/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/
DBatteryUtilsTest.java122 private AppOpsManager mAppOpsManager; field in BatteryUtilsTest
168 doReturn(mAppOpsManager).when(mContext).getSystemService(Context.APP_OPS_SERVICE); in setUp()
304 doReturn(AppOpsManager.MODE_IGNORED).when(mAppOpsManager).checkOpNoThrow( in testBackgroundRestrictionOn_restrictionOn_returnTrue()
313 doReturn(AppOpsManager.MODE_ALLOWED).when(mAppOpsManager).checkOpNoThrow( in testBackgroundRestrictionOn_restrictionOff_returnFalse()
347 verify(mAppOpsManager).setMode(AppOpsManager.OP_RUN_IN_BACKGROUND, UID, LOW_SDK_PACKAGE, in testSetForceAppStandby_forcePreOApp_forceTwoRestrictions()
349 verify(mAppOpsManager).setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID, LOW_SDK_PACKAGE, in testSetForceAppStandby_forcePreOApp_forceTwoRestrictions()
359 verify(mAppOpsManager, never()).setMode(AppOpsManager.OP_RUN_IN_BACKGROUND, UID, in testSetForceAppStandby_forceOApp_forceOneRestriction()
362 verify(mAppOpsManager).setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID, in testSetForceAppStandby_forceOApp_forceOneRestriction()
385 when(mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID, in testIsForceAppStandbyEnabled_enabled_returnTrue()
393 when(mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID, in testIsForceAppStandbyEnabled_disabled_returnFalse()
[all …]
DBackgroundActivityPreferenceControllerTest.java68 private AppOpsManager mAppOpsManager; field in BackgroundActivityPreferenceControllerTest
96 when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp()
123 doReturn(AppOpsManager.MODE_ALLOWED).when(mAppOpsManager) in handlePreferenceTreeClick_restrictApp_showDialog()
133 doReturn(AppOpsManager.MODE_IGNORED).when(mAppOpsManager) in handlePreferenceTreeClick_unRestrictApp_showDialog()
143 when(mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID_LOW_SDK, in updateState_noError_setEnabled()
172 when(mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID_LOW_SDK, in updateSummary_modeError_showSummaryDisabled()
183 when(mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID_LOW_SDK, in updateSummary_modeDefault_showNotRestricted()
193 when(mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID_LOW_SDK, in updateSummary_modeIgnored_showRestricted()
DRestrictAppPreferenceControllerTest.java69 private AppOpsManager mAppOpsManager; field in RestrictAppPreferenceControllerTest
102 doReturn(mAppOpsManager).when(mContext).getSystemService(Context.APP_OPS_SERVICE); in setUp()
123 doReturn(mPackageOpsList).when(mAppOpsManager).getPackagesForOps(any(int[].class)); in updateState_oneApp_showCorrectSummary()
139 doReturn(mPackageOpsList).when(mAppOpsManager).getPackagesForOps(any(int[].class)); in updateState_twoRestrictedAppsForPrimaryUser_visibleAndShowCorrectSummary()
155 doReturn(mPackageOpsList).when(mAppOpsManager).getPackagesForOps(any(int[].class)); in updateState_oneRestrictedAppForTwoUsers_showSummaryAndContainCorrectApp()
173 doReturn(mPackageOpsList).when(mAppOpsManager).getPackagesForOps(any(int[].class)); in updateState_zeroRestrictApp_inVisible()
/packages/apps/Car/Settings/src/com/android/car/settings/applications/appinfo/
DHibernationSwitchPreferenceController.java46 private final AppOpsManager mAppOpsManager; field in HibernationSwitchPreferenceController
55 mAppOpsManager = context.getSystemService(AppOpsManager.class); in HibernationSwitchPreferenceController()
71 mAppOpsManager.startWatchingMode( in onStartInternal()
78 mAppOpsManager.stopWatchingMode(this); in onStopInternal()
112 int mode = mAppOpsManager.unsafeCheckOpNoThrow( in isPackageHibernationExemptByUser()
129 mAppOpsManager.setUidMode(OPSTR_AUTO_REVOKE_PERMISSIONS_IF_UNUSED, mPackageUid, in handlePreferenceChanged()
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/
DMockLocationAppPreferenceControllerTest.java45 private AppOpsManager mAppOpsManager; field in MockLocationAppPreferenceControllerTest
64 ReflectionHelpers.setField(mController, "mAppsOpsManager", mAppOpsManager); in setup()
77 when(mAppOpsManager.getPackagesForOps(any(int[].class))).thenReturn( in updateState_foobarAppSelected_shouldSetSummaryToFoobar()
87 when(mAppOpsManager.getPackagesForOps(any(int[].class))) in updateState_noAppSelected_shouldSetSummaryToDefault()
105 when(mAppOpsManager.getPackagesForOps(any(int[].class))) in onActivityResult_fooPrevAppBarNewApp_shouldRemoveFooAndSetBarAsMockLocationApp()
114 verify(mAppOpsManager).setMode(anyInt(), anyInt(), eq(newAppName), in onActivityResult_fooPrevAppBarNewApp_shouldRemoveFooAndSetBarAsMockLocationApp()
116 verify(mAppOpsManager).setMode(anyInt(), anyInt(), eq(prevAppName), in onActivityResult_fooPrevAppBarNewApp_shouldRemoveFooAndSetBarAsMockLocationApp()
/packages/apps/Settings/src/com/android/settings/applications/appinfo/
DHibernationSwitchPreferenceController.java52 private final AppOpsManager mAppOpsManager; field in HibernationSwitchPreferenceController
61 mAppOpsManager = context.getSystemService(AppOpsManager.class); in HibernationSwitchPreferenceController()
67 mAppOpsManager.startWatchingMode( in onResume()
74 mAppOpsManager.stopWatchingMode(this); in onPause()
120 final int mode = mAppOpsManager.unsafeCheckOpNoThrow( in isPackageHibernationExemptByUser()
137 mAppOpsManager.setUidMode(OPSTR_AUTO_REVOKE_PERMISSIONS_IF_UNUSED, mPackageUid, in onPreferenceChange()
DWriteSettingsDetails.java55 private AppOpsManager mAppOpsManager; field in WriteSettingsDetails
66 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in onCreate()
98 mAppOpsManager.setMode(AppOpsManager.OP_WRITE_SETTINGS, in setCanWriteSettings()
111 int result = mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_WRITE_SETTINGS, in canWriteSettings()
/packages/apps/Settings/tests/unit/src/com/android/settings/applications/appinfo/
DHibernationSwitchPreferenceControllerTest.java60 private AppOpsManager mAppOpsManager; field in HibernationSwitchPreferenceControllerTest
73 when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp()
114 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_exemptedByDefaultPackage_shouldNotCheck()
126 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_exemptedPackageOverrideByUser_shouldCheck()
138 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_unexemptedPackageOverrideByUser_shouldNotCheck()
152 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_exemptedByDefaultPackageOverriddenByPreSFlag_shouldCheck()
/packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/task/
DUpdateInteractAcrossProfilesAppOpTask.java49 private final AppOpsManager mAppOpsManager; field in UpdateInteractAcrossProfilesAppOpTask
60 mAppOpsManager = context.getSystemService(AppOpsManager.class); in UpdateInteractAcrossProfilesAppOpTask()
162 final int packageMode = mAppOpsManager.unsafeCheckOpNoThrow(op, uid, packageName); in getConsolidatedModeForPackagesInUid()
196 mAppOpsManager.setMode( in setInteractAcrossProfilesAppOpForPackage()
199 mAppOpsManager.setUidMode(OP_INTERACT_ACROSS_PROFILES, uid, mode); in setInteractAcrossProfilesAppOpForPackage()
203 return mAppOpsManager.unsafeCheckOpNoThrow(op, uid, packageName) in appOpIsChangedFromDefault()
/packages/apps/Settings/src/com/android/settings/applications/
DAppStateManageExternalStorageBridge.java38 private final AppOpsManager mAppOpsManager; field in AppStateManageExternalStorageBridge
43 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in AppStateManageExternalStorageBridge()
57 ((PermissionState) app.extraInfo).appOpMode = mAppOpsManager.unsafeCheckOpNoThrow( in loadAllExtraInfo()
66 ps.appOpMode = mAppOpsManager.unsafeCheckOpNoThrow(APP_OP_STR, uid, pkg); in getPermissionInfo()
DUsageAccessDetails.java55 private AppOpsManager mAppOpsManager; field in UsageAccessDetails
68 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in onCreate()
127 mAppOpsManager.setMode(OP_GET_USAGE_STATS, uid, mPackageName, newAppOpMode); in setHasAccess()
131 mAppOpsManager.setMode(OP_LOADER_USAGE_STATS, uid, mPackageName, newAppOpMode); in setHasAccess()
DAppStateMediaManagementAppsBridge.java36 private final AppOpsManager mAppOpsManager; field in AppStateMediaManagementAppsBridge
44 mAppOpsManager = context.getSystemService(AppOpsManager.class); in AppStateMediaManagementAppsBridge()
71 permissionState.appOpMode = mAppOpsManager.unsafeCheckOpNoThrow( in createPermissionState()
/packages/apps/Settings/src/com/android/settings/fuelgauge/
DBackgroundActivityPreferenceController.java48 private final AppOpsManager mAppOpsManager; field in BackgroundActivityPreferenceController
71 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in BackgroundActivityPreferenceController()
85 final int mode = mAppOpsManager in updateState()
110 final int mode = mAppOpsManager in handlePreferenceTreeClick()
124 final int mode = mAppOpsManager in updateSummary()
DRestrictAppPreferenceController.java46 private AppOpsManager mAppOpsManager; field in RestrictAppPreferenceController
52 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in RestrictAppPreferenceController()
54 mAppInfos = BatteryTipUtils.getRestrictedAppsList(mAppOpsManager, mUserManager); in RestrictAppPreferenceController()
70 mAppInfos = BatteryTipUtils.getRestrictedAppsList(mAppOpsManager, mUserManager); in updateState()
DBatteryOptimizeUtils.java32 @VisibleForTesting AppOpsManager mAppOpsManager; field in BatteryOptimizeUtils
54 mAppOpsManager = context.getSystemService(AppOpsManager.class); in BatteryOptimizeUtils()
57 mMode = mAppOpsManager in BatteryOptimizeUtils()
119 mMode = mAppOpsManager in refreshState()
DBatteryUtils.java87 private AppOpsManager mAppOpsManager; field in BatteryUtils
103 mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); in BatteryUtils()
285 final int mode = mAppOpsManager in isBackgroundRestrictionEnabled()
334 mAppOpsManager.setMode(AppOpsManager.OP_RUN_IN_BACKGROUND, uid, packageName, mode); in setForceAppStandby()
337 mAppOpsManager.setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, uid, packageName, mode); in setForceAppStandby()
353 return mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, uid, in isForceAppStandbyEnabled()
420 return mPackageManager == null || mAppOpsManager == null; in isDataCorrupted()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/applications/appinfo/
DHibernationSwitchPreferenceControllerTest.java68 private AppOpsManager mAppOpsManager; field in HibernationSwitchPreferenceControllerTest
89 when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager); in setUp()
131 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_exemptedByDefaultPackage_shouldNotCheck()
144 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_exemptedPackageOverrideByUser_shouldCheck()
157 when(mAppOpsManager.unsafeCheckOpNoThrow( in updateState_unexemptedPackageOverrideByUser_shouldNotCheck()
/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/
DTelecomServiceImplTest.java159 private AppOpsManager mAppOpsManager; field in TelecomServiceImplTest
231 mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE); in setUp()
262 doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testGetDefaultOutgoingPhoneAccount()
292 doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testGetDefaultOutgoingPhoneAccountSucceedsIfCallerIsSimCallManager()
316 when(mAppOpsManager.noteOp(eq(AppOpsManager.OP_READ_PHONE_STATE), anyInt(), anyString(), in testGetDefaultOutgoingPhoneAccountFailure()
325 doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testGetDefaultOutgoingPhoneAccountFailure()
635 doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testAddNewIncomingCall()
653 doThrow(new SecurityException()).when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testAddNewIncomingCallFailure()
673 doNothing().when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testAddNewUnknownCall()
691 doThrow(new SecurityException()).when(mAppOpsManager).checkPackage(anyInt(), anyString()); in testAddNewUnknownCallFailure()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/
DManageExternalStorageDetailsTest.java58 private AppOpsManager mAppOpsManager; field in ManageExternalStorageDetailsTest
79 ReflectionHelpers.setField(mFragment, "mAppOpsManager", mAppOpsManager); in setUp()
108 verify(mAppOpsManager, times(1)) in onPreferenceChange_enableManageExternalStorage_shouldTriggerAppOpsManager()
143 verify(mAppOpsManager, times(1)) in onPreferenceChange_disableManageExternalStorage_shouldTriggerAppOpsManager()
180 doAnswer(answerSetUidMode).when(mAppOpsManager) in mockAppOpsOperations()
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/tips/
DAppRestrictionPredicate.java32 private AppOpsManager mAppOpsManager; field in AppRestrictionPredicate
43 mAppOpsManager = context.getSystemService(AppOpsManager.class); in AppRestrictionPredicate()
49 return mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, in test()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/device/apps/specialaccess/
DPictureInPicture.java47 private AppOpsManager mAppOpsManager; field in PictureInPicture
61 info.extraInfo = mAppOpsManager.checkOpNoThrow(
74 mAppOpsManager = getContext().getSystemService(AppOpsManager.class); in onCreate()
119 mAppOpsManager.setMode(AppOpsManager.OP_PICTURE_IN_PICTURE, in bindPreference()
DAlarmsAndReminders.java40 private AppOpsManager mAppOpsManager; field in AlarmsAndReminders
45 mAppOpsManager = getContext().getSystemService(AppOpsManager.class); in onCreate()
95 mAppOpsManager.setMode(getAppOpsOpCode(), in setAlarmsAndRemindersAccess()
DWriteSettings.java40 private AppOpsManager mAppOpsManager; field in WriteSettings
45 mAppOpsManager = getContext().getSystemService(AppOpsManager.class); in onCreate()
83 mAppOpsManager.setMode(AppOpsManager.OP_WRITE_SETTINGS, in setWriteSettingsAccess()
/packages/services/Telecomm/src/com/android/server/telecom/
DTelecomServiceImpl.java1245 mAppOpsManager.checkPackage(
1307 mAppOpsManager.checkPackage(
1350 mAppOpsManager.checkPackage(
1405 mAppOpsManager.checkPackage(
1504 final boolean hasCallAppOp = mAppOpsManager.noteOp(AppOpsManager.OP_CALL_PHONE,
2021 && mAppOpsManager.checkOp(opCode, uid, packageName) in enforceAnswerCallPermission()
2040 mAppOpsManager.checkOp(opCode, uid, packageName) in enforceAcceptHandoverPermission()
2048 private AppOpsManager mAppOpsManager; field in TelecomServiceImpl
2070 mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE); in TelecomServiceImpl()
2237 mAppOpsManager.checkPackage(Binder.getCallingUid(), packageName); in enforceCallingPackage()
[all …]
/packages/apps/Settings/src/com/android/settings/fuelgauge/batterytip/
DBatteryManagerPreferenceController.java37 private AppOpsManager mAppOpsManager; field in BatteryManagerPreferenceController
44 mAppOpsManager = context.getSystemService(AppOpsManager.class); in BatteryManagerPreferenceController()
56 final int num = BatteryTipUtils.getRestrictedAppsList(mAppOpsManager, mUserManager).size(); in updateState()

123