Home
last modified time | relevance | path

Searched refs:mDpm (Results 1 – 25 of 73) sorted by relevance

123

/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/enterprise/
DBaseEnterpriseTestCase.java88 protected DevicePolicyManager mDpm; field in BaseEnterpriseTestCase
108 assertWithMessage("mDpm").that(mDpm).isNotNull(); in setFixtures()
112 when(mSpiedContext.getSystemService(DevicePolicyManager.class)).thenReturn(mDpm); in setFixtures()
141 when(mDpm.getProfileOwner()).thenReturn(mDefaultAdmin); in mockProfileOwner()
145 when(mDpm.getProfileOwnerAsUser(MY_USER_ID)).thenReturn(mDefaultAdmin); in mockProfileOwnerAsUser()
146 when(mDpm.getProfileOwnerAsUser(MY_USER_ID.getIdentifier())).thenReturn(mDefaultAdmin); in mockProfileOwnerAsUser()
150 when(mDpm.getProfileOwnerAsUser(MY_USER_ID)).thenReturn(null); in mockNoProfileOwnerAsUser()
151 when(mDpm.getProfileOwnerAsUser(MY_USER_ID.getIdentifier())).thenReturn(null); in mockNoProfileOwnerAsUser()
155 when(mDpm.isDeviceManaged()).thenReturn(true); in mockDeviceOwner()
157 when(mDpm.isDeviceManaged()).thenReturn(true); in mockDeviceOwner()
[all …]
DCaCertsCurrentUserPreferenceControllerTest.java62 when(mDpm.getOwnerInstalledCaCerts(any())).thenReturn(Collections.emptyList()); in testNoInstalledCaCerts_preferenceDisabled()
76 when(mDpm.getOwnerInstalledCaCerts(any())).thenReturn(ImmutableList.of("cert1", "cert2")); in testInstalledCaCerts_preferenceEnabled()
88 when(mDpm.getOwnerInstalledCaCerts(any())).thenReturn(ImmutableList.of("cert1", "cert2")); in testNoCompMode_showsRegularTitle()
99 when(mDpm.getOwnerInstalledCaCerts(any())).thenReturn(ImmutableList.of("cert1", "cert2")); in testCompMode_showsPersonalProfileTitle()
DEnterpriseUtilsTest.java150 when(mDpm.isDeviceManaged()).thenReturn(false); in testHasDeviceOwner_unmanagedDevice()
157 when(mDpm.isDeviceManaged()).thenReturn(true); in testHasDeviceOwner_managedDevice_noDeviceOwnerComponent()
158 when(mDpm.getDeviceOwnerComponentOnAnyUser()).thenReturn(null); in testHasDeviceOwner_managedDevice_noDeviceOwnerComponent()
165 when(mDpm.isDeviceManaged()).thenReturn(true); in testHasDeviceOwner()
166 when(mDpm.getDeviceOwnerComponentOnAnyUser()) in testHasDeviceOwner()
/packages/apps/Settings/src/com/android/settings/enterprise/
DEnterprisePrivacyFeatureProviderImpl.java52 private final DevicePolicyManager mDpm; field in EnterprisePrivacyFeatureProviderImpl
66 mDpm = dpm; in EnterprisePrivacyFeatureProviderImpl()
87 final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName(); in getDeviceOwnerOrganizationName()
102 final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName(); in getDeviceOwnerDisclosure()
104 disclosure.append(mDpm.getResources().getString(DEVICE_MANAGED_WITH_NAME, in getDeviceOwnerDisclosure()
108 disclosure.append(mDpm.getResources().getString(DEVICE_MANAGED_WITHOUT_NAME, in getDeviceOwnerDisclosure()
116 final long timestamp = mDpm.getLastSecurityLogRetrievalTime(); in getLastSecurityLogRetrievalTime()
122 final long timestamp = mDpm.getLastBugReportRequestTime(); in getLastBugReportRequestTime()
128 final long timestamp = mDpm.getLastNetworkLogRetrievalTime(); in getLastNetworkLogRetrievalTime()
134 return mDpm.isSecurityLoggingEnabled(null); in isSecurityLoggingEnabled()
[all …]
/packages/apps/TvSettings/SettingsAPI/java/com/android/tv/settings/library/enterprise/
DEnterprisePrivacyFeatureProviderImpl.java46 private final DevicePolicyManager mDpm; field in EnterprisePrivacyFeatureProviderImpl
59 mDpm = dpm; in EnterprisePrivacyFeatureProviderImpl()
79 final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName(); in getDeviceOwnerOrganizationName()
94 final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName(); in getDeviceOwnerDisclosure()
109 final long timestamp = mDpm.getLastSecurityLogRetrievalTime(); in getLastSecurityLogRetrievalTime()
115 final long timestamp = mDpm.getLastBugReportRequestTime(); in getLastBugReportRequestTime()
121 final long timestamp = mDpm.getLastNetworkLogRetrievalTime(); in getLastNetworkLogRetrievalTime()
127 return mDpm.isSecurityLoggingEnabled(null); in isSecurityLoggingEnabled()
132 return mDpm.isNetworkLoggingEnabled(null); in isNetworkLoggingEnabled()
149 ComponentName owner = mDpm.getDeviceOwnerComponentOnCallingUser(); in getMaximumFailedPasswordsBeforeWipeInCurrentUser()
[all …]
/packages/apps/Car/Settings/src/com/android/car/settingslib/enterprise/
DEnterprisePrivacyFeatureProviderImpl.java40 private final DevicePolicyManager mDpm; field in EnterprisePrivacyFeatureProviderImpl
46 mDpm = dpm; in EnterprisePrivacyFeatureProviderImpl()
52 long timestamp = mDpm.getLastSecurityLogRetrievalTime(); in getLastSecurityLogRetrievalTime()
58 long timestamp = mDpm.getLastBugReportRequestTime(); in getLastBugReportRequestTime()
64 long timestamp = mDpm.getLastNetworkLogRetrievalTime(); in getLastNetworkLogRetrievalTime()
70 if (!mDpm.isCurrentInputMethodSetByOwner()) { in getImeLabelIfOwnerSet()
89 ComponentName owner = mDpm.getDeviceOwnerComponentOnCallingUser(); in getMaximumFailedPasswordsBeforeWipeInCurrentUser()
91 owner = mDpm.getProfileOwnerAsUser(MY_USER_ID); in getMaximumFailedPasswordsBeforeWipeInCurrentUser()
96 return mDpm.getMaximumFailedPasswordsForWipe(owner, MY_USER_ID); in getMaximumFailedPasswordsBeforeWipeInCurrentUser()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/profiles/
DProfileDetailsEndSessionPreferenceControllerTest.java62 private DevicePolicyManager mDpm; field in ProfileDetailsEndSessionPreferenceControllerTest
104 when(mContext.getSystemService(DevicePolicyManager.class)).thenReturn(mDpm); in getAvailabilityStatus_logoutDisabled_unsupportedOnDevice()
105 when(mDpm.isLogoutEnabled()).thenReturn(false); in getAvailabilityStatus_logoutDisabled_unsupportedOnDevice()
106 when(mDpm.getLogoutUser()).thenReturn(mUserHandle); in getAvailabilityStatus_logoutDisabled_unsupportedOnDevice()
114 when(mContext.getSystemService(DevicePolicyManager.class)).thenReturn(mDpm); in getAvailabilityStatus_noLogoutUser_unsupportedOnDevice()
115 when(mDpm.isLogoutEnabled()).thenReturn(true); in getAvailabilityStatus_noLogoutUser_unsupportedOnDevice()
116 when(mDpm.getLogoutUser()).thenReturn(null); in getAvailabilityStatus_noLogoutUser_unsupportedOnDevice()
124 when(mContext.getSystemService(DevicePolicyManager.class)).thenReturn(mDpm); in getAvailabilityStatus_logoutEnabled_hasLogoutUser_available()
125 when(mDpm.isLogoutEnabled()).thenReturn(true); in getAvailabilityStatus_logoutEnabled_hasLogoutUser_available()
126 when(mDpm.getLogoutUser()).thenReturn(mUserHandle); in getAvailabilityStatus_logoutEnabled_hasLogoutUser_available()
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/sidebar/
DUserItemsCombinerTest.java73 private final DevicePolicyManager mDpm = field in UserItemsCombinerTest
86 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_empty()
94 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsPersonal_personalItemsOnly()
105 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsWork_personalItemsOnly()
117 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsPersonal_workItemsOnly()
128 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsWork_workItemsOnly()
140 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsPersonal_personalAndWorkItems()
158 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsWork_personalAndWorkItems()
178 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsPersonal_personalAndWorkItems_cannotShare()
191 mCombiner = new UserItemsCombiner(mResources, mDpm, mState) in testCreatePresentableList_currentIsWork_personalItemsOnly_cannotShare()
/packages/apps/Car/Settings/src/com/android/car/settings/enterprise/
DDeviceAdminAddWarningPreferenceController.java46 boolean isProfileOwner = admin.equals(mDpm.getProfileOwner()); in updateState()
47 if (isProfileOwner || admin.equals(mDpm.getDeviceOwnerComponentOnCallingUser())) { in updateState()
61 int resId = mDpm.isAdminActive(admin) ? R.string.device_admin_status in updateState()
75 return mDpm.isDeviceManaged() && mDpm.getDeviceOwnerType(mDpm in isFinancedDevice()
DDeviceAdminAddFragment.java63 private DevicePolicyManager mDpm; field in DeviceAdminAddFragment
71 mDpm = dpm; in setDevicePolicyManager()
156 if (mDpm.isAdminActive(admin)) { in onAttach()
157 if (mDpm.isRemovingAdmin(admin, myUserHandle().getIdentifier())) { in onAttach()
165 if (!mDpm.hasGrantedPolicy(admin, pi.ident)) { in onAttach()
178 mDpm.setActiveAdmin(admin, refreshing); in onAttach()
234 mIsActive = mDpm.isAdminActive(mAdminComponentToUninstall); in startUninstall()
237 mDpm.removeActiveAdmin(mAdminComponentToUninstall); in startUninstall()
261 mDpm.setActiveAdmin(mAdminComponentToUninstall, /* refreshing= */ false); in onActivityResult()
320 if (mDpm.isAdminActive(who)) { in isValidAdmin()
DBaseEnterprisePreferenceController.java45 protected final DevicePolicyManager mDpm; field in BaseEnterprisePreferenceController
58 mDpm = context.getSystemService(DevicePolicyManager.class); in BaseEnterprisePreferenceController()
74 return admin.equals(mDpm.getProfileOwner()) in isProfileOrDeviceOwner()
75 || admin.equals(mDpm.getDeviceOwnerComponentOnCallingUser()); in isProfileOrDeviceOwner()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/
DKitchenSinkShellCommand.java55 private final @Nullable DevicePolicyManager mDpm; field in KitchenSinkShellCommand
66 mDpm = context.getSystemService(DevicePolicyManager.class); in KitchenSinkShellCommand()
135 List<String> scopes = mDpm.getDelegatedScopes(/* admin= */ null, mContext.getPackageName()); in getDelegatedScopes()
143 boolean isIt = mDpm.isUninstallBlocked(/* admin= */ null, packageName); in isUninstallBlocked()
154 mDpm.setUninstallBlocked(/* admin= */ null, packageName, blocked); in setUninstallBlocked()
172 AttestedKeyPair kp = mDpm.generateKeyPair(/* admin= */ null, algorithm, keySpec, flags); in handleDeviceAttestationKeyPair()
193 if (mDpm == null) { in supportDevicePolicyManagement()
/packages/apps/Car/Settings/src/com/android/car/settings/profiles/
DProfileDetailsEndSessionPreferenceController.java40 private final DevicePolicyManager mDpm; field in ProfileDetailsEndSessionPreferenceController
48 mDpm = context.getSystemService(DevicePolicyManager.class); in ProfileDetailsEndSessionPreferenceController()
74 if (mDpm == null) { in getAvailabilityStatus()
78 boolean isLogoutEnabled = mDpm.isLogoutEnabled(); in getAvailabilityStatus()
79 mLogoutUser = mDpm.getLogoutUser(); in getAvailabilityStatus()
/packages/modules/Connectivity/framework-t/src/android/net/
DNetworkStatsAccess.java111 final DevicePolicyManager mDpm = context.getSystemService(DevicePolicyManager.class); in checkAccessLevel() local
124 final boolean isDeviceOwner = mDpm != null && mDpm.isDeviceOwnerApp(callingPackage); in checkAccessLevel()
145 boolean isProfileOwner = mDpm != null && (mDpm.isProfileOwnerApp(callingPackage) in checkAccessLevel()
146 || mDpm.isDeviceOwnerApp(callingPackage)); in checkAccessLevel()
/packages/apps/Settings/tests/robotests/src/com/android/settings/users/
DUserCapabilitiesTest.java47 private ShadowDevicePolicyManager mDpm; field in UserCapabilitiesTest
53 mDpm = ShadowDevicePolicyManager.getShadow(); in setUp()
107 mDpm.setDeviceOwner(null); in restrictedProfile_enabled()
116 mDpm.setDeviceOwner(null); in restrictedProfile_configNotSet()
125 mDpm.setDeviceOwner(new ComponentName("test", "test")); in restrictedProfile_deviceIsManaged()
134 mDpm.setDeviceOwner(null); in restrictedProfile_typeNotEnabled()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/device/apps/
DUninstallPreference.java38 private final DevicePolicyManager mDpm; field in UninstallPreference
45 mDpm = context.getSystemService(DevicePolicyManager.class); in UninstallPreference()
130 return (mDpm != null && mDpm.packageHasActiveAdmins(mEntry.info.packageName)); in isActiveDeviceAdmin()
143 if (mDpm.packageHasActiveAdmins(packageName)) { in getUninstallDeviceAdminIntent()
/packages/apps/Settings/src/com/android/settings/accounts/
DAccountPreferenceController.java97 private DevicePolicyManager mDpm; field in AccountPreferenceController
159 mDpm = context.getSystemService(DevicePolicyManager.class); in AccountPreferenceController()
202 data.title = mDpm.getResources().getString( in updateDynamicRawDataToIndex()
210 data.title = mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE, in updateDynamicRawDataToIndex()
270 .setTitleText(mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE, in onPreferenceClick()
353 mDpm.getResources().getString(WORK_CATEGORY_HEADER, in updateProfileUi()
358 mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_WORK, () -> in updateProfileUi()
369 mDpm.getResources().getString(PERSONAL_CATEGORY_HEADER, in updateProfileUi()
372 mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_PERSONAL, () -> in updateProfileUi()
407 mDpm.getResources().getString(REMOVE_WORK_PROFILE, in newRemoveWorkProfilePreference()
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/enterprise/
DEnterprisePolicyGuard.java46 final private DevicePolicyManager mDpm; field in EnterprisePolicyGuard
50 mDpm = context.getSystemService(DevicePolicyManager.class); in EnterprisePolicyGuard()
70 final boolean isCallerIdEnabled = !mDpm.getCrossProfileCallerIdDisabled(currentHandle); in isCrossProfileAllowed()
72 !mDpm.getCrossProfileContactsSearchDisabled(currentHandle); in isCrossProfileAllowed()
74 !mDpm.getBluetoothContactSharingDisabled(currentHandle); in isCrossProfileAllowed()
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/
DAppButtonsPreferenceControllerTest.java114 private DevicePolicyManager mDpm; field in AppButtonsPreferenceControllerTest
135 doReturn(mDpm).when(mSettingsActivity).getSystemService(Context.DEVICE_POLICY_SERVICE); in setUp()
272 doReturn(true).when(mDpm).packageHasActiveAdmins(anyString()); in updateUninstallButton_isDeviceAdminApp_setButtonDisable()
283 doReturn(true).when(mDpm).isDeviceOwnerAppOnAnyUser(anyString()); in updateUninstallButton_isSystemAndIsProfileOrDeviceOwner_setButtonDisable()
293 doReturn(false).when(mDpm).isDeviceOwnerAppOnAnyUser(anyString()); in updateUninstallButton_isSystemAndIsNotProfileOrDeviceOwner_setButtonEnabled()
303 doReturn(0).when(mDpm).getDeviceOwnerUserId(); in updateUninstallButton_isNotSystemAndIsProfileOrDeviceOwner_setButtonDisable()
304 doReturn(true).when(mDpm).isDeviceOwnerApp(anyString()); in updateUninstallButton_isNotSystemAndIsProfileOrDeviceOwner_setButtonDisable()
314 doReturn(10).when(mDpm).getDeviceOwnerUserId(); in updateUninstallButton_isNotSystemAndIsNotProfileOrDeviceOwner_setButtonEnabled()
315 doReturn(false).when(mDpm).isDeviceOwnerApp(anyString()); in updateUninstallButton_isNotSystemAndIsNotProfileOrDeviceOwner_setButtonEnabled()
324 doReturn(true).when(mDpm).isDeviceOwnerAppOnAnyUser(anyString()); in updateUninstallButton_isDeviceProvisioningApp_setButtonDisable()
[all …]
/packages/apps/Settings/tests/unit/src/com/android/settings/biometrics/
DParentalControlsUtilsTest.java57 private DevicePolicyManager mDpm; field in ParentalControlsUtilsTest
74 when(mDpm.getProfileOwnerOrDeviceOwnerSupervisionComponent(any(UserHandle.class))) in getEnforcedAdminForCombination()
76 when(mDpm.getKeyguardDisabledFeatures(eq(supervisionComponentName))) in getEnforcedAdminForCombination()
79 return ParentalControlsUtils.parentConsentRequiredInternal(mDpm, modality, in getEnforcedAdminForCombination()
/packages/apps/TvSettings/SettingsAPI/java/com/android/tv/settings/library/device/apps/
DUninstallPreferenceController.java37 private final DevicePolicyManager mDpm; field in UninstallPreferenceController
45 mDpm = context.getSystemService(DevicePolicyManager.class); in UninstallPreferenceController()
99 return (mDpm != null && mDpm.packageHasActiveAdmins(mAppEntry.info.packageName)); in isActiveDeviceAdmin()
/packages/apps/Settings/tests/robotests/src/com/android/settings/inputmethod/
DVirtualKeyboardPreferenceControllerTest.java58 private DevicePolicyManager mDpm; field in VirtualKeyboardPreferenceControllerTest
69 when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn(mDpm); in setUp()
99 when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null); in updateState_singleIme_setImeLabelToSummary()
122 when(mDpm.getPermittedInputMethodsForCurrentUser()).thenReturn(null); in updateState_multiImeWithMixedLocale_setImeLabelToSummary()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/qc/
DBaseSettingsQCItemTestCase.java40 protected DevicePolicyManager mDpm; field in BaseSettingsQCItemTestCase
46 when(mContext.getSystemService(DevicePolicyManager.class)).thenReturn(mDpm); in baseSetUp()
50 when(mDpm.isDeviceManaged()).thenReturn(false); in baseSetUp()
/packages/apps/Settings/src/com/android/settings/notification/
DShowOnLockScreenNotificationPreferenceController.java46 private DevicePolicyManager mDpm; field in ShowOnLockScreenNotificationPreferenceController
51 mDpm = context.getSystemService(DevicePolicyManager.class); in ShowOnLockScreenNotificationPreferenceController()
56 mDpm = dpm; in setDpm()
149 final int dpmFlags = mDpm.getKeyguardDisabledFeatures(null/* admin */); in adminAllowsNotifications()
DNotificationAccessSettings.java86 private DevicePolicyManager mDpm; field in NotificationAccessSettings
97 mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
117 mDpm.getResources().getString(WORK_APPS_CANNOT_ACCESS_NOTIFICATION_SETTINGS, in onCreate()
176 && !mDpm.isNotificationListenerServicePermitted( in updateList()
178 pref.setSummary(mDpm.getResources().getString( in updateList()

123