Home
last modified time | relevance | path

Searched refs:UserManager (Results 1 – 25 of 305) sorted by relevance

12345678910>>...13

/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DUserRestrictionsUtilsTest.java24 import android.os.UserManager;
89 assertFalse(UserRestrictionsUtils.canDeviceOwnerChange(UserManager.DISALLOW_RECORD_AUDIO)); in testCanDeviceOwnerChange()
90 assertFalse(UserRestrictionsUtils.canDeviceOwnerChange(UserManager.DISALLOW_WALLPAPER)); in testCanDeviceOwnerChange()
91 assertTrue(UserRestrictionsUtils.canDeviceOwnerChange(UserManager.DISALLOW_ADD_USER)); in testCanDeviceOwnerChange()
92 assertTrue(UserRestrictionsUtils.canDeviceOwnerChange(UserManager.DISALLOW_USER_SWITCH)); in testCanDeviceOwnerChange()
98 UserManager.DISALLOW_RECORD_AUDIO, user)); in testCanProfileOwnerChange()
100 UserManager.DISALLOW_WALLPAPER, user)); in testCanProfileOwnerChange()
102 UserManager.DISALLOW_USER_SWITCH, user)); in testCanProfileOwnerChange()
104 UserManager.DISALLOW_ADD_USER, user)); in testCanProfileOwnerChange()
106 UserManager.DISALLOW_ADJUST_VOLUME, user)); in testCanProfileOwnerChange()
[all …]
DUserManagerTest.java28 import android.os.UserManager;
62 private UserManager mUserManager = null;
69 mUserManager = UserManager.get(getContext()); in setUp()
137 restrictions.getBoolean(UserManager.DISALLOW_CONFIG_WIFI)); in testAddUser()
213 assertTrue(mUserManager.hasUserRestriction(UserManager.DISALLOW_SMS, in testSetUserAdmin()
215 assertTrue(mUserManager.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, in testSetUserAdmin()
226 assertFalse(mUserManager.hasUserRestriction(UserManager.DISALLOW_SMS, in testSetUserAdmin()
228 assertFalse(mUserManager.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, in testSetUserAdmin()
310 mUserManager.setUserRestriction(UserManager.DISALLOW_ADD_USER, true, primaryUserHandle); in testCreateUser_disallowAddUser()
315 mUserManager.setUserRestriction(UserManager.DISALLOW_ADD_USER, false, in testCreateUser_disallowAddUser()
[all …]
DUserManagerServiceTest.java24 import android.os.UserManager;
50 UserManager.get(mContext).removeUser(tempUserId); in tearDown()
68 UserManager um = UserManager.get(mContext); in testAddUserWithAccount()
/frameworks/base/services/core/java/com/android/server/pm/
DUserRestrictionsUtils.java35 import android.os.UserManager;
77 UserManager.DISALLOW_CONFIG_WIFI,
78 UserManager.DISALLOW_CONFIG_LOCALE,
79 UserManager.DISALLOW_MODIFY_ACCOUNTS,
80 UserManager.DISALLOW_INSTALL_APPS,
81 UserManager.DISALLOW_UNINSTALL_APPS,
82 UserManager.DISALLOW_SHARE_LOCATION,
83 UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
84 UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
85 UserManager.DISALLOW_CONFIG_BLUETOOTH,
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/
DDevicePolicyManagerServiceMigrationTest.java29 import android.os.UserManager;
86 UserManager.DISALLOW_ADD_USER, in testMigration()
87 UserManager.DISALLOW_RECORD_AUDIO)); in testMigration()
91 UserManager.DISALLOW_REMOVE_USER, in testMigration()
92 UserManager.DISALLOW_ADD_USER, in testMigration()
93 UserManager.DISALLOW_SMS, in testMigration()
94 UserManager.DISALLOW_OUTGOING_CALLS, in testMigration()
95 UserManager.DISALLOW_WALLPAPER, in testMigration()
96 UserManager.DISALLOW_RECORD_AUDIO)); in testMigration()
100 UserManager.DISALLOW_REMOVE_USER, in testMigration()
[all …]
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/
DTetherUtilTest.java28 import android.os.UserManager;
49 private UserManager mUserManager;
124 List<UserManager.EnforcingUser> enforcingUsers = new ArrayList<>(); in setupIsTetherAvailable()
128 enforcingUsers.add(new UserManager.EnforcingUser(userId, in setupIsTetherAvailable()
129 UserManager.RESTRICTION_SOURCE_DEVICE_OWNER)); in setupIsTetherAvailable()
130 enforcingUsers.add(new UserManager.EnforcingUser(userId, in setupIsTetherAvailable()
131 UserManager.RESTRICTION_SOURCE_PROFILE_OWNER)); in setupIsTetherAvailable()
134 UserManager.DISALLOW_CONFIG_TETHERING, UserHandle.of(userId))) in setupIsTetherAvailable()
139 UserManager.DISALLOW_CONFIG_TETHERING, UserHandle.of(userId))) in setupIsTetherAvailable()
DRestrictedLockUtilsTest.java42 import android.os.UserManager;
64 private UserManager mUserManager;
91 UserManager.EnforcingUser enforcingUser = new UserManager.EnforcingUser(mUserId, in checkIfRestrictionEnforced_deviceOwner()
92 UserManager.RESTRICTION_SOURCE_DEVICE_OWNER); in checkIfRestrictionEnforced_deviceOwner()
93 final String userRestriction = UserManager.DISALLOW_UNINSTALL_APPS; in checkIfRestrictionEnforced_deviceOwner()
109 UserManager.EnforcingUser enforcingUser = new UserManager.EnforcingUser(mUserId, in checkIfRestrictionEnforced_profileOwner()
110 UserManager.RESTRICTION_SOURCE_PROFILE_OWNER); in checkIfRestrictionEnforced_profileOwner()
111 final String userRestriction = UserManager.DISALLOW_UNINSTALL_APPS; in checkIfRestrictionEnforced_profileOwner()
/frameworks/base/core/java/com/android/internal/app/
DConfirmUserCreationActivity.java30 import android.os.UserManager;
50 private UserManager mUserManager;
57 mUserName = intent.getStringExtra(UserManager.EXTRA_USER_NAME); in onCreate()
58 mAccountName = intent.getStringExtra(UserManager.EXTRA_USER_ACCOUNT_NAME); in onCreate()
59 mAccountType = intent.getStringExtra(UserManager.EXTRA_USER_ACCOUNT_TYPE); in onCreate()
61 intent.getParcelableExtra(UserManager.EXTRA_USER_ACCOUNT_OPTIONS); in onCreate()
63 mUserManager = getSystemService(UserManager.class); in onCreate()
99 boolean cantCreateUser = mUserManager.hasUserRestriction(UserManager.DISALLOW_ADD_USER) in checkUserCreationRequirements()
111 setResult(UserManager.USER_CREATION_FAILED_NOT_PERMITTED); in checkUserCreationRequirements()
114 setResult(UserManager.USER_CREATION_FAILED_NO_MORE_USERS); in checkUserCreationRequirements()
/frameworks/base/packages/SettingsProvider/test/src/com/android/providers/settings/
DInstallNonMarketAppsDeprecationTest.java27 import android.os.UserManager;
51 private UserManager mUm;
89 mUm = (UserManager) getContext().getSystemService(Context.USER_SERVICE); in setUp()
90 mHasUserRestriction = mUm.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES); in setUp()
92 UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, Process.myUserHandle()) in setUp()
93 == UserManager.RESTRICTION_SOURCE_SYSTEM; in setUp()
135 mUm.setUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, !mHasUserRestriction); in testValueRespectsUserRestriction()
141 mUm.setUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, mHasUserRestriction); in testValueRespectsUserRestriction()
152 mUm.setUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, in tearDown()
/frameworks/base/services/core/java/com/android/server/oemlock/
DPersistentDataBlockLock.java22 import android.os.UserManager;
56 UserManager.get(mContext).setUserRestriction( in setOemUnlockAllowedByCarrier()
57 UserManager.DISALLOW_OEM_UNLOCK, !allowed, UserHandle.SYSTEM); in setOemUnlockAllowedByCarrier()
66 return !UserManager.get(mContext) in isOemUnlockAllowedByCarrier()
67 .hasUserRestriction(UserManager.DISALLOW_OEM_UNLOCK, UserHandle.SYSTEM); in isOemUnlockAllowedByCarrier()
DOemLockService.java30 import android.os.UserManager;
97 UserManager.DISALLOW_FACTORY_RESET)) {
99 !newRestrictions.getBoolean(UserManager.DISALLOW_FACTORY_RESET);
243 return !UserManager.get(mContext) in isOemUnlockAllowedByAdmin()
244 .hasUserRestriction(UserManager.DISALLOW_FACTORY_RESET, UserHandle.SYSTEM); in isOemUnlockAllowedByAdmin()
273 if (!UserManager.get(mContext).isUserAdmin(userId)) { in enforceUserIsAdmin()
/frameworks/base/services/core/java/com/android/server/policy/
DRestartAction.java19 import android.os.UserManager;
38 UserManager um = mContext.getSystemService(UserManager.class); in onLongPress()
39 if (!um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { in onLongPress()
DPowerAction.java19 import android.os.UserManager;
38 UserManager um = mContext.getSystemService(UserManager.class); in onLongPress()
39 if (!um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { in onLongPress()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/development/
DDevelopmentSettingsEnabler.java22 import android.os.UserManager;
43 final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); in isDevelopmentSettingsEnabled()
48 UserManager.DISALLOW_DEBUGGING_FEATURES); in isDevelopmentSettingsEnabled()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DMultiUserSwitch.java21 import android.os.UserManager;
51 final UserManager mUserManager;
59 mUserManager = UserManager.get(getContext()); in MultiUserSwitch()
108 || !UserManager.supportsMultipleUsers() in isMultiUserEnabled()
109 || UserManager.isDeviceInDemoMode(mContext) in isMultiUserEnabled()
110 || mUserManager.hasUserRestriction(UserManager.DISALLOW_USER_SWITCH)) { in isMultiUserEnabled()
118 || (guestEnabled && !mUserManager.hasUserRestriction(UserManager.DISALLOW_ADD_USER)) in isMultiUserEnabled()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/
DSimStatusImeiInfoPreferenceControllerTest.java24 import android.os.UserManager;
57 extract(RuntimeEnvironment.application.getSystemService(UserManager.class)); in testIsAvailable_isAdminAndHasMobile_shouldReturnTrue()
69 extract(RuntimeEnvironment.application.getSystemService(UserManager.class)); in testIsAvailable_isAdminButNoMobile_shouldReturnFalse()
81 extract(RuntimeEnvironment.application.getSystemService(UserManager.class)); in testIsAvailable_isNotAdmin_shouldReturnFalse()
87 @Implements(UserManager.class)
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/testutils/shadow/
DShadowUserManager.java22 import android.os.UserManager;
30 @Implements(value = UserManager.class)
35 protected static UserManager get(Context context) { in get()
36 return (UserManager) context.getSystemService(Context.USER_SERVICE); in get()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/
DRestrictedLockUtilsInternal.java36 import android.os.UserManager;
94 final UserManager um = UserManager.get(context); in checkIfRestrictionEnforced()
95 final List<UserManager.EnforcingUser> enforcingUsers = in checkIfRestrictionEnforced()
107 if (restrictionSource == UserManager.RESTRICTION_SOURCE_PROFILE_OWNER) { in checkIfRestrictionEnforced()
119 } else if (restrictionSource == UserManager.RESTRICTION_SOURCE_DEVICE_OWNER) { in checkIfRestrictionEnforced()
133 final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); in hasBaseUserRestriction()
161 if (UserManager.get(context).getUserInfo(userId).isManagedProfile()) { in checkIfKeyguardFeaturesDisabled()
218 UserManager.DISALLOW_APPS_CONTROL, userId); in checkIfUninstallBlocked()
223 UserManager.DISALLOW_UNINSTALL_APPS, userId); in checkIfUninstallBlocked()
343 UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); in getManagedProfileId()
[all …]
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/television/
DUninstallAlertFragment.java24 import android.os.UserManager;
62 UserManager userManager = UserManager.get(getActivity()); in onCreateGuidance()
116 private boolean isSingleUser(UserManager userManager) { in isSingleUser()
119 || (UserManager.isSplitSystemUser() && userCount == 2); in isSingleUser()
/frameworks/base/core/tests/packagemanagertests/src/android/content/pm/
DKernelPackageMappingTests.java24 import android.os.UserManager;
57 private UserManager getUserManager() { in getUserManager()
58 UserManager um = (UserManager) InstrumentationRegistry.getContext().getSystemService( in getUserManager()
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/handheld/
DUninstallAlertDialogFragment.java36 import android.os.UserManager;
102 UserManager userManager = getContext().getSystemService(UserManager.class); in getAppDataSize()
142 UserManager userManager = UserManager.get(getActivity()); in onCreateDialog()
222 private boolean isSingleUser(UserManager userManager) { in isSingleUser()
225 || (UserManager.isSplitSystemUser() && userCount == 2); in isSingleUser()
/frameworks/base/core/java/android/util/
DIconDrawableFactory.java27 import android.os.UserManager;
40 protected final UserManager mUm;
47 mUm = context.getSystemService(UserManager.class); in IconDrawableFactory()
104 public static int getUserBadgeColor(UserManager um, @UserIdInt int userId) { in getUserBadgeColor()
/frameworks/base/packages/PackageInstaller/src/com/android/packageinstaller/
DPackageInstallerActivity.java46 import android.os.UserManager;
89 UserManager mUserManager;
296 mUserManager = (UserManager) getSystemService(Context.USER_SERVICE); in onCreate()
417 UserManager.DISALLOW_INSTALL_APPS, Process.myUserHandle()); in checkIfAllowedAndInitiateInstall()
418 if ((installAppsRestrictionSource & UserManager.RESTRICTION_SOURCE_SYSTEM) != 0) { in checkIfAllowedAndInitiateInstall()
421 } else if (installAppsRestrictionSource != UserManager.RESTRICTION_NOT_SET) { in checkIfAllowedAndInitiateInstall()
432 UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, Process.myUserHandle()); in checkIfAllowedAndInitiateInstall()
434 UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY, Process.myUserHandle()); in checkIfAllowedAndInitiateInstall()
435 final int systemRestriction = UserManager.RESTRICTION_SOURCE_SYSTEM in checkIfAllowedAndInitiateInstall()
439 } else if (unknownSourcesRestrictionSource != UserManager.RESTRICTION_NOT_SET) { in checkIfAllowedAndInitiateInstall()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/
DMockLockSettingsContext.java26 import android.os.UserManager;
31 private UserManager mUserManager;
38 public MockLockSettingsContext(Context base, UserManager userManager, in MockLockSettingsContext()
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/storage/
DCleanupManager.java22 import android.os.UserManager;
39 private final UserManager mUserManager;
60 UserManager.get(context), in getInstance()
69 UserManager userManager, in CleanupManager()

12345678910>>...13