History log of /frameworks/base/core/java/android/os/UserManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d86b8fea43ebb6e5c31691b44d8ceb0d8d3c9072 03-Jun-2017 Jeff Sharkey <jsharkey@android.com> Annotate @SystemApi with required permissions.

Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
/frameworks/base/core/java/android/os/UserManager.java
ada8deb43649aed879ceba28daee4af69ae0cc8d 12-May-2017 Adam Lesinski <adamlesinski@google.com> OMS: Setup state for users on boot and when added

Some users never get switched to (managed profile/work profile) so the
overlay state for a user would never be setup (but they could still show
UI and apps).

This change ensures that user state is setup after an OTA to android O,
and whenever a user is added.

Bug: 37899201
Test: manual (add user via Device Admin sample: vendor/google/tools/DeviceAdminSample)
Change-Id: If214e26e39b18c2861794baf5c608a47d536e5ff
/frameworks/base/core/java/android/os/UserManager.java
605b12a6d0110c81d63e78e93f299a6b5753da46 11-May-2017 Fyodor Kupolov <fkupolov@google.com> Added isUserNameSet

It can be used to check that the value returned by getUserName() was set
by the user and is not a default value returned by the system.

Test: UserManagerServiceUserInfoTest pass
Bug: 38138381
Change-Id: I0ca37970fda548508190bffd1fa7be95d4a15076
/frameworks/base/core/java/android/os/UserManager.java
4f4f6f83c20162814e95e9ca0654eee89a818bde 28-Mar-2017 Pavel Grafov <pgrafov@google.com> Introduce DISALLOW_BLUETOOTH_SHARING.

When this restriction is enforced Bluetooth sharing option should not be
present when the user tries to share something. Previously this was handled
by explicitly disabling bluetooth sharing activity during managed
provisioning, now this code is to be removed (see topic CLs) and the same
behavior should be achieved by setting this restriction for profile owners
by default.

In Bluetooth:
1) Don't check restrictions on boot, it is invoked anyway through the
listener during boot.
2) Ignore when the restriction is "changed" from true to true - i think
it was the initial intent in that condition.
3) Disable the component for a particular user and not always the
system user. This is something that has to be fixed in O I think since
currently in secondary user the bluetooth itself gets disabled but the
sharing thing still shows up.

In DPMS:
1) Now ActiveAdmin for PO also contains a set of restrictions applied by
default.
2) Now all ActiveAdmins for POs are loaded quite early. That shouldn't
have huge impact though.

Bug: 36249732
Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest#testBluetoothSharingRestriction
Test: run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Change-Id: I78c4ffbd503c4a10138e8c0862a9f206f24c5631
Merged-in: I78c4ffbd503c4a10138e8c0862a9f206f24c5631
(cherry picked from commit 7f4ad75218bdd3f1bdf9022a146147eae032cc0c)
/frameworks/base/core/java/android/os/UserManager.java
ce3e1a3c5fb881ebdea6ba219dae68c9b63ba108 21-Apr-2017 Pavel Grafov <pgrafov@google.com> Fix javadoc for some user restrictions.

DISALLOW_UNMUTE_MICROPHONE and DISALLOW_ADJUST_VOLUME can
be set by POs on secondary users as well. But they have no
effect on managed profiles.

(In the bug I erroneously mentionted DISALLOW_UNMUTE_DEVICE
which is @hidden instead of *_MICROPHONE).

Bug: 36024135
Test: IntelliJ quickdoc popup renders correctly.
Change-Id: I7a0e77ac993846cdc3a4ddf4d457e1282872107f
/frameworks/base/core/java/android/os/UserManager.java
3b8b46f3a46ccf35a6bb6a828af0f2d011cc9abe 13-Feb-2017 Andrew Scull <ascull@google.com> Service for OEM lock management.

The new service separates OEM lock management from the implementation.
Currently, a user restriction (DISALLOW_OEM_UNLOCK) and the persistent
data block have been used to implement OEM lock management. In future,
other implemention will be used e.g. a secure element.

The new API also allows for a signature to be passed when changing
whether the device is allowed to be OEM unlocked by the carrier which
can be used for cryptographic protection of the flag.

Bug: 34766843
Test: gts-tradefed run gts -m GtsOemLockServiceTestCases -t com.google.android.oemlock.gts.OemLockServiceTest
Test: cts-tradefed run cts -m CtsPermission2TestCases -t android.permission2.cts.PrivappPermissionsTest
Change-Id: I01660d7605d297f273d43436ca03d64ff611b6cf
/frameworks/base/core/java/android/os/UserManager.java
9f592dbca32c698cabcf38a5e07cbb118fbf44dd 16-Mar-2017 Rubin Xu <rubinxu@google.com> Update ENSURE_VERIFY_APPS javadoc

Make it clear that now this restriction applies across the whole device,
and is settable by profile owner.

Bug: 31000521
Test: None; just javadoc update
Change-Id: If82d8f4167cf1b77d6e10554f1d96b2d3a2a54a0
/frameworks/base/core/java/android/os/UserManager.java
24d5893b25ce62b7bc9ed9f35fa72b9d47f23cdd 21-Mar-2017 Felipe Leme <felipeal@google.com> Added a UserManager.DISALLOW_AUTOFILL restriction.

bug: 35710740

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testUserRestriction
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDisallowAutofill_allowed
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedProfileOwnerTest#testDisallowAutofill_allowed
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDisallowAutofill_allowed

Change-Id: I41b2bf9fe3bc8df627c6650960bd11346c430a7e
/frameworks/base/core/java/android/os/UserManager.java
e72f81b64d356149c81104ecbdeca1abea31da85 16-Mar-2017 Makoto Onuki <omakoto@google.com> Send broadcast when user restrictions change.

- Send UserManager.ACTION_USER_RESTRICTIONS_CHANGED, which is a runtime receiver
only broadcast.

Bug 36355208

Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.UserRestrictionsTest#testUserRestrictions_deviceOwnerOnly'
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.UserRestrictionsTest#testUserRestrictions_primaryProfileOwnerOnly'
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.UserRestrictionsTest#testUserRestrictions_secondaryProfileOwnerOnly'
Change-Id: Ifd82e39ce2c08ed5accdf017f4a1ea3af6face63
/frameworks/base/core/java/android/os/UserManager.java
5eef50d86bbef65178873303cc03e9ff492c9ba2 03-Mar-2017 Makoto Onuki <omakoto@google.com> Mention the relaxed security check on UM.isUserRunningOrStopping().

Bug: 35801468
Test: Javadoc only, make.
Change-Id: Iff44217b63e6ce8d354665719a84c37f8c2e569a
/frameworks/base/core/java/android/os/UserManager.java
bb4988ad7dfcdada41c04328f2e1ccdeaab529e8 24-Feb-2017 Jeff Sharkey <jsharkey@android.com> Improve service docs around user unlocking.

Also delete some @removed methods that never shipped to reduce
confusion.

Test: builds, boots
Bug: 30434803
Change-Id: I18773182f62f0f62bd4e36c9c3098372483a374f
/frameworks/base/core/java/android/os/UserManager.java
33a119c94fbef9a185b82204fc58292e08c3d33d 13-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix typo on DISALLOW_UNMUTE_DEVICE"
324deac37bec24bd53ae7eaf893c0499d98d6f56 13-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Specify limitations of DISALLOW_UNINSTALL_APPS in documentation"
492b4724fb42adf29f3978f01ebc5238f893d194 13-Feb-2017 Esteban Talavera <etalavera@google.com> Fix typo on DISALLOW_UNMUTE_DEVICE

Test: Builds sucessfully. Cannot find other usages in code search
Change-Id: I83f85b4715b11630b0ce0b471be536aef46a2936
/frameworks/base/core/java/android/os/UserManager.java
8bd7c52fb0724892da4804aa78458d6de24af4e1 13-Feb-2017 Esteban Talavera <etalavera@google.com> Specify limitations of DISALLOW_UNINSTALL_APPS in documentation

Bug: 24928722
Fix: 29871221
Bug: 31344846

Test: Builds successfully

Change-Id: I870c71d537da79b9dd50f81ba5394eb8afc8d839
/frameworks/base/core/java/android/os/UserManager.java
cdb3c2fd0420daa6d26a733df0ec8dcc79676402 10-Feb-2017 Fyodor Kupolov <fkupolov@google.com> Clarified requirements for cross-user calls

Test: make
Bug: 35199390
Change-Id: Ie997c690dd24439cc0e8d7fedfc58bd26b2c067f
/frameworks/base/core/java/android/os/UserManager.java
5cd907d3d6ceebf8731ef1f69347cce6f76109e9 26-Jan-2017 Wale Ogunwale <ogunwale@google.com> Alert Windows behavioral changes

- Introduced TYPE_APPLICATION_OVERLAY window type. Can be used by apps
to display windows on top of other app windows, but below critical
system windows.
- Deprecate alert window types TYPE_PHONE, TYPE_SYSTEM_ALERT,
TYPE_SYSTEM_OVERLAY, TYPE_PRIORITY_PHONE, and TYPE_SYSTEM_ERROR.
Apps should now use TYPE_APP_OVERLAY for this.
- Apps targetting O or greater are not allowed to add the old alert
window types.
Apps targetting less than O can still add the old types.
Apps with permission INTERNAL_SYSTEM_WINDOW (system signature apps) can
still add the old types.
- Z-order old alert windows types below TYPE_APPLICATION_OVERLAY if
they are added by an app without the INTERNAL_SYSTEM_WINDOW permission.

Test: android.server.cts.AlertWindowsTests
Bug: 33256752
Change-Id: I12170955a7a333151d3387c169b51c53c32164fc
/frameworks/base/core/java/android/os/UserManager.java
d49f3fa8062257d22537c31def79d29879b6e7cb 25-Jan-2017 Makoto Onuki <omakoto@google.com> Cache isManagedProfile().

LauncherApps wants to use it in the client side. Let's cache the
result.

Bug: 34340531
Test: manual tests with work profile
Change-Id: I594a9ca688867e7cb0b35ab389ccef66135ef9cd
/frameworks/base/core/java/android/os/UserManager.java
d37c4a99b2602dd4483ca2985e63b5316e8f4f63 23-Jan-2017 Nicolas Prevot <nprevot@google.com> Allow DO to provision even if it has set disallow remove mp.

If the device owner has set DISALLOW_REMOVE_MANAGED_PROFILE,
and there is already a managed profile:
it should be allowed to provision a new managed profile by
deleting the old one.
Test: adb shell am instrument -e class
com.android.server.devicepolicy.DevicePolicyManagerTest
-w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
BUG:34116228

Change-Id: I9e6f39924107aee40b57d22e638487a1ea3132de
/frameworks/base/core/java/android/os/UserManager.java
6a40f09083fc52acc3309d0b04401fca02df6372 25-Oct-2016 Pavel Grafov <pgrafov@google.com> Make ENSURE_VERIFY_APPS global even when set by PO.

Currently only device owner can set global user restrictions.
With this CL ENSURE_VERIFY_APPS will be global no matter who
enforces it, DO or PO.

To make it possible for system apps to check who enforces a
particular restriction in this case a new API method is added
to UserManager: getUserRestrictionSources which returns a list
of users who enforce the restriction.

Bug:31000521
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.UserRestrictionsTest (ag/1732744)
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserRestrictionsUtilsTest.java
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
Test: installed M on a Nexus5x device, created a managed profile with some user restrictions, and checked that after upgrading M->O all restrictions are preserved and split correctly into base, global and local.
Change-Id: I543d3ec9ef0cf2b730da6f7406021c0bba43b785
/frameworks/base/core/java/android/os/UserManager.java
54402aab14deb9f21b0a9b451f80113ab9821b04 10-Jan-2017 Andrew Scull <ascull@google.com> Merge "Evict CE key on request and when work mode is turned off."
2ea46fe658c5a977a11372d7180e8ed9abf261e8 05-Jan-2017 Nicolas Prevot <nprevot@google.com> Make disallow add/remove managed profile restriction not global.

Otherwise: if the DO sets remove managed profile user restriction:
the profile owner of a managed profile cannot remove this managed
profile.

BUG:33854430
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I90b2028ea627a2073298bf9ef3c07b4fdf8d13a1
/frameworks/base/core/java/android/os/UserManager.java
85a63bc1a06870b5a86926b0bce94a2bf559e3f0 24-Oct-2016 Andrew Scull <ascull@google.com> Evict CE key on request and when work mode is turned off.

DPMS.lockNow takes a flag which can request the managed profile CE key to
be evicted.

Test: com.android.cts.devicepolicy.ManagedProfileTest#testLockNowWithKeyEviction*
Bug: 31000719
Change-Id: I68f4d6eed4b041c39fd13375f7f284f5d6ac33da
/frameworks/base/core/java/android/os/UserManager.java
06fd71abdf4c76d5f4ec357146f61280fb5580fa 14-Dec-2016 Esteban Talavera <etalavera@google.com> Merge "Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions"
6c9116a6430ca5cd55b1b926213a5e8de77e4fc6 24-Nov-2016 Esteban Talavera <etalavera@google.com> Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions

Bug: 31952368

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services
Test: runtest -c com.android.server.pm.UserManagerTest frameworks-services
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.UserRestrictionsTest

Change-Id: I240ab99c2409bbabffbc574bef202f2457026905
/frameworks/base/core/java/android/os/UserManager.java
12b0496944381437a1e9974b0e79f56e766bbbdc 29-Nov-2016 Lenka Trochtova <ltrochtova@google.com> Make UserManager#DISALLOW_OEM_UNLOCK a system API.

This is needed for unbundling of OobConfig app.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testDisallowOemUnlock_canSetWithSystemApi
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testDisallowOemUnlock_doCannotSet

BUG: 32974379

Change-Id: I7710df96006821a5d0eddfe0b411dd3efa0e10f0
/frameworks/base/core/java/android/os/UserManager.java
63d5e4a7491b707235654cb081d2fc9074a5a65a 02-Dec-2016 Lenka Trochtova <ltrochtova@google.com> Introduce a new user restriction for disallowing Bluetooth.

Only the device owner will be able to set the restriction
and the restriction will prevent usage of Bluetooth on the
entire device - i.e. in all the users.

Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.UserRestrictionsTest
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testBluetoothRestriction

Bug: 32895300

Change-Id: I2875cf178cb16eca1965d0ba965d1cd3d8db2ad5
/frameworks/base/core/java/android/os/UserManager.java
2e7e09685a69cc6b9e3418065507c6c7f843b446 02-Dec-2016 Fyodor Kupolov <fkupolov@google.com> Switch isUserUnlocked/isUserRunning to use UMS.mUserStates

UserManager.isUserUnlocked/isUserRunning now returns state from
UMS.mUserStates that is pushed from ActivityManager.

Test: manual
Bug: 33232933
Bug: 28957340
Change-Id: Ic5f56d7d577bc336acd2bf44fab7f74feac4f7b3
/frameworks/base/core/java/android/os/UserManager.java
02c8990bd6125f05cb32561727d559dc9327a601 15-Nov-2016 Kenny Guy <kennyguy@google.com> Allow overriding max profile in debugable builds.

Support a system property on debugable builds to
override the max number of managed profiles to
allow easier dogfooding of multiple profiles.
Support 3 different badge colours for managed profiles.

Bug: 30473760
Test: runtest -c com.android.server.pm.UserManagerServiceCreateProfileTest frameworks-services
Test: runtest -c com.android.server.pm.UserManagerServiceUserInfoTest frameworks-services
Test: manual - attempting to create 2 profiles with adb fails, passes once I set the property.
Change-Id: Ie7fb19048a04a01572666f229283152254d0ffc3
/frameworks/base/core/java/android/os/UserManager.java
dc589ac82b5fe2063f4cfd94c8ae26d43d5420a0 11-Nov-2016 Sudheer Shanka <sudheersai@google.com> Update usage of ActivityManagerNative.

- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
/frameworks/base/core/java/android/os/UserManager.java
5200e1cb07190a1f6874d72a4561064cad3ee3e0 18-Oct-2016 Fyodor Kupolov <fkupolov@google.com> Use app context to avoid memory leaks

Bug: 31581886
Test: manual
Change-Id: I375ed953665e431cc8f15a2ceefacabd9055269c
/frameworks/base/core/java/android/os/UserManager.java
c413f7078d2a69badcb4a2326a4a3d55c25da020 07-Oct-2016 Fyodor Kupolov <fkupolov@google.com> Switch UM to internal isUserUnlockingOrUnlocked

Internal version of UMS maintains a self-locking data-structure of user
states that is pushed from ActivityManager. Previously there could
be discrepancies between UMS.isUserUnlockingOrUnlocked and
UM.isUserUnlockingOrUnlocked, which is calling a blocking version
in ActivityManager.

Test: manual + UserManagerTests

Bug: 31995235
Bug: 31833240
Change-Id: Ibafe403f57cd32d9052bb55fe7273a861be1d037
/frameworks/base/core/java/android/os/UserManager.java
6dc428f677f2b80b085466961e9495972e1c88c9 10-Oct-2016 Tony Mak <tonymak@google.com> Allow device owner to inflate managed profile

1. Modify DPM.isProvisioningAllowed to allow it to happen
2. Introduce hidden API createProfileForUserEvenWhenDisallowed for
ManagedProvisioning app to create profile under DO.
Apps with MANAGE_USERS permission can clear the
DISALLOW_ADD_USER restriction anyway, so they do not gain extra power.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.CustomDeviceOwnerTest#testIsProvisioningAllowed

Bug: 31895999

Change-Id: I10dc3043653130ae717a1d3d8256c9e73231bb21
/frameworks/base/core/java/android/os/UserManager.java
7cb54a34c44547b55200e4be15be397f6a363c55 16-Sep-2016 Sudheer Shanka <sudheersai@google.com> Allow some packages to be excluded during during work profile creation.

Bug: 31657192
Test: adb shell am instrument -e class com.android.server.pm.UserManagerTest#testAddManagedProfile_withDisallowedPackages -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I37eab6084e0f911d0e2407186b789875588194a2
/frameworks/base/core/java/android/os/UserManager.java
aa67f684ff43c81e3280c846245ec6ebe907787e 20-Sep-2016 John Reck <jreck@google.com> Fix a bunch of repeated reads of a ro.* property

SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
/frameworks/base/core/java/android/os/UserManager.java
50421f1a381a5f4ce06e3a3ea5d30c5606a1dedf 11-Aug-2016 Esteban Talavera <etalavera@google.com> Do not toggle OEM unlock if bootloader unlocked am: c48b20f8f1 am: 83583bd596
am: b9bef2fb7d

Change-Id: I87ffae46a63f1543b55e075cecffb1d2c2e1c160
c48b20f8f1d3e07e8a931b195669b0ab8895006c 11-Aug-2016 Esteban Talavera <etalavera@google.com> Do not toggle OEM unlock if bootloader unlocked

Bug: 30681215
Change-Id: Ia0fd55dd7b6b731d6f5733fc733621e99bd7b153
/frameworks/base/core/java/android/os/UserManager.java
13a58a91d362e74933b3064a65be4bf4449cfdc4 28-Jul-2016 Evan Rosky <erosky@google.com> Make user-switch transitions customizable

Make UserSwitcherController subclassable

Add ability for keyguard to animate in without a screen freeze
by adding a keyguardAnimatingIn state that WindowAnimator and
WallpaperController can use to prevent graphical glitches

Bug: 29329555
Change-Id: Idfd40156538b4bfb1777ad1a9a566e7da54e8f32
/frameworks/base/core/java/android/os/UserManager.java
fe84fe01d7415ea86e37824c0aff0d988089b6c2 25-Jul-2016 Tony Mak <tonymak@google.com> Persist master volume mute across reboot am: c1205111a9
am: c33b549af8

Change-Id: Id5e57ebdf81824af0f86854d8668a05f8109e0e1
c1205111a92b52283078f1a2e86c8d32c5928b92 22-Jul-2016 Tony Mak <tonymak@google.com> Persist master volume mute across reboot

Fix: 30133263

Change-Id: I53450a504e40e55516acc88550f369a74a244eaf
/frameworks/base/core/java/android/os/UserManager.java
4e9af0657615e52c0cd5eebe34a277e197876bc5 19-Jul-2016 Fyodor Kupolov <fkupolov@google.com> Updated JavaDoc for getApplicationRestrictions

The method performs disk I/O and shouldn't be called on the main thread.

Bug: 28303952
Change-Id: Iab4d79158b32858baac4147ab73c6ac7aaa51b5b
/frameworks/base/core/java/android/os/UserManager.java
e4ffde9cacfefb6d3e93ed07497d245c476cb1bc 13-Jul-2016 Mahaver Chopra <mahaver@google.com> Merge \\"Added UM.DISALLOW_OEM_UNLOCK, Removed Global.OEM_UNLOCK_DISALLOWED.\\" into nyc-mr1-dev am: 695a1c50a2
am: e64f60a455

Change-Id: Iedc9544179d3c3de8616375e51f7a60ddd1c8c3b
3d9805d50281882b4420ee2d4ede8a8bdd94d455 07-Jul-2016 Mahaver Chopra <mahaver@google.com> Added UM.DISALLOW_OEM_UNLOCK, Removed Global.OEM_UNLOCK_DISALLOWED.

Currently we used global setting to restrict user from enabling oem
unlock. As global settings can be chagned using adb, using user
restrictions instead.

Bug: 29893399
Change-Id: Ic83112a4838b8279bf50408a29ae205e0b8639ee
/frameworks/base/core/java/android/os/UserManager.java
96c0bc2eb93b51841d9a31a3df3960cbb7ef7155 29-Jun-2016 Amith Yamasani <yamasani@google.com> Merge \\"An API to check if running in a demo user\\" into nyc-mr1-dev am: b71081e4e9
am: b61a5f1d64

Change-Id: I3e4e57997ecf942d0607628529f0bf97f4c1d2ce
1c41dc8ec59db15cfc050f420f857fcbf0ff2bf0 29-Jun-2016 Amith Yamasani <yamasani@google.com> An API to check if running in a demo user

Add an API to query if the calling app is running
in a demo user sandbox. This allows apps to customize
the starting experience to a potential customer.

Change-Id: I50e40f9a8c66da4b5672c1dc64606d7bedba3f8c
Fixes: 29833923
/frameworks/base/core/java/android/os/UserManager.java
274ae72b470270fc61955d033165c0c65c2ae5f5 16-Jun-2016 Amith Yamasani <yamasani@google.com> Merge \\\"More thorough cleansing of expired users\\\" into nyc-dev am: 4f2b1b455e am: bf1301f542
am: 80027e9d93

Change-Id: I9f6040fb97c55aa5e01d00d5221a2c678227dab2
80027e9d9324fae6b34f8af3075cf49d7fecc42b 16-Jun-2016 Amith Yamasani <yamasani@google.com> Merge \\"More thorough cleansing of expired users\\" into nyc-dev am: 4f2b1b455e
am: bf1301f542

Change-Id: Ie4250ddaa0175ff25a85abdbaa59a31b61003752
c5ffdb9ee48905bacab0d5986d3eff2b399acd5e 16-Jun-2016 Amith Yamasani <yamasani@google.com> Merge \"More thorough cleansing of expired users\" into nyc-dev
am: 4f2b1b455e

Change-Id: I5714f73a9b90c0cb8fee653abf799374acfc6232
d04aaa323c3a788d26f18fc66e0a59b47e525b38 13-Jun-2016 Amith Yamasani <yamasani@google.com> More thorough cleansing of expired users

If any /data/system_[c|d]e folders were not erased
when the user was removed (maybe due to a reboot),
make sure they're cleaned up on restart as well
as when the userId is recycled later.

Mark the users' system folders with the correct
serial number for later verification.

AccountManager shouldn't be querying accounts of
partially created/destroyed users.

Change-Id: I4313756b7464f34cd5ce4fb296d61daa50b41fcb
Fixes: 29285673
/frameworks/base/core/java/android/os/UserManager.java
8ceec9a1fb761e34a26662f85d2abc6ac4863bce 07-Jun-2016 Esteban Talavera <etalavera@google.com> Merge "Fix getApplicationRestrictions documentation" into nyc-dev am: a86d6c4df3 am: cc12064670
am: 9bf7bd1728

* commit '9bf7bd17284152d28458530f6d58f5233c8a3d2b':
Fix getApplicationRestrictions documentation

Change-Id: Ib86f9b8a02641426aa80a35d55b26972d66a7b7f
cc12064670c9e0ade3ffcb4ff2eed4ddd5d267a8 07-Jun-2016 Esteban Talavera <etalavera@google.com> Merge "Fix getApplicationRestrictions documentation" into nyc-dev
am: a86d6c4df3

* commit 'a86d6c4df3b193060b4b725e1abfed4f69689843':
Fix getApplicationRestrictions documentation

Change-Id: Ia552cc886a182f558b7479b1d2a0201061dc5cc6
953fe483298bff46558a4e0b2d891924c0c9c813 07-Jun-2016 Esteban Talavera <etalavera@google.com> Fix getApplicationRestrictions documentation

The method never returns null, only empty bundle

Bug: 29178626
Change-Id: Ic53154eafe94c6c501b59932441d7ae1c89cb689
/frameworks/base/core/java/android/os/UserManager.java
8adc553b3eba543900cbb0702c141a280b160f59 28-May-2016 Amith Yamasani <yamasani@google.com> Merge "Helper method to check if current user is a demo user" into nyc-mr1-dev am: 5df14a60cf
am: df2297dcf3

* commit 'df2297dcf3b3a923207d1598dc4f6af0c1759241':
Helper method to check if current user is a demo user

Change-Id: I8149210498462036659c1b6b8e8dd322e6dfa336
69c76ce3875d136e4a51ef5dd3228a3fac2ead6a 28-May-2016 Amith Yamasani <yamasani@google.com> Merge "Revert "Revert "Remove ActivityManager calls with PM.mInstallLock held""" into nyc-mr1-dev am: aabbfc5565
am: a3bc135bb4

* commit 'a3bc135bb413bb159847926e0ccdf99acf125360':
Revert "Revert "Remove ActivityManager calls with PM.mInstallLock held""

Change-Id: Ifa8f6f8e195bca93af058914c5b1797f3294df6e
63a75e3b89058c2b6689fe71e6d8d3efd5207447 27-May-2016 Bart Sears <bsears@google.com> Revert "Remove ActivityManager calls with PM.mInstallLock held"

This reverts commit ac06a4907bff7d5ee0612dbb85180222e1455791.

Change-Id: I27bedbd221a8d416b9040a96063e66a1ca69fe2e
/frameworks/base/core/java/android/os/UserManager.java
5df14a60cf4eb5340d9339244ca7ba2485495531 27-May-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Helper method to check if current user is a demo user" into nyc-mr1-dev
d35a89cd80c6cdb4b61fc4c9d88d935ee26612e1 27-May-2016 Amith Yamasani <yamasani@google.com> Helper method to check if current user is a demo user

Bug: 27280140
Change-Id: I7f6ed3198a42b4f8b81b54764e0b73499a94f77c
/frameworks/base/core/java/android/os/UserManager.java
2d8583e0e4dedab0dfe5441d9b540d9ef993846f 27-May-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Remove ActivityManager calls with PM.mInstallLock held" into nyc-dev am: a4dbdaf5e9 am: 5d531e4f6c
am: f6816ad3c5

* commit 'f6816ad3c5b4062ebe8cdb810aee70e9c9a34314':
Remove ActivityManager calls with PM.mInstallLock held

Change-Id: I98ea0d1c547c5f044bf7fc9c231e7f19b6c39c95
ea1b9d7958b4201ca288ea16ed8a8454de6bbca9 27-May-2016 Amith Yamasani <yamasani@google.com> Revert "Revert "Remove ActivityManager calls with PM.mInstallLock held""

Added the missing import.

This reverts commit c51e725644be6d46e25c29e8774b542d52c29400.

Change-Id: Icd63619a12e10dee628e568a6200d429a9936cf0
/frameworks/base/core/java/android/os/UserManager.java
c51e725644be6d46e25c29e8774b542d52c29400 27-May-2016 Bart Sears <bsears@google.com> Revert "Remove ActivityManager calls with PM.mInstallLock held"

This reverts commit ac06a4907bff7d5ee0612dbb85180222e1455791.

Change-Id: I27bedbd221a8d416b9040a96063e66a1ca69fe2e
/frameworks/base/core/java/android/os/UserManager.java
5d531e4f6caedbcc2b6a9c7a549b83e37d694c7d 27-May-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Remove ActivityManager calls with PM.mInstallLock held" into nyc-dev
am: a4dbdaf5e9

* commit 'a4dbdaf5e96273dccd474e31700d84a1ad907503':
Remove ActivityManager calls with PM.mInstallLock held

Change-Id: I3be800fc5de9fa3c06f0bf6158a0dbf2a05b165e
ac06a4907bff7d5ee0612dbb85180222e1455791 25-May-2016 Fyodor Kupolov <fkupolov@google.com> Remove ActivityManager calls with PM.mInstallLock held

UserController now pushes user state to UMS.

PM now checks user running/unlocking/unlocked state by calling
UserManagerInternal.

Bug: 28090199
Change-Id: I20e62b37f78238f28dd81f49f876732bbd3c6b34
/frameworks/base/core/java/android/os/UserManager.java
514c5ef8d5774d8820ed1bf90fe53af1606cf106 25-May-2016 Aurimas Liutikas <aurimas@google.com> Add missing @Deprecated annotations.

Add missing @Deprecated annotations for methods with @deprecated tag
in javadoc.

Change-Id: I35b78ccb97832d86b914c21a300444ba29e33844
/frameworks/base/core/java/android/os/UserManager.java
eb437d4dffb310857e19bb619778dc5b6b7febff 29-Apr-2016 Amith Yamasani <yamasani@google.com> Retail mode flag and some clients for it

Bug: 27280140
Change-Id: Ide33e941b9c71eb925b5977d0b0d62198537ca14
/frameworks/base/core/java/android/os/UserManager.java
690c2ea117f90b7759ac280a1c84f5966b1e7938 17-May-2016 Zoltan Szatmary-Ban <szatmz@google.com> Merge "Introduce system API to get source of user restriction" into nyc-dev
6c915ead38db0a2a6393c40d4fbac959399439c5 10-May-2016 Fyodor Kupolov <fkupolov@google.com> Push unlocking/unlocked state to UserManager

Push unlocking/unlocked state to UserManagerInternal when it's changed in
UserController. Use UserManagerInternal.isUserUnlockingOrUnlocked when
updating flags for filtering in PackageManager.

Bug: 28629076
Change-Id: I8440af090f533f93870d0cff0e3871e114c37efa
/frameworks/base/core/java/android/os/UserManager.java
e783460274047ab38e3b9c4294339ff130fe566c 08-Apr-2016 Zoltan Szatmary-Ban <szatmz@google.com> Introduce system API to get source of user restriction

Clients can query who has set a particular user restriction on a user.
Currently the result can be a combination of none, system/user, or admin.

Bug: 27830375
Change-Id: I50ea9db0a59ffe3abbdcbb1a436d9ace7a35a851
/frameworks/base/core/java/android/os/UserManager.java
ce18c8167766f92856f94a8e88e19de4698960e6 28-Apr-2016 Jeff Sharkey <jsharkey@android.com> Introduce "unlocking" vs "unlocked" nuance.

There is a narrow window of time during user unlock where we're
reconciling user storage and dispatching the "unlock" status to
various internal system services. While in this "unlocking" state,
apps need to be told that the user still isn't actually "unlocked"
so they don't try making calls to AccountManager, etc.

The majority of internal services are interested in merging together
both the "unlocking" and "unlocked" state, so update them.

Clarify naming in AccountManagerService to make it clear that a local
list is being used, which mirrors the naming in MountService.

To match UX/PM requested behavior, move PRE_BOOT_COMPLETED dispatch
after the user is unlocked, but block BOOT_COMPLETED dispatch until
after all PRE_BOOT receivers are finished to avoid ANRs.

Bug: 28040947, 28164677
Change-Id: I57af2351633d9159f4483f19657ce0b62118d1ce
/frameworks/base/core/java/android/os/UserManager.java
7881cf8f818317cc6efe4d6a4c42da94d6bab223 15-Apr-2016 Ricky Wai <rickywai@google.com> Make "work mode on dialog" show personal challenge in unified work lock

Bug: 28183335
Change-Id: Ib212b283b9561f88899f6e7ea130944391b6e558
/frameworks/base/core/java/android/os/UserManager.java
0696434c623dced9fe9ed3873f59b64334f240e7 15-Apr-2016 Amith Yamasani <yamasani@google.com> Address API review for UserManager user creation

Don't return null from createUserCreationIntent()
Provide a way for apps to query if the device
supports multiple users.

Some additional documentation for UserManager class to
make things clear about the types of users and relationship
with accounts.

Change-Id: I768d816e73a1d7f61cdc415f9e482adc79e2715a
Fixes: 28150359
/frameworks/base/core/java/android/os/UserManager.java
f02420c5e1bcc8b2c278f272aca633fe6d2b4e88 04-Apr-2016 Benjamin Franz <bfranz@google.com> Maybe decrypt user when quiet mode is disabled

When quiet mode is disabled for a user and that user is not currently
decrypted, we show a confirm credentials screen to trigger decryption
of that user. Only if that was successful, do we actually disable quiet
mode.

Bug: 27764124
Change-Id: Ib1f649194d89e225dad62c14f3ddba1fa3d79da2
/frameworks/base/core/java/android/os/UserManager.java
7f98aa4aa93497692f200c553d2d6fff402e3de2 07-Apr-2016 Fyodor Kupolov <fkupolov@google.com> Added getProfileIds method returning array of userIds

Previously many usages of UserManager.getProfiles and getEnabledProfiles
were only using ids of returned users. Given that the list of users needs
to be parceled and unparceled for Binder calls, returning array of ids
minimizes memory usage and serialization time.

A new method getProfileIds was introduced which returns an array of userIds.
Existing method calls were updated where appropriate.

Bug: 27705805
Change-Id: Ic5d5decd77567ba0f749e48837a2c6fa10e812c0
/frameworks/base/core/java/android/os/UserManager.java
8673b2899e775014336efff44ea88dcac2b25bdd 21-Mar-2016 Tony Mak <tonymak@google.com> Revert getUserInfo change and add isManagedPorfile(int userId)


Bug: 26469166
Change-Id: I60b70170ddc80432fc8f638b1f63c4e9f5212785
/frameworks/base/core/java/android/os/UserManager.java
cf3f0a11a83e7a798e0586a78efdafc82a7f3d08 18-Mar-2016 Jeff Sharkey <jsharkey@android.com> Update direct boot related documentation.

Also hide a few APIs as requested by council. Add a method to
easily determine if a given File would already be encrypted at rest
by the OS.

Bug: 27531029
Change-Id: Icad5f1cd56411ad3ac707db85fd7449acdcc4b94
/frameworks/base/core/java/android/os/UserManager.java
8a372a0a280127743ce9a7ce4b6198c7a02d2a4f 16-Mar-2016 Jeff Sharkey <jsharkey@android.com> Refactoring FBE APIs based on council feedback.

Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
/frameworks/base/core/java/android/os/UserManager.java
4dc008cda2980fabb6acbf8a3b7096d1090ee36f 16-Mar-2016 Tony Mak <tonymak@google.com> Fix NotificationListenerService fail to mirror work notification

1. Instead of getting application info in runtime, just retrieve the
one in the context to avoid cross user operation.

2. Functions in PackageManager that retrieve badged icon now return
badged icon if the targer user is managed profile instead of checking
whether target user is a managed profile of the user in mContext.

3. Relax the restriction of getUserInfo, if the caller is asking a user
in the same profile group or having the manage user permission, we let
it go.

Bug: 26469166

Change-Id: Ia1ffc5743f7d94bd489cdb7571eaed51499ebdd9
/frameworks/base/core/java/android/os/UserManager.java
66ae66a7f74ee835807a141a216afbb254664510 19-Feb-2016 Vadim Tryshev <vadimt@google.com> Adding getManagedUserBadgedDrawableForDensity() to PackageManager.

It allows badging an image regardless of of the user (no
user id parameter). The styling for managed users is applied.

This is useful for new cases where the existing functions
wouldn't badge the icon, but we need it.

Bug: 25192539
Change-Id: I2fd2f226f626fb2e6cda1cfe072013350e12b41c
/frameworks/base/core/java/android/os/UserManager.java
523c404612c634f6901205fee4f4cae594f62982 25-Feb-2016 Fyodor Kupolov <fkupolov@google.com> Disable switching users if the user is in a call

Also disable "Remove guest" option, which switches the user.

Bug: 20652663
Change-Id: Id3ada14c0b3bfe70e9e1ab7034d27098924d7b45
/frameworks/base/core/java/android/os/UserManager.java
f8880561e67e1da246970b49b14285efd4164ab1 26-Feb-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps more.

Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException. New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.

Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.

Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
/frameworks/base/core/java/android/os/UserManager.java
27b2e6978716f9886db40f4fcf2e060b50637ac5 26-Feb-2016 Jeff Sharkey <jsharkey@android.com> When system server goes down, crash apps.

Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: If632cc36f68cd399a34de513b2d979abaa36fcaa
/frameworks/base/core/java/android/os/UserManager.java
1ddda4793c26fd249590fd3549cf060ecb7c157b 12-Feb-2016 Lenka Trochtova <ltrochtova@google.com> Prevent ephemeral user from being re-entered after stop.

Once the ephemeral user stops, the user's deletion is scheduled.
It takes a while before the user actually disappears and it is not
desirable for the user to be re-entered in the meantime.
Mark the user as disabled on stop and check this flag
in the activity manager to prevent the user from being switched
to again. Also hide the user from user-switching UI.

BUG: 26795729
BUG: 26780152

Change-Id: I83a61674958954b5a210114b88ffa5ae55922c1f
/frameworks/base/core/java/android/os/UserManager.java
eb83ab52b28766adf1743db76484515bc9b9e08a 22-Feb-2016 Tony Mak <tonymak@google.com> Update javadoc of DISALLOW_OUTGOING_CALLS

It is no longer true that we always forward the intent to personal side
after the introcution of work dialer.

Change-Id: I07b247c15d366278a07afab76b23c9d8847b01ef
/frameworks/base/core/java/android/os/UserManager.java
e9c440638e27a123a82feb5e4677ce1242785288 10-Feb-2016 phweiss <phweiss@google.com> DPM.createAndManageUser should work even with DISALLOW_ADD_USER set

For this, the DPM calls a new function
UserManagerInternal.createUserEvenWhenDisallowed() instead of
UserManager.createUser(). This calls
UserManagerService.createUserInternalUnchecked().

Also, only the system user is allowed to call this method, otherwise
a security exception is thrown.

Bug: 26952210
Bug: 26786199
Change-Id: I69c16354898d68592d13f5f53b840551f7ad4779
/frameworks/base/core/java/android/os/UserManager.java
0ffbfea423e37f924d1e6d5a1023b848218f5623 19-Jan-2016 Fyodor Kupolov <fkupolov@google.com> Self closing tags are not allowed as of Java 8

Self closing tags are not legal in HTML and javadoc was updated to better
enforce valid javadoc comments.
https://bugs.openjdk.java.net/browse/JDK-8020619

Change-Id: Ia7644b79be559a2e88fc9850eab570bd926f9a4b
/frameworks/base/core/java/android/os/UserManager.java
f2519814cc7136773a115b770d20cf4c92945952 26-Jan-2016 Oleksandr Peletskyi <peletskyi@google.com> Added restriction that disallows ability to set wallpaper.
BUG: 24890474

Change-Id: I424aa80d914e3b6f3f9eba8ccb4802bad6f54907
/frameworks/base/core/java/android/os/UserManager.java
7b9f2e1d86e5017dbf5530356ec30d090f703a67 28-Jan-2016 Fyodor Kupolov <fkupolov@google.com> Merge "Added SystemApi for getting serial numbers of users"
940e8577a1569140521fb605336997863529f7ad 26-Jan-2016 Fyodor Kupolov <fkupolov@google.com> Added SystemApi for getting serial numbers of users

Also added UserHandle version of queryBroadcastReceiversAsUser.

Bug: 25844894
Change-Id: I78ecbef186e4ced10425ae2899db72c2d91c5792
/frameworks/base/core/java/android/os/UserManager.java
37ed8d1ce0ffa1e570e868a357b6cb6d509c4e91 27-Jan-2016 Amith Yamasani <yamasani@google.com> Tweaks to user creation intent text and error codes

Return error codes in some cases.
Tweak the message to the user.

Bug: 22776757
Change-Id: Ieff0caf0add9542287b5629d7d97331df0cada1e
/frameworks/base/core/java/android/os/UserManager.java
7f1f1dfc8713fbecbab60cfbe14ab4d97d27deee 18-Jan-2016 Oleksandr Peletskyi <peletskyi@google.com> Added restriction if a user is allowed to change the icon.
BUG: 25305966

Change-Id: I3d527224f00087b2bd959879ebb143e2ecb9c914
/frameworks/base/core/java/android/os/UserManager.java
12747879b0204b9dfee997eddc981d09289e8b77 07-Dec-2015 Amith Yamasani <yamasani@google.com> User creation with an intent

New API for an app to request creating a new user with
a given user name and seed account information for the
SetupWizard to use when that user is switched into.

Also adds system APIs to read the seed account data from
UserManager.

Bug: 22776757
Change-Id: I0bc3f11ee19c15e0ee2a908c88d98b13296cc30d
/frameworks/base/core/java/android/os/UserManager.java
0e62384ccbd00e9f78851929ca88b919679ee32e 14-Jan-2016 Jeff Sharkey <jsharkey@android.com> Prepare app data only when storage is available.

Before this change, scanning a package aggressively tried checking
to ensure that private app data was prepared. However, in an FBE
world we may not have access to that data at scan time. So this
change shifts the preparing of private app data until later: it
prepares DE storage when a user is started, and CE storage when a
user is unlocked. Wire ourselves into the user lifecycle so we can
prepare storage at both user start and unlock.

When DE/CE storage becomes available, this change reconciles any
found packages against known installed apps, and deletes any orphaned
data directories.

We now need to store the last-restorecon hash in an xattr on a
per-user directory basis, since we can't restorecon CE storage until
it's unlocked, or adopted storage until it's mounted. Remove a
bunch of used logic for loading dynamic SELinux policy at runtime;
our policy always comes from the system image.

Bug: 26466827, 26544104
Change-Id: I8d0a4ef862c35f4e4ef5c7f20d3bb8f12ba3fd4b
/frameworks/base/core/java/android/os/UserManager.java
dea471ef548f09e04e178c5ec2d71a4b79bdb8f8 17-Dec-2015 Mahaver Chopra <mahaver@google.com> Added Data roaming user restriction

Added new user restriction DISALLOW_DATA_ROAMING, can only be set
by device owners.

Bug: 24890464
Change-Id: Ic4cb37dd5f9bbffa35f921751488ef7c7ff99452
/frameworks/base/core/java/android/os/UserManager.java
8588bc1ef1f020bbe4a24d46874f675708149a57 07-Jan-2016 Jeff Sharkey <jsharkey@android.com> Add flags to requests for package UID/GIDs.

This gives callers the ability to request details for missing
packages. Also add annotations for userId and appId variables and
start tagging their usage.

Change-Id: I63d5d7f870ac4b7ebae501e0ba4f40e08b14f3f6
/frameworks/base/core/java/android/os/UserManager.java
b6c0ce4ac915cd5ab9a308cb0a4861c4e2cd7dfb 05-Nov-2015 Benjamin Franz <bfranz@google.com> Allow device and profile owner to modify accounts

The user restriction DISALLOW_MODIFY_ACCOUNTS and the policy
DPM.setAccountManagementDisabled can now be circumvented by a device
or profile owner. This allows the device or profile owner to add
accounts without briefly having to remove the policy.

Bug: 22030831
Change-Id: I2b59c4b3ad354287d7a00f21b2afef072d12517d
/frameworks/base/core/java/android/os/UserManager.java
5b0e5207e1b2de9fd533fa444b8d9a0acadd1513 19-Dec-2015 Jeff Sharkey <jsharkey@android.com> Point "unlocked" logic at lower level.

There is a race when starting a non-encryption-aware launcher before
we've gone through the user lifecycle to enter the "running unlocked"
state. This can cause the launcher to choke when it's denied access
to widgets that are still considered locked.

For now, relax the notion of a user being unlocked to reflect the
on-disk state, instead of looking at the user lifecycle.

Also add logging of encryption commands.

Bug: 26267450
Change-Id: Ie330d07418cf10413e0b4380f6d6781684f01952
/frameworks/base/core/java/android/os/UserManager.java
0999c0d6e9c83873d9595ee764b6388dbc49dcb8 17-Dec-2015 Jeff Sharkey <jsharkey@android.com> Make printing framework encryption-aware.

Only create UserState objects when a user has been unlocked, meaning
we can connect to the spooler. Ignore package events that occur
while a user is locked, since we'll kick off updateIfNeededLocked()
when that user is eventually unlocked.

In all other cases, throw if someone tries obtaining UserState for
a still-locked user. This should help catch any edge cases in the
system, and communicate clearly through public APIs that printing
isn't available until the user is unlocked.

Bug: 26246836
Change-Id: If15744621890baee206d355484fe20933afc65d8
/frameworks/base/core/java/android/os/UserManager.java
5b9f167a8e7395ca54fc0ef78af4523858de87a7 11-Dec-2015 Esteban Talavera <etalavera@google.com> Only system can set application restrictions via UserManager

Preventing apps with MANAGE_USERS from managing application
restrictions via UserManager. Application restrictions should
only be set via DevicePolicyManager.setApplicationRestrictions,
or via Settings (for restricted profiles).

Bug: 22541936
Change-Id: Ieed51ef54b4c23a73f383465e9af9b3bcf18a514
/frameworks/base/core/java/android/os/UserManager.java
b642387b43417e2f342a1bc16e4f639b5d6c4b97 11-Dec-2015 Jeff Sharkey <jsharkey@android.com> Cleaner API for requesting locked status.

Change-Id: I1a5a6703737fb838347eaa292004430f2b9d29c3
/frameworks/base/core/java/android/os/UserManager.java
98cb23dccfb65ddd2802c49d8714979f7dbae1df 09-Dec-2015 Jeff Sharkey <jsharkey@google.com> Merge "Slight API renaming, better behavior."
e13529a4adb60e5a18c2e36ce6c5bf8f2d1db78f 09-Dec-2015 Jeff Sharkey <jsharkey@android.com> Slight API renaming, better behavior.

Rename APIs to reflect that they're storage-related. Also move
credential-storage APIs to be system API.

Return a null Context when device-encrypted storage isn't
supported. This is the easiest way to keep legacy apps working when
upgrading from M to N.

Reduce strictness of path checking so we don't crash when working
with special packages like "android".

Bug: 22358539, 26104027
Change-Id: I38c24fc003488186210a6ae3b64270f86e1efe56
/frameworks/base/core/java/android/os/UserManager.java
13b80b2303f4cd183e5f1ec4956c6770fea64cfb 08-Dec-2015 Xiaohui Chen <xiaohuic@google.com> Merge "UserManager: get/set user account name"
c4dd021322d38ea32ac49930e904b6d08ce6490c 18-Nov-2015 Lenka Trochtova <ltrochtova@google.com> Introduce ephemeral users.

BUG: 24883058

Change-Id: I2e1d6aa184142c2a3dc0415c0cd407573453cf41
/frameworks/base/core/java/android/os/UserManager.java
ed6c8cd6ca377ba51243c70844c6dd074abbd0fc 08-Dec-2015 Zoltan Szatmary-Ban <szatmz@google.com> Merge "Make base user restrictions queriable for system apps"
b3b9258ab6a01af5e0df4b8385b73084cd9ec530 07-Dec-2015 Xiaohui Chen <xiaohuic@google.com> UserManager: get/set user account name

Bug: 25935510
Change-Id: I0b621fb300be74209534e08a11f1d1a7c049cd5a
/frameworks/base/core/java/android/os/UserManager.java
0a29ecd8a53b5ac63b628e870a344650ff34c4b0 04-Nov-2015 Rubin Xu <rubinxu@google.com> Introduce quiet mode state to managed profile users

Quiet mode means the user will be free from visual and audio interruptions
from apps inside the managed profile, including notifications, widgets and
others. This CL adds the underlying state bit to users and exposes various
APIs to control and query the quiet mode state.

Bug: 22541941
Change-Id: If5f8e5a897843050e83b6ec26cb39561098f12b9
/frameworks/base/core/java/android/os/UserManager.java
3bbceddb94d627495c0022d6e3f92a5cb16aebea 26-Nov-2015 Zoltan Szatmary-Ban <szatmz@google.com> Make base user restrictions queriable for system apps

Needed by e.g. Settings > Location

Bug:22541939
Change-Id: I6cdd5f1c32cde143232eb53f531bbf3a737d8a9a
/frameworks/base/core/java/android/os/UserManager.java
9d8a1048bb666c68402dce031bebfa07c92a42db 04-Dec-2015 Jeff Sharkey <jsharkey@android.com> Handle non-encryption-aware accounts and sync.

The system can now boot in a "locked" state where only encryption
aware (EA) components can be safely started. When in this state,
PackageManager already filters away non-EA components, but system
services like AccountManager and SyncManager need to carefully handle
these temporarily "missing" components.

As a guiding principle, all known Accounts are still present when
the device is locked, but communication with underlying non-EA
authenticators is blocked.

To keep things simple for now, all SyncManager requests are kept
dormant until the user enters the unlocked state.

The core of this logic is that RegisteredServicesCache now works
with all components regardless of EA status, which prevents us from
accidentally thinking a service was removed when the user is locked.

Bug: 25945136
Change-Id: I8714121f6236b00821769023c4df7de1c8a99944
/frameworks/base/core/java/android/os/UserManager.java
f23b5d3d6d6d6d72876603c8f72b82d5de022735 02-Dec-2015 Jeff Sharkey <jsharkey@google.com> Merge "API to determine user locked/unlocked state."
0825ab284c01402d030a24471ac5a6491d79d28b 02-Dec-2015 Jeff Sharkey <jsharkey@android.com> API to determine user locked/unlocked state.

Bug: 25946804
Change-Id: I2b8c8c75fda161a446d79fac811fdd446aa3a4db
/frameworks/base/core/java/android/os/UserManager.java
9cbfc9e212151e84910a22387365644916dde446 08-Oct-2015 Fyodor Kupolov <fkupolov@google.com> Added DISALLOW_RUN_IN_BACKGROUND user restriction

It forces the user to stop instead of going into the background. Also
changed behavior of stopUser method. Now it also attempts to stop related
users along with the specified userId.

Based on ag/807976, with the only difference that it's now a user restriction.

Bug: 24579258
Bug: 24708668
Change-Id: I357298908816fc58feeed83b7e9979fc33d25da6
/frameworks/base/core/java/android/os/UserManager.java
e04462caa46803c64dac5107a8d7b07894e23b9d 01-Dec-2015 Fyodor Kupolov <fkupolov@google.com> Correctly set default restrictions when creating guest

Use restrictions from mGuestRestrictions when creating a guest. Initially
phone calls, SMS and installing from unknown sources is not allowed.

Bug: 25904144
Bug: 25729516
Change-Id: I461c492ad64842d3707f73dfd83b533aa31b63ef
/frameworks/base/core/java/android/os/UserManager.java
d59262667cbcdfedd9b03dccaa26a9a000486350 09-Nov-2015 Nicolas Prévot <nprevot@google.com> Merge "Add method to tell the dpc if provisioning is allowed."
e17ac1569793c333bb4dce86607a342e7c982ae7 07-Nov-2015 Jeff Sharkey <jsharkey@android.com> More APIs for encryption-aware apps.

Apps can mark manifest components as being encryption-aware, which
means they can safely be run before the credential encrypted storage
is available.

Start adding filtering logic so that we only return these components
when a user is running "with amnesia." That is to say, only device
encrypted storage is available, so the user is running but with only
partial knowledge of its data.

To avoid calling into ActivityManager with the PackageManager lock
held, we quickly determine user state and splice the state into the
flags for later per-component evaluation.

Bug: 22358539
Change-Id: Idc56ec29f1ef04da8963e004314d7f5e47400997
/frameworks/base/core/java/android/os/UserManager.java
07387fedfafa72bcb68defd801eef82f1f494d7c 30-Oct-2015 Nicolas Prevot <nprevot@google.com> Add method to tell the dpc if provisioning is allowed.

The DPC can use it to tell if provisioning a managed profile or for
device owner would work or not.

BUG:25338478
Change-Id: I09ea6a9f23a8e88e4ed37c048170b2a68213086e
/frameworks/base/core/java/android/os/UserManager.java
5263492de62c4dac099d0aa0f70056dbc729b06b 02-Nov-2015 Makoto Onuki <omakoto@google.com> Merge "Allow DO to disable camera device-wise."
759a763f5f03fda86b96d238faedb870fbee24ec 29-Oct-2015 Makoto Onuki <omakoto@google.com> Allow DO to disable camera device-wise.

Bug 24538855

Change-Id: I421690f14ee57fa818d2b233fe48a90a0a575a9e
/frameworks/base/core/java/android/os/UserManager.java
8f18dd4dfa45e27cd5dbe6135da1b5b4985283bb 30-Oct-2015 Amith Yamasani <yamasani@google.com> Merge "Don't store a static instance of UserManager"
c0688301de5feea94c8456b3b9b42c41d0045f03 30-Oct-2015 Amith Yamasani <yamasani@google.com> Don't store a static instance of UserManager

Otherwise the context within it can't be GCed.
It's better to leave the caching to the ContextImpl.

Bug: 25308506
Change-Id: I9be3ba5b1bb6cdc88b77520b2fbd72d9b72ef30d
/frameworks/base/core/java/android/os/UserManager.java
a3c1250a2fc36e7315b377b1babe9d03ae41721a 28-Oct-2015 Makoto Onuki <omakoto@google.com> Fix javadoc

Change-Id: Iade890cd14bcac844f8ccc1ddde90120600fd64a
/frameworks/base/core/java/android/os/UserManager.java
068c54a5be697c3df4657dcda33cd17c4b547710 13-Oct-2015 Makoto Onuki <omakoto@google.com> Layer user restrictions

- Now DPMS remembers user restrictions set by DO / PO in their ActiveAdmin.

- User restrictions set by DO/PO will no longer be saved by UserManger. Instead,
when needed, UMS will consult DPMS to build "effective" user restrictions.

- UM.getUserRestrictions() will now always return "effective" user restrictions.

- DPMS migrates existing user restrictions per the eng spec.

- Also now UM.setUserRestrictions() will crash. UMS.setUserRestrictions() has
been removed.
This was needed because UM.setUserRestrctions(UM.getUserRestrictions()) will no
longer be a valid use like it used to be.

- Also introduced a fined-grained lock for user restrictions in UM to avoid
deadlock between DPMS and also for better performance.

Bug 23902097

Change-Id: If0e1e49344e2f3e9226532d00777976d1eaa7df3
/frameworks/base/core/java/android/os/UserManager.java
fd5b77444edaec88895344a629d071ecf352cf36 15-Oct-2015 Xiaohui Chen <xiaohuic@google.com> Add UM.isSameProfileGroup()

This optimizes the performance to check if two users are in the same
profile group.

Change-Id: I493a3475b848487836f4dbe01529c63165ace483
/frameworks/base/core/java/android/os/UserManager.java
cd86ebf1c965c191f46b6480145c9d217a7d841e 30-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Check multi-user support in isUserSwitcherEnabled

isUserSwitcherEnabled now returns false if multi-user is disabled(
supportsMultipleUsers() returns false).

Removed GUEST_USER_ENABLED setting and replaced with DPM.getGuestUserDisabled
check. It currently always returns false, but will be replaced with an actual
policy check.

Bug: 17571233
Change-Id: I41853e8b321b2537952cac5d92e88bfdb8cbd9a8
/frameworks/base/core/java/android/os/UserManager.java
1c36315a36962321dfe870b07e28b04a1d6777e9 02-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Fixed VPN support for restricted profiles in split system user model

In a new split system user model, owner of a restricted profile is not limited
to just user0. restrictedProfileParentId field should be used to get an owner.

Bug: 22950929
Change-Id: I928319a9450e543972237a42267eb2404e117c83
/frameworks/base/core/java/android/os/UserManager.java
02cb6e773b323a0d54b21f43460a23f668b7727c 19-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Added --restricted option for create-user command

Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I0346a3368de53f4bb4b6e054349f19adac959d7f
/frameworks/base/core/java/android/os/UserManager.java
9249a9097707bb57ae0a7d114eff54bc82ad462d 26-Sep-2015 Bart Sears <bsears@google.com> Revert "Added --restricted option for create-user command"

This reverts commit 737b216b5c28f7d7162f219136d4e8a9eb1a486b.

Change-Id: I4c43967933bb2e46cdb8ad6e643d7037d722cab2
/frameworks/base/core/java/android/os/UserManager.java
737b216b5c28f7d7162f219136d4e8a9eb1a486b 19-Sep-2015 Fyodor Kupolov <fkupolov@google.com> Added --restricted option for create-user command

Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I5f0d48bcbd3c0b51927926b874fd057c15ac5219
/frameworks/base/core/java/android/os/UserManager.java
06a484adb93c6c969321147b07112684383305f6 22-Aug-2015 Fyodor Kupolov <fkupolov@google.com> Non-system users can now have restricted profiles

In the non split system user, only USER_OWNER is allowed to have restricted
profiles. This is now changed in split user mode, where multiple secondary
users can have restricted profiles.

Added UserInfo.restrictedProfileGroupId field, which defines parent/child
relationship between secondary users and linked restricted profiles. Adjusted
shared accounts handling logic to not assume that USER_OWNER is the only owner.

Bug: 23191995
Change-Id: I5f3fc2aa4f229103d6e75ec2c3dfce866b8007de
/frameworks/base/core/java/android/os/UserManager.java
b818681dcae157412b897587ff856cd0c531c3f4 06-Aug-2015 Nicolas Prevot <nprevot@google.com> Allow non-owner users to have managed profiles.

In the split system user model:
The only users that are not allowed to have managed profiles are:
- purely system user (user 0)
- guest users
- restricted profiles
- managed profiles

In the non-split system user model, the behavior does not change:
only the primary user can have managed profiles.

BUG:22956426
Change-Id: If908c30f110fd3e740770174f050c9b6cf87ce1b
/frameworks/base/core/java/android/os/UserManager.java
768352fdae6fc92805d11dd4e1a1220a25b5f5a5 07-Aug-2015 Andres Morales <anmorales@google.com> am e0a7cfa0: am 981c4561: am 7ab11e45: am 5fd47543: am 85c73c40: Merge "[UserManager] expose method to retrieve credential owner" into mnc-dev

* commit 'e0a7cfa026da56f1197c1feea79f76153c5eddd5':
[UserManager] expose method to retrieve credential owner
c5548c02fe0aa768ebfce88ac09393dabe61ec06 05-Aug-2015 Andres Morales <anmorales@google.com> [UserManager] expose method to retrieve credential owner

Certain operations (like ConfirmCredential) can be invoked
in the context of a profile, in which case the calling code
needs to know under what profile the credential is registered.

Expose a centralized location for this information for Settings
and GateKeeper to consume.

Bug: 22257554
Change-Id: Iffe4f6a254f52d1269b9287edabcf6efa515d9d2
/frameworks/base/core/java/android/os/UserManager.java
2b45f8a6ce623012b2fc6237acd1bdc6ebe2c85c 05-Aug-2015 Xiaohui Chen <xiaohuic@google.com> Clean up USER_OWNER references in settingslib.

Bug: 19913735
Change-Id: I0ccaed63c8fbc3bcbbd8d5cf8047e33c6e2edb5c
/frameworks/base/core/java/android/os/UserManager.java
f6f1a7ec9935c32e6c1155333de94ac9cd544442 01-Aug-2015 Dianne Hackborn <hackbod@google.com> am 628b4125: am bc2a8843: am b97c5ddd: am 9b36f526: am c1836bb0: Merge "Change MNC codename to just M." into mnc-dev

* commit '628b4125843b93dc7f3ed0c9bbea76ff470d2eed':
Change MNC codename to just M.
0e3de6cacaffcfeda4d6353be61e2f1f9ed80705 30-Jul-2015 Dianne Hackborn <hackbod@google.com> Change MNC codename to just M.

Change-Id: I4281d200ff6560791c47cf9073ceea1cb509361e
/frameworks/base/core/java/android/os/UserManager.java
a48c0304bfc72dbf422382ced0a5b2705a7bfd9f 21-Jul-2015 Fyodor Kupolov <fkupolov@google.com> am cc432cc0: am 5211528b: am 67cd2fc5: am cf6500b9: am 55a116d0: Merge "Updated JavaDoc for DISALLOW_MODIFY_ACCOUNTS restriction" into mnc-dev

* commit 'cc432cc08919cec386213f993b36bfdc5adf6ed0':
Updated JavaDoc for DISALLOW_MODIFY_ACCOUNTS restriction
53019287fd4fed9837363cff4de87100d85c2b81 21-Jul-2015 Fyodor Kupolov <fkupolov@google.com> Updated JavaDoc for DISALLOW_MODIFY_ACCOUNTS restriction

Bug: 21521860
Change-Id: I0c2659f84589a77432317fbc89d49716027577d3
/frameworks/base/core/java/android/os/UserManager.java
cfe64c8afa9f30d8874c72440c3992e79fdb60c9 16-Jul-2015 Xiaohui Chen <xiaohuic@google.com> sys user split: update createUser method

After the system user is split out, all users are more or less the same.
We combine the generic user and secondary user create method to reflect
this concept. This also fixes the bug the newly created Primary user
from lock screen contains secondary user restrictions.

Bug: 19913735
Change-Id: Iff8802cd46401081bb444317becaf6ecab934e1e
/frameworks/base/core/java/android/os/UserManager.java
7cb69df507f5f7956c52a2868a0d6e89aec6dde2 14-Jul-2015 Xiaohui Chen <xiaohuic@google.com> sys user split: refactor systemui user switcher

BUG:19913735
Change-Id: I017dd1b03fd163c266b8080b969fb7a2e934e26c
/frameworks/base/core/java/android/os/UserManager.java
1df60ca5f17fa44b7894f7dbee3c395abae4a8c8 01-Jul-2015 Amith Yamasani <yamasani@google.com> am 67abd3b3: am da3d7b2b: am 2b64ec47: Merge "Don\'t allow non-admins to adopt sd card for internal storage" into mnc-dev

* commit '67abd3b356794b316e647a9ad20a24b09406823f':
Don't allow non-admins to adopt sd card for internal storage
462ac3a2aa5e1c974d056dc7221805e2b8ac7823 30-Jun-2015 Amith Yamasani <yamasani@google.com> Don't allow non-admins to adopt sd card for internal storage

Bug: 21883016
Change-Id: I9af3eeffd860b076e69bb02a3dc06edba5f95898
/frameworks/base/core/java/android/os/UserManager.java
2f37bd39217177fc2d49b07a9d1b2821d3177e80 29-Jun-2015 Nicolas Prevot <nprevot@google.com> am d1d1a700: am 64c0c4da: am 6fd49936: Merge "Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING" into mnc-dev

* commit 'd1d1a700501242cca06b5729c2bd888d6f2d4d52':
Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING
f0029c1ddb2875583e62c6a3f96d288e21f2efe2 25-Jun-2015 Nicolas Prevot <nprevot@google.com> Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING

Also improve the javadoc.

BUG:21701782
Change-Id: I88a75ccfa71b0d5df2f4779987cf0fff56001fd3
/frameworks/base/core/java/android/os/UserManager.java
70f6c38644a4a6e28c016c265e6987bf00dd61f1 28-Apr-2015 Xiaohui Chen <xiaohuic@google.com> Introduce system user and primary user.

Bug: 19913735
Change-Id: I2c7855915d778cf80a7154314321ddd90e2eaaac
/frameworks/base/core/java/android/os/UserManager.java
9edbda18df025527e18614cf0c45d538a27af30f 17-Jun-2015 Nicolas Prevot <nprevot@google.com> Allow cross-profile app linking from work to personal.

If the profile owner sets ALLOW_PARENT_APP_LINKING:

ACTION_VIEW, scheme http/https intents sent from the work profile
can be resolved by personal apps if they specify a host.

BUG:21701782
Change-Id: I372e2405345539eac9d6b4fb08def6bf84da14a6
/frameworks/base/core/java/android/os/UserManager.java
2cc03e5606ad7cd473283898400506d5ac2237ba 20-Mar-2015 Jeff Sharkey <jsharkey@android.com> Yet another user restriction.

Change-Id: Ia2952da19cb974a6a9ba0271a298a10df58b8d18
/frameworks/base/core/java/android/os/UserManager.java
e3e314df4d52881225326d426a76e3e7f1bc40d3 20-Apr-2015 Stuart Scott <stuartscott@google.com> Network Reset should have a lockdown like Factory Reset.

bug:20332322
Change-Id: I7c61a011d11e89513757f112abf320bb2a785edb
(cherry picked from commit 94b038bbb291431a7b39611d72f206b07e839891)
/frameworks/base/core/java/android/os/UserManager.java
5e0ef0d0e62b77bcfc687bfbc1db875db71eba69 26-May-2015 Nicolas Prevot <nprevot@google.com> Merge "Say in the doc that DISALLOW_CONFIG_VPN now works." into mnc-dev
298f98fa234f353267ddc9c75d58e8cc542c25f1 23-May-2015 Nicolas Prevot <nprevot@google.com> Say in the doc that DISALLOW_CONFIG_VPN now works.

BUG:18902920
Change-Id: I761cba1f1e01fbe88f773887bf4e9233fc85cfef
/frameworks/base/core/java/android/os/UserManager.java
72434b7088591828082dd952496d523ef3622de2 13-May-2015 Nicolas Prevot <nprevot@google.com> Allow creating a managed profile if there is only one user.

BUG:21119929

Change-ID: Ice1cf25f8ae8199228f828d22118c94b9e11b567
/frameworks/base/core/java/android/os/UserManager.java
7f75da2405cd910854448bb3801f776e036f926a 01-May-2015 Ruben Brunk <rubenbrunk@google.com> camera2: Fix work-profile eviction handling.

Bug: 20124384

Change-Id: I6fb82dbfd5f98746ed4befed81a583e3709bfee8
/frameworks/base/core/java/android/os/UserManager.java
b501330a1b6ef14ff512a5727f7a01bc423d6fbb 18-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Disable multi-user background recording

On user switch, kill existing processes of the background user with
android.permission.RECORD_AUDIO permission. Home activity should not be
killed to avoid an expensive restart of the home launcher, when the
user switches back.

Introduced DISALLOW_RECORD_AUDIO user restriction, which is enabled for the
background user, and removed for the foreground user.

Introduced a concept of system controlled user restriction, which can only
be set by the system, rather than device administrator.

Bug: 20346194
Change-Id: Ic942fd565e80d14424230dae612965a8e229c4ef
/frameworks/base/core/java/android/os/UserManager.java
ef24909d84db9d5aefb825ee1556089fcdcc1678 06-May-2015 Fyodor Kupolov <fkupolov@google.com> Remove restrictions PIN functionality

Bug: 20852231
Change-Id: I5666ee28ff1341ead9b258bc0852d8ba6d313c5e
/frameworks/base/core/java/android/os/UserManager.java
5760e1786bcc2feac9d1c2c784520aa4d6cf8cb8 18-Apr-2015 Amith Yamasani <yamasani@google.com> Add isSystemUser API

Bug: 20348316
Bug: 19945747
Change-Id: Ibb81f0b2fccec621e26e4543bf9f26ffddfafb15
/frameworks/base/core/java/android/os/UserManager.java
385de624aa990266ffbaf70711ac8a330569429e 11-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Use UserHandle instead of int for public APIs

Bug: 20049349
Change-Id: If5671fb47aa9a3cffebff16787daeae9ca7361e8
/frameworks/base/core/java/android/os/UserManager.java
ff7233e2e3df4965b9ecadabfd78bb991fd1e102 08-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Added getUserCreationTime to query user/profile creation time

Added public api to query creation time of the user or of a managed profile
associated with the calling user.

Bug: 20049349
Change-Id: I7f9263fe434233e6f7d4f165c974cab64ca7107c
/frameworks/base/core/java/android/os/UserManager.java
bff46bac807ae8a9ebdc22c449a8d4f78711b4d2 05-Mar-2015 Benjamin Franz <bfranz@google.com> Add DO policy to disable safe boot mode.

Bug: 19615843
Change-Id: I14dbe911995ec216c57bd285d6b7b04c9684591a
/frameworks/base/core/java/android/os/UserManager.java
f3ece36535d4999cf2bfd2175a33da6c3cdf298e 11-Feb-2015 Benjamin Franz <bfranz@google.com> Block setting wallpapers from managed profiles.

Silently fail when a managed profile app tries to change the
wallpaper and return default values for getters in that case.
This is implemented through a new AppOp that is controlled by
a new user restriction that will be set during provisioning.

Bug: 18725052
Change-Id: I1601852617e738be86560f054daf3435dd9f5a9f
/frameworks/base/core/java/android/os/UserManager.java
3558752ec77f455bbabc86b3178dfb294edf5aff 19-Feb-2015 Nicolas Prevot <nprevot@google.com> Merge "Improve the documentation of DISALLOW_CONFIG_BLUETOOTH."
1c4c442e4540b16aed7acc345aea26ab101efbf8 16-Feb-2015 Nicolas Prevot <nprevot@google.com> Improve the documentation of DISALLOW_CONFIG_BLUETOOTH.

BUG:19315055

Change-Id: Ic92a7b79f8113cad0474d62b0c615a1ada91838b
/frameworks/base/core/java/android/os/UserManager.java
1bdff9139fd412b36d5d2d783574b6418fcb198a 17-Feb-2015 Adrian Roos <roosa@google.com> Decouple package manager lock and bitmap decoding

Also moves the actual reading and decoding of the
icon into the client process to avoid unnecessary
copies.

Bug: 18474438
Change-Id: I71623ef48c770d752593aa97d69517f6139cc947
/frameworks/base/core/java/android/os/UserManager.java
a9f9c4b90a8af25974bc74971efeafa521073df2 15-Jan-2015 Nicolas Prevot <nprevot@google.com> Merge "Fix javadoc for UserManager.KEY_RESTRICTIONS_PENDING" into lmp-mr1-dev
b14ed95647ff7c38869550606396d5b784eeece1 13-Jan-2015 Nicolas Prevot <nprevot@google.com> Fix javadoc for UserManager.KEY_RESTRICTIONS_PENDING

BUG:18983720

Change-Id: I3af3354f746cd2981cdb8ba2ed6cc380665249ee
/frameworks/base/core/java/android/os/UserManager.java
150514bd03312ab0a890cc040019cfbc73eb077c 08-Jan-2015 Amith Yamasani <yamasani@google.com> Clarify docs for user restrictions

Specify which restrictions are not relevant or behave differently
for managed profiles.

Bug: 18768578
Change-Id: Iac1435c5b931cbb889902a9b9e427bc0e0778bf2
/frameworks/base/core/java/android/os/UserManager.java
34b6e35ba67a1dd4b770fbf80fe8f3dc1e1e01e3 18-Nov-2014 Nicolas Prevot <nprevot@google.com> Fix javadoc in UserManager mentioning application restrictions.

The java doc of UserManager.KEY_RESTRICTIONS_PENDING contains mistakes.

BUG: 18414603
Change-Id: I9584dad545dcbef1eb2ee0e4f5df117486435e8a
/frameworks/base/core/java/android/os/UserManager.java
cc8d56f66c64a66002b90ed014bbd2fb46125f63 10-Nov-2014 Andres Morales <anmorales@google.com> Merge "Unhide DISALLOW_OUTGOING_BEAM" into lmp-mr1-dev
53d63dcd04da3c1d5187b29f6530c2dcac9d516c 07-Nov-2014 Sander Alewijnse <salewijnse@google.com> Added the restrictions pending application restrictions key.

Bug:17632522
Change-Id: If5a0d0ea1f479b0584fc0b1cff2a179d296d2904
/frameworks/base/core/java/android/os/UserManager.java
cd3b72e6f9a158ac492a4a8b5629d73b495a7d1e 06-Nov-2014 Andres Morales <anmorales@google.com> Unhide DISALLOW_OUTGOING_BEAM

Bug:17387303
Change-Id: If4410bbfd9f82c84886024a091454ee931d9d930
/frameworks/base/core/java/android/os/UserManager.java
6d93491f506312e0686d86f278eac6f48a364242 14-Oct-2014 Amith Yamasani <yamasani@google.com> Hide DISALLOW_OUTGOING_BEAM API

This is not fully functional in managed profiles, so it is being removed for L.

Bug: 17973040
Change-Id: If660e5e565076cdf61649e9f5ca12877425e9df3
/frameworks/base/core/java/android/os/UserManager.java
89b196958fee07475765bd3c458098464ba16f2e 08-Oct-2014 Dianne Hackborn <hackbod@google.com> Merge "Put in real "code" (aka marketing) name." into lmp-dev
955d8d69ea6caabce1461dc25b339b9bf9dc61a6 08-Oct-2014 Dianne Hackborn <hackbod@google.com> Put in real "code" (aka marketing) name.

Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
/frameworks/base/core/java/android/os/UserManager.java
aa6634eaca707f7cbf5f5a1d75b90d8d775d254b 06-Oct-2014 Amith Yamasani <yamasani@google.com> Set the default user restrictions to disallow calling and sms

When creating a user via the UI, disallow phone calls and SMS by
default. Primary user must explicitly enable it via Settings.

Bug: 17832802
Change-Id: I18cad4be8493ddc8890b5d90da2df256cb3f1ec9
/frameworks/base/core/java/android/os/UserManager.java
67a101aa3006aa2011a9d9edaacb2fa6f6f31140 02-Oct-2014 Dianne Hackborn <hackbod@google.com> SDK only: Update docs to reflect current implementation.

Change-Id: I498425bb55b157c954af6a2441d8bd9be3871c55
/frameworks/base/core/java/android/os/UserManager.java
c34dc7cdeb5cae8ca4c731838aafe90ed4c9a2b8 18-Sep-2014 Amith Yamasani <yamasani@google.com> Allow primary user profile owner to set device restrictions

In addition to device owners, profile owners on the primary user
can also set user restrictions that are necessary to lock down the
user.

This is to enable the case of a profile owner registered after setup
wizard is completed, on the primary user.

Also make managed profile vs. profile wording consistent in the
DevicePolicyManager docs.

Bug: 17555025
Change-Id: Ib9d08b8af34a99b25e11757fa7dc83673a7deb32
/frameworks/base/core/java/android/os/UserManager.java
988ae30ff7729ac0e9a44ee665c7e00f1961e7cd 18-Sep-2014 Adam Powell <adamp@google.com> Fix UserManager#isUserAGoat

Correctly detect if the user is a goat.

Change-Id: I78577dd7ec8c3685434ee03560010a6ea4db127f
/frameworks/base/core/java/android/os/UserManager.java
64d4dca63f65e4c7d4a829c85ff6670bdd34e2eb 28-Aug-2014 Alexandra Gherghina <alexgherghina@google.com> Assign default icon to users at creation time and in SystemUI.

Right now different code in System UI, Settings app and other places replace the
user icon with their own default. This tries to make it consistent by moving the
mechanism used in Settings in a helper class.

Bug: 17311038
Change-Id: Ic858c65bf82a98b9806dbba029e7cdcf441f372e
/frameworks/base/core/java/android/os/UserManager.java
8cd28b57ed732656d002d97879e15c5695b54fff 09-Jun-2014 Amith Yamasani <yamasani@google.com> Apply cross-user restrictions to Shell

Even though Shell user is allowed to perform cross-user actions,
lock that path down if the target user has restrictions imposed by
the profile owner device admin that prevents access via adb.

If the profile owner has imposed DISALLOW_DEBUGGING_FEATURES, don't
allow the shell user to make the following types of calls:
start activities, make service calls, access content providers,
send broadcasts, block/unblock packages, clear user data, etc.

Bug: 15086577
Change-Id: I9669fc165953076f786ed51cbc17d20d6fa995c3
/frameworks/base/core/java/android/os/UserManager.java
26af829fd70609cf073b56e54e1f78faf83a5e8b 09-Sep-2014 Amith Yamasani <yamasani@google.com> User restriction to disallow outgoing NFC beam

This can be controlled by MDMs via DPM.

Also fixes:
- javadoc for restrictions
- persisting of cross profile copy/paste restriction

Bug: 17387303
Change-Id: Ie148f56189181d2a4c6345c0823d417ab13a94a3
/frameworks/base/core/java/android/os/UserManager.java
c7d62f02b8acfd0a6b31f8544ec2c07e780fe4bb 05-Sep-2014 Svetoslav <svetoslavganov@google.com> Addressing API council comments for UserManager.

bug:17390424

Change-Id: I498d2541289915cb7db16e5c3249ccc7a7dc5ee6
/frameworks/base/core/java/android/os/UserManager.java
29ce85bab94a2d0dc98d9075ae86c8a282367117 04-Sep-2014 Amith Yamasani <yamasani@google.com> Don't allow guests to install from unknown sources

Added a user restriction when creating a guest.
Made sure that guests can't install profile owners that
could undo the restriction.

Bug: 17359648
Change-Id: Icdd919e8b1cbd79a69aacb76e573ec3449f18e4c
/frameworks/base/core/java/android/os/UserManager.java
0e8d7d63ba439cc0604af7055679dae3d30fdc48 03-Sep-2014 Amith Yamasani <yamasani@google.com> Add some @SystemApi tags for internal user-related APIs

Also added an internal isManagedProfile()

Bug: 17371392
Change-Id: Ibcc26771d954505cbd530192bf4a8a25a8d4cae0
/frameworks/base/core/java/android/os/UserManager.java
1df1473008c24487701c5bc15f39ed9f9697f421 30-Aug-2014 Amith Yamasani <yamasani@google.com> Make it possible to remove current user

Due to the async nature of switching users, it's not possible to
switch and remove immediately. So mark the switch target user as
soon as the user switch is requested, so that a remove will proceed
without failing at stopUserLocked().

Also, fix a similar problem with deleting the current guest and
switching to a new guest. It was attempting to remove the current
user which will result in a failed stopping of the user.
Added a way to mark the current guest
for deletion so that a new one can be created, switched to and the
old one deleted. If runtime fails, old guest is already marked for
deletion and will be cleaned up on restart.

Bug: 17321533
Change-Id: I4be0fb956227e0bb95588b5b1f2867fb1e655c0d
/frameworks/base/core/java/android/os/UserManager.java
2cb384f42569f36e19ecee60da259d69048fdd85 13-Aug-2014 Julia Reynolds <juliacr@google.com> Prevent profile owners from setting certain user restrictions.

Bug: 16351901
Bug: 16701492
Change-Id: Ie866bc24d2d7cc15f86c5b50062a730e099612a1
/frameworks/base/core/java/android/os/UserManager.java
681bf60ce2a3973d5982f9b7a405bcef5fb72f20 18-Aug-2014 Sunny Goyal <sunnygoyal@google.com> Fixing bounds check.

Change-Id: Ie17b173ef88288076a5cbfdc741b8e105dcda03e
/frameworks/base/core/java/android/os/UserManager.java
d97a0e7281e3e8d3884ed580d4db4c97331509ed 15-Aug-2014 Amith Yamasani <yamasani@google.com> Merge "Copy certain settings to the managed profile" into lmp-dev
4f7e2e334e4ca5f1a67baf4bdd40cd080b954161 15-Aug-2014 Amith Yamasani <yamasani@google.com> Copy certain settings to the managed profile

All reads of those specific settings will go to the primary user.
Inserts to primary also go to managed profiles in order to notify
any observers.

This enables Location settings to be shared by both profiles.
Also some other settings related to IME and Accessibility since
those services are shared across the profiles.

Bug: 16457210
Change-Id: Ib8fd697b5c78027fcbaf245d82dda5e6d6aab4f0
/frameworks/base/core/java/android/os/UserManager.java
d438deffad74ed5cc37b68100577215b9f08e6ff 15-Aug-2014 Julia Reynolds <juliacr@google.com> Merge "Apply lockdowns when user restrictions are set." into lmp-dev
3d9eb78fe91ab2479eb38443aed588e10421e31b 11-Aug-2014 Julia Reynolds <juliacr@google.com> Apply lockdowns when user restrictions are set.

Previously DMAgent would apply these lockdowns before/
after setting the matching user restrictions.

Bug: 16701642
Bug: 16945830
Bug: 16944983
Change-Id: Ib4f7145055687f12408d6ccacd8e6380406a32b2
/frameworks/base/core/java/android/os/UserManager.java
95ab7849444125387dc88088bb5197ee463d8c17 12-Aug-2014 Amith Yamasani <yamasani@google.com> Decouple user limit from guest creation

Allow Guest to be created even if there are N users.
Allow N users to be created even if there are N-1 users
and a Guest.
Limit number of guests and managed profiles that can
be added.

Added unit tests.

Bug: 15934700
Change-Id: I1a8f0fa38a91d71ef7b2980e05c974244dfc337a
/frameworks/base/core/java/android/os/UserManager.java
c08cb0ed7a01cd076e8277e49e1492eeab09e9fa 07-Aug-2014 Kenny Guy <kennyguy@google.com> Revert "Revert "Remove String version of getBadgedLabel""

This reverts commit 82020f109d78af889dfc5e86ede04c54fb6f1de2.

Bug: 16484455
Change-Id: I601edbb705cacd29bf30f90c8666c5f516796ebb
/frameworks/base/core/java/android/os/UserManager.java
9962f335a176508c30e539565ad63518fa8ca0d1 07-Aug-2014 Kenny Guy <kennyguy@google.com> Revert "Remove String version of getBadgedLabel"

This reverts commit ed0096c14ae1b17845bc9bb8fbb1cdc47adfdd68.

Change-Id: If026db7e804be81aaa02cfd2a4e1a0a03ee020f1
/frameworks/base/core/java/android/os/UserManager.java
4a4f275f24f6673c435c5205522273ba3500dbcc 07-Aug-2014 Kenny Guy <kennyguy@google.com> Remove String version of getBadgedLabel

It was left to allow unbundled apps time to update.

Bug: 16484455
Change-Id: Ibae2576ac7fc88000ec81c669e66536aaa2e3e79
/frameworks/base/core/java/android/os/UserManager.java
c71c42fdb2ee54a419dc8eb0a5f4f82532b16c0c 06-Aug-2014 Svetoslav <svetoslavganov@google.com> Polish of the app widgets cross-profiles feature.

1. Added API for badging an arbitrary drawable at a given location.

2. Updated the icon and previewImage deprecation as they are no longer
returning a badged drawable. The methods to load the icon and the
preview are now just making it easier for a developer to get the
drawables.

3. Fixed a bug in AppWidgetServiceImpl leading to a crash when a user
is removed.

4. Fixed a bug in AppWidgetHost which was unnecessarily caching its
package name and having code paths where the cached value was not
populated when calling into the system.

bug:14991269

Change-Id: I50d011a6597d88814715d5ec04ee67815e8ce0bd
/frameworks/base/core/java/android/os/UserManager.java
8616af1a4dd1877996fbd5bb0179659f4f123573 31-Jul-2014 Amith Yamasani <yamasani@google.com> Setup correct initial guest restrictions

Disable SMS by default, in addition to any other the primary
user may have set.

Bug: 16474761
Change-Id: I67b510ac72c2adfcafd95fb34e50ab5d8194090a
/frameworks/base/core/java/android/os/UserManager.java
12451a39f480dde93a9280c1f289625eab92881f 30-Jul-2014 Julia Reynolds <juliacr@google.com> Merge "API council - DISALLOW_APPS_CONTROL -- need better documentation." into lmp-dev
c617f815453b6e70a0165924907e69a0f993e651 25-Jul-2014 Julia Reynolds <juliacr@google.com> API council - DISALLOW_APPS_CONTROL -- need better documentation.

Bug: 16401636
Change-Id: I168033eaabdb953d8e73f63792a7e729eb9eeff6
/frameworks/base/core/java/android/os/UserManager.java
bf3a9465483976dcd5692b619b47132c2b95f73e 28-Jul-2014 Amith Yamasani <yamasani@google.com> Set profile owner via an intent

priv apps can request to become a profile owner after setup has
completed. This will pop up a consent dialog (in Settings).

Also, clean up profile owner concept to be a component name.

Change-Id: I5e8532866e8018f61836c4e84fbbadb6150218ae
/frameworks/base/core/java/android/os/UserManager.java
237aecd18d0edf56c038761f570758c310c9e6df 21-Jul-2014 Kenny Guy <kennyguy@google.com> Change getBadgedLabelForUser to use CharSequence

Bug: 16401636
Change-Id: I45410a6293007dd789d6770d63397824559b756e
/frameworks/base/core/java/android/os/UserManager.java
f1939901d2ed0480069f0b23be64f122fce93995 25-Jun-2014 Nicolas Prevot <nprevot@google.com> Making the clipboard work across users.

When copying from the parent: the ClipData can be pasted in the managed profile.
When copying from a managed profile: it can be pasted in the parent,
unless the policies says it's disabled. In which case, the clipboard of the parent becomes empty.
Supporting content uris.

BUG: 15186236

Change-Id: I522564a7c07ff21df137adcda980bb52e5739964
/frameworks/base/core/java/android/os/UserManager.java
390989da1967f9d385212cd2e22a50589ce69046 17-Jul-2014 Amith Yamasani <yamasani@google.com> Split telephony restrictions into outgoing calls and sms

DISALLOW_TELEPHONY renamed to DISALLOW_OUTGOING_CALLS and introduced
DISALLOW_SMS.

Outgoing emergency calls should always be permitted.

Change-Id: I0a38ef6e2df9dcf62d16fd93622ad61f4327614f
/frameworks/base/core/java/android/os/UserManager.java
5b8224901b5de0cfe7b4a1d3cb158e38243ef99f 17-Jul-2014 Julia Reynolds <juliacr@google.com> Update message on DISALLOW_REMOVE_USERS constant.

Change-Id: I4f873eba4082278553ded830bb902fb3a3195d87
/frameworks/base/core/java/android/os/UserManager.java
409297da182267465adbc21cfb75a23e8d678117 11-Jul-2014 Dianne Hackborn <hackbod@google.com> Allow INTERACT_ACROSS_USERS for service access.

But only if the two users are in the same profile. Also
apply the same rule for the recently allowed interaction
across content providers.

The activity manager now keeps track of which users are in
the same profile group, and the handleIncomingUser function has
an option to allow a non-full caller to do the interaction
if the two users are in the same profile group.

Spread this joy all over the place.

Also turn off multi-user on Svelte devices.

Change-Id: I231484ea2a6bfccbb3cd51357d7a387bd75039ea
/frameworks/base/core/java/android/os/UserManager.java
1c7c319bb89b9988bfd12afc3e8d89449fd163fc 26-Jun-2014 Jason Monk <jmonk@google.com> User restriction for disallowing window creation

Block any types of windows that could by used by apps to create
views on top of a locked app. This can be used by device admins
in conjunction with lock task mode.

Added a way for system (and priv apps) to bypass user restrictions
for specified op codes.

Bug: 15279535
Change-Id: I2381530ef6226a5bb32a99bb4030baafb39bf564
/frameworks/base/core/java/android/os/UserManager.java
e4afaa3a3d7c2885b82fe43f51bcf04e036f7462 30-Jun-2014 Amith Yamasani <yamasani@google.com> Store and retrieve default Guest settings

Save the default guest restrictions for use when a guest is created.

Bug: 15761405
Change-Id: I28db7d823944b0b47527a4909c10cc856c842a62
/frameworks/base/core/java/android/os/UserManager.java
f7ecf7c80520c017255cb350d183f0b62022349b 18-Jun-2014 Kenny Guy <kennyguy@google.com> Add badging a label to support accessibility.

To provide a way to differntiate the content description
of an icon that has been badged with a managed profile
badge.

Bug: 15106236
Change-Id: Icd5798bbd2410a105054877e3862e199eff24b88
/frameworks/base/core/java/android/os/UserManager.java
36fbc8d6453da438a8ab83352ff1bcfcba5f25b5 18-Jun-2014 Julia Reynolds <juliacr@google.com> Rename apps User Restriction.

Change-Id: I9f81a6b94ba06b593e7213967df51c7cb30a7b31
/frameworks/base/core/java/android/os/UserManager.java
a596ff87cd899640334512371456b8481ba21b4a 13-Jun-2014 Amith Yamasani <yamasani@google.com> Show user switcher if guest is enabled

even if there's only one user.

Bug: 15549064
Change-Id: Ib9bc5e6cdc6f2655e44ec0a10a701dd39389e648
/frameworks/base/core/java/android/os/UserManager.java
1e9c21871e81642669079cd290ef47818a3165bd 12-Jun-2014 Amith Yamasani <yamasani@google.com> Guest user first iteration

Setting for controlling if guest is enabled on the device.
Setting to hint to apps that they should skip showing first use clings.

User switcher handles creation and deletion of the guest user.
Some tweaks to the user switcher to show some feedback and make the icons
circular.

Change-Id: I187dc381d2ee7c372ec6d35e14aa9ea4dfbe5936
/frameworks/base/core/java/android/os/UserManager.java
03f5ff482e58474e9da7a2213fb96d0e0a877a4b 09-Jun-2014 Julia Reynolds <juliacr@google.com> Merge "Unhide UserManager.hasUserRestriction()."
2b2cf72f10f13d9314a1c53386188ed48e12d47c 06-Jun-2014 Julia Reynolds <juliacr@google.com> Unhide UserManager.hasUserRestriction().

Bug: 15466331
Change-Id: I83a0a77ffcb9781ec0517aed219ee9012137676f
/frameworks/base/core/java/android/os/UserManager.java
701ea7cf86b7d408b8d3bc1aab054be0333e1f26 09-May-2014 Kenny Guy <kennyguy@google.com> Badge notification from managed profiles.

Add a method to the UserManager to provide access
to bitmap of badge for managed profile.
Overlay the icon view in notification templates with
the badge from the UserManager.
Notifications with custom views won't be badged.

Bug: 12641490

Change-Id: I1f2aae927e75fc8a955e4d5bbc3cc81127d87069
/frameworks/base/core/java/android/os/UserManager.java
9f6c25f57e26f3e2f9c744547a139d14b7d3db5c 16-May-2014 Amith Yamasani <yamasani@google.com> Per-user telephony restrictions

Allow profile owners or administrators of restricted profiles
to restrict access to telephony features such as calling and
texting for a user.

Change-Id: I89f97608c07c647ad8a7b43fef9d1e6bc4a84e95
/frameworks/base/core/java/android/os/UserManager.java
be81c800ae6216e30b6008b4c73172b36531c405 22-Apr-2014 Jessica Hummel <jhummel@google.com> Add api for getting the parent of a profile.

Change-Id: Ife59665cdf6531a118d74def864c8cfc92c92a42
/frameworks/base/core/java/android/os/UserManager.java
394a6cdd987fed79bd040f39e2d3e47d4484bab4 07-May-2014 Emily Bernier <ember@google.com> New user restrictions for EDU

New user restrictions will allow schools to prevent students from 1) using
device microphones, 2) adjusting device volume, and 3) mounting physical
external media.

Change-Id: Ib2fcb7ce8fbc489a25d2c97a122b2124012a9e3c
/frameworks/base/core/java/android/os/UserManager.java
d46d0f9dcd72dfaa93a57d07d896def6ce53bbae 23-Apr-2014 Julia Reynolds <juliacr@google.com> Add new EDU user restrictions.

Change-Id: I6aad10466d99cda6be378c72025df686fe665071
/frameworks/base/core/java/android/os/UserManager.java
973a1d27417d22add96d716bfce702a48543931b 01-May-2014 Alexandra Gherghina <alexgherghina@google.com> Merge "Revert "Temporarily switch off returning only enabled profiles to support dogfooding""
df35d570ed25257c6782e632ab1bae5e1603855a 09-Apr-2014 Alexandra Gherghina <alexgherghina@google.com> Adds an enabled state in UserInfo instead of DevicePolicyManager

Bug: 14377459
Change-Id: Ib4ec43d87da96c3dddaf9b7ae1796f261863a182
/frameworks/base/core/java/android/os/UserManager.java
f2e7b3f56ae0ea9f49b5c50413b9be71d5249d6d 30-Apr-2014 Alexandra Gherghina <alexgherghina@google.com> Revert "Temporarily switch off returning only enabled profiles to support dogfooding"

This reverts commit 199c35a21ea9bddde80fdb435ec604f729b0cbe7 because client code has been updated.

Bug: 14132551
Change-Id: I7159087dfaded6f2bfe90ef103f74b242acb166c
/frameworks/base/core/java/android/os/UserManager.java
250bb6e3e045a88022db526b074e7ab38c47d93c 25-Apr-2014 Amith Yamasani <yamasani@google.com> Merge "Allow profile owners to set user restrictions"
92d6aea86e5fbe59b6dd1dcc157118b1c57d7a57 25-Apr-2014 Alexandra Gherghina <alexgherghina@google.com> Temporarily switch off returning only enabled profiles to support dogfooding

Bug: 14132551
Change-Id: I3679c8fc248a799c816e5b80641b1fca6b7af061
/frameworks/base/core/java/android/os/UserManager.java
be46532c9fbebf3ab6498c1b78013a33f620cd31 24-Apr-2014 Amith Yamasani <yamasani@google.com> Allow profile owners to set user restrictions

Pass the setting along to UserManager.

Fixes a security exception when fetching the profile's enabled state.

Change-Id: If71698cf32c52cce1158cf2027443a339bc58488
/frameworks/base/core/java/android/os/UserManager.java
385124d8cee38dee00d4fac31e8fbe46fb30565b 03-Apr-2014 Alexandra Gherghina <alexgherghina@google.com> Modify getUserProfiles to return only enabled profiles:

Add a new enabled state for a managed profile.
Expose that as a new API on DevicePolicyManager.
Set the new state when enabling the profile.
Return only enabled profiles from the user manager.

Bug: 13755441
Bug: 13755091
Change-Id: I2907b182e19b3562592da688b3f68ef5f4088557
/frameworks/base/core/java/android/os/UserManager.java
9c32cd498a8067d4487a97fbf93d8587bfcec1fd 23-Apr-2014 Emily Bernier <ember@google.com> Fix build.

Don't link to MANAGE_USERS permission in Javadoc.

Change-Id: Iad1391a0281a3fad06529a86b277f787791e94fc
/frameworks/base/core/java/android/os/UserManager.java
7a2b4d11c741de8b78570c0e11f49deb165e35da 23-Apr-2014 Emily Bernier <ember@google.com> Allow device or profile owner app to modify user restrictions.

Currently this is gated on being a system or root app with the
MANAGE_USERS permission; third-party MDM apps set as device or profile
owner should have this ability as well.

Bug: 13585295

Change-Id: I61d21b13b9ec66fc0cb497ec2007ee732461d448
/frameworks/base/core/java/android/os/UserManager.java
7dda2657be1fcc808566dab3482df9d643ceb0f5 11-Apr-2014 Amith Yamasani <yamasani@google.com> Expose an API to generate a badged icon for managed profiles.

Change-Id: I6257f43934ba6eefe752003942d8d3bcf207d5f9
/frameworks/base/core/java/android/os/UserManager.java
9d43dc5e4eba1bf96f0b8fa5deae5ee61a7f85ad 09-Apr-2014 Kenny Guy <kennyguy@google.com> Merge "Finish rename of related users to profiles."
5abdbb656063160ff8df2306bd01feba0714d4c1 09-Apr-2014 Amith Yamasani <yamasani@google.com> Avoid security exception when requesting badging

When requesting badged icons, use APIs that don't require the caller
to have MANAGE_USERS permission.

Change-Id: I218cdf5194f38f4affa1874a6fcb43a040ed5295
/frameworks/base/core/java/android/os/UserManager.java
4f58263d02f296430a9653126d28501e95c7bb6c 19-Feb-2014 Amith Yamasani <yamasani@google.com> Launcher APIs and broadcasts for managed profiles

UserManager
- Corp badging
- Querying list of managed profiles

Launcher API
- LauncherApps and Service to proxy changes in managed profile
to the launcher in the primary profile
- Querying and launching launchable apps across profiles

Change-Id: Id8f7b4201afdfb5f414d04156d7b81300119289e
/frameworks/base/core/java/android/os/UserManager.java
abf564ac9c4c2e2ae5063932cc5d5cf947b07015 02-Apr-2014 Kenny Guy <kennyguy@google.com> Finish rename of related users to profiles.

Clean up methods left to avoid multi project commit.

Change-Id: Ibf506af2a4bcbbd7c8044b3f62a68761451242c7
/frameworks/base/core/java/android/os/UserManager.java
2a764949c943681a4d25a17a0b203a0127a4a486 02-Apr-2014 Kenny Guy <kennyguy@google.com> Rename related users to profiles.

Rename the related user concept as profiles.
When returning profiles of a user include the
user as a profile of itself.

Change-Id: Id5d4f29017b7ca6844632ce643f10331ad733e1d
/frameworks/base/core/java/android/os/UserManager.java
1a447535cef7e3739d5f763dfe13e568568b9789 20-Feb-2014 Kenny Guy <kennyguy@google.com> Hide managed profiles from user switchers.

Hide managed profiles from lockscreen user switcher on tablets.
Hide managed profiles from power menu user switcher on phones.
Add flag to enable multi user ui turned off by default.

Change-Id: I4c69a6f7b0f39c249fc85fd940318df1ddab073f
/frameworks/base/core/java/android/os/UserManager.java
a52dc3eb40777b055c0ca8d7885bd2c9577bcd1a 11-Feb-2014 Kenny Guy <kennyguy@google.com> Add concepts of related users and managed profiles to user manager.

Related users are a group that will share things like notifications.
Managed profiles are a profile of another user.

Change-Id: I2d0532f1abf939810f0fa3fc7c77ad13fa567833
/frameworks/base/core/java/android/os/UserManager.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
/frameworks/base/core/java/android/os/UserManager.java
d304af69891483aad808356af1ac5f00e90c8edf 05-Sep-2013 Amith Yamasani <yamasani@google.com> Remove unused APIs and rename others based on API review

Restrictions challenge is only to be used by device admins.

Bug: 10461761
Change-Id: I3db1249e2ce99f386602de59ed930302bb0a97fb
/frameworks/base/core/java/android/os/UserManager.java
b12ba933f3db9280edcb6a3591741d29c109a4e2 04-Sep-2013 David Christie <dnchrist@google.com> Make location QuickSettings multi-user compatible (b/10563313)

Change-Id: I8ae5238e66fa2d6890ffe5697d3e6d5f50413c3e
/frameworks/base/core/java/android/os/UserManager.java
0343ec3abb205b21d554ab432710ff854f3d9d75 22-Jul-2013 Amith Yamasani <yamasani@google.com> User restriction API to disable single-user restrictions feature.

Change-Id: I80e08b38b5e32f3cb1af51398907510508ec199f
/frameworks/base/core/java/android/os/UserManager.java
1a7472e7220a2b027464fb4a2281550f784a2ca3 02-Jul-2013 Amith Yamasani <yamasani@google.com> Have UserManagerService clear the restrictions and unblock apps

Since this is an operation that could take a few seconds to run and needs to be
completed even if Settings dies, best to do it in the user manager.

Refactored PIN challenge/setup UI with a field to verify existing pin
when changing to a new one.

Change-Id: I0b7df5b2ccb7f343aa9282a9245d3bc2b577a794
/frameworks/base/core/java/android/os/UserManager.java
655d0e2029e6ae77a47e922dce4c4989818b8dd1 12-Jun-2013 Amith Yamasani <yamasani@google.com> Single-user restrictions

Introduces a new "blocked" state for each package. This is used to temporarily
disable an app via Settings->Restrictions.

PIN creation and challenge activities for use by Settings and other apps. PIN
is stored by the User Manager and it manages the interval for retry attempts
across reboots.

Change-Id: I4915329d1f72399bbcaf93a9ca9c0d2e69d098dd
/frameworks/base/core/java/android/os/UserManager.java
2555dafce87e60fae28d71913730abf73e40fcd7 25-Apr-2013 Amith Yamasani <yamasani@google.com> Hide isLinkedUser()

It's not the best API to use to determine anything. Defer to other
APIs such as UserManager.getUserRestrictions()

Bug: 8720520
Change-Id: Ie49589056ab52b4fdbcc736f8cdefadb8ba5d9d8
/frameworks/base/core/java/android/os/UserManager.java
7e99bc02c8e2f44dd92d70bfa6e654297e5286d8 17-Apr-2013 Amith Yamasani <yamasani@google.com> Modify restrictions bundle per api council recommendations

Use a Bundle for persisting and passing to the application, but use a
list to return data back from an application that's exposing restrictions.

Changed the xml reading/writing code to store the value type in the Bundle
so that it can be reproduced when reading. Earlier we were assuming only
String and String[].

Bug: 8633967

Change-Id: I523d5553728edcf28a1e9d432f490b4956f34215
/frameworks/base/core/java/android/os/UserManager.java
e1375908a5f05e5c926e95049970c4505e4dfad9 14-Apr-2013 Amith Yamasani <yamasani@google.com> Rename isUserLimited to isLinkedUser

A linked user is derived from another user and shares their accounts.

Change-Id: Ia2e63d573ccb635495ec54f31ac7b174725ad7a8
/frameworks/base/core/java/android/os/UserManager.java
46bc4ebb87232b39d7b02ac0135c8ccf2c33f233 12-Apr-2013 Amith Yamasani <yamasani@google.com> Rename isUserRestricted to isUserLimited

Avoid confusion with user restrictions which can be applied to
non-limited users as well.

Updated the java docs.

Change-Id: I4097c50b528b01a49cebcb0832d09f2b06998faa
/frameworks/base/core/java/android/os/UserManager.java
b223f73a69f76f5e32a0bca267f945f464776f9d 11-Apr-2013 Emily Bernier <ember@google.com> Add user restrictions (credentials, user removal)

Created constants in current.txt and UserManager.java, modified restrictions access in UserManagerService.java.

Change-Id: If8d778d84af81dcbf5784f6e0afd9ef966cc8ecf
/frameworks/base/core/java/android/os/UserManager.java
27db46850b708070452c0ce49daf5f79503fbde6 31-Mar-2013 Amith Yamasani <yamasani@google.com> Block access to accounts for limited users.

Make sure that apps that have access to restricted accounts can see them.
If they don't have access, they shouldn't be able to add a new account either.
Show an error message in the account picker if the user/app is not authorized.

Change-Id: I117c0b14d7d06c5ac4e66506df156b174567f5f3
/frameworks/base/core/java/android/os/UserManager.java
a12fccf57d5ec289793699d9b22ff45daccd3933 14-Mar-2013 Maggie Benthall <mbenthall@google.com> Add user restrictions for bluetooth, sideloading, usb file transfer

Created constants for these in UserManager and current.txt. Also created
an accessor for individual user restrictions that takes the restriction key
(removing individual methods for particular restrictions).

Change-Id: Ibb5517cbcdffadd3925f52cbe67d7d525813faa9
/frameworks/base/core/java/android/os/UserManager.java
ca050adc13b48c58c978255dd5ce6d9654549cb0 27-Mar-2013 Amith Yamasani <yamasani@google.com> Fix docs build.

Change-Id: I959db164f0ed7badfcdf921ffa1bfff60b4fb952
/frameworks/base/core/java/android/os/UserManager.java
71e6c697e54a43d357cc25d87a446d140f17396a 25-Mar-2013 Amith Yamasani <yamasani@google.com> Device Owner, a special kind of device admin

A Device Owner cannot be uninstalled and is available to all users. It must
be registered before the device_provisioned flag is set.

Device admins can be disabled until used, but visible to device policy
manager, so that users wont be bothered with update requests.

Opened up a few related APIs for use by a system-installed Device Owner.

Change-Id: I847b5fe68c0f724863f778a67602b5bddc79d8e5
/frameworks/base/core/java/android/os/UserManager.java
df2e92a535e19c00edd37318d974dab992ccc2c1 02-Mar-2013 Amith Yamasani <yamasani@google.com> Application restrictions API

Adds the ability for apps to export some restrictions. The restrictions
are presented in Settings based on the restriction type. The user's
selections are stored by UserManagerService and provided to the
target user's application as a list of RestrictionEntry objects which
contain the key, value(s).

Also introduce a manifest entry for system apps to request that the
app be automatically installed in all users, so that they cannot be
deselected by the owner user.

Shared account filtering for non-whitelisted apps.

Change-Id: I15b741e3c0f3448883cb364c130783f1f6ea7ce6
/frameworks/base/core/java/android/os/UserManager.java
6794458f8626c3be27eac3db3a5c89d94f132675 22-Feb-2013 Maggie Benthall <mbenthall@google.com> Add location sharing toggle user restriction.

And add support for respecting it.

Change-Id: Ia5cf9134c5f5741c3f55afadbe54f862da7bfe5b
/frameworks/base/core/java/android/os/UserManager.java
e4cf73437a18c1444055f88a1fcc0d146ec23ac5 17-Dec-2012 Amith Yamasani <yamasani@google.com> Starting point for User Restrictions API

Restrictions saved as key/value pairs, mostly booleans right now
but might be expanded to other types later.

Save and restore restrictions in the user manager service.
Enforce some of the restrictions at the framework level. Some
are enforced (also) at the app level, such as in Settings.

Change-Id: Id11ffe129cb6a177e094edf79635727388c26f40
/frameworks/base/core/java/android/os/UserManager.java
b26306ad5277097b3abb345112b24d9a142fb299 25-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7408647: Add getUserCount() API

Change-Id: Ib4e8e2300757e0941fae8fbc46c4323f5e2d7d6b
/frameworks/base/core/java/android/os/UserManager.java
ff54920ed222a2bd6abe618743a5a3e9fe10bd4b 12-Oct-2012 Amith Yamasani <yamasani@google.com> Temporarily disable multiuser for specific builds

Enable switching through power menu for other builds

Change-Id: I0bd8450583e078b0a83fb639337427ab84db5ab8
/frameworks/base/core/java/android/os/UserManager.java
a8a9bd65bf5865d83ef44f54552ca39522bfbcf0 10-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7311376: Add API to allow apps to know if they are...

...running as the foreground user

Add UserManager.isUserRunning() which is the public version of the
existing method on ActivityManager.

Also add UserManager.isUserRunningOrStopping() since that seems like
it will be useful.

And fix the internal function that returns the array of currently
running users to not include stopped users.

Change-Id: I84672fa8748fc027fd402729586b5603f640e498
/frameworks/base/core/java/android/os/UserManager.java
33f9cb8cf01e0a6288eb5b9ce724c56aa4e1e382 05-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7290206: Need API to get/look up user serial number

Change-Id: I1713215e7c205b1b66c36488f89e3fbf4572cb97
/frameworks/base/core/java/android/os/UserManager.java
466bd636812684aeb8161f144597cc3b3ed39078 21-Sep-2012 Dan Morrill <morrildl@google.com> Merge "New method returning user metadata." into jb-mr1-dev
920ace0bbc2d4133dbec991d2636c99a57d6245e 21-Sep-2012 Amith Yamasani <yamasani@google.com> Query users excluding any being removed

Keep track of user creation and last logged-in time.
adb shell dumpsys users
User switcher shouldn't show users about to be removed.
No need to check for singleton for activities.

Bug: 7194894
Change-Id: Ic9a59ea5bd544920479e191d1a1e8a77f8b6ddcf
/frameworks/base/core/java/android/os/UserManager.java
e4ab16ad98b183afbf7a21ad7314372de41a8b57 21-Sep-2012 Dan Morrill <morrildl@google.com> New method returning user metadata.

Change-Id: Ic1a42cf54152fe2e6bcd01b1bd9f1edb77d1710e
/frameworks/base/core/java/android/os/UserManager.java
4673e7ea8d1f869910a9c0f9c211d4d27ad50b41 19-Sep-2012 Jeff Sharkey <jsharkey@android.com> Migrate UI to supportsMultipleUsers().

Bug: 7194531
Change-Id: Ifbbe3b4d954f8d11fb1c94674e5e7f8e21264c75
/frameworks/base/core/java/android/os/UserManager.java
27bd34d9d9fe99f11b80aa0bbdb402fb47ef4158 16-Sep-2012 Jeff Sharkey <jsharkey@android.com> Multi-user MTP.

The current MTP kernel driver at /dev/mtp_usb is exclusive, meaning
only one process can have it open. In addition, each MTP session
with a desktop requires unique object IDs, which doesn't hold true
across users on the device.

To solve these two issues, when switching users we cycle the USB host
stack to disconnect both local and remote MTP connections, giving the
new user's media process a chance to claim /dev/mtp_usb, and causing
the desktop to initiate a new MTP session.

This change also allows BroadcastReceivers to registerReceiver()
allow retrieval of a current sticky broadcast. Adds a system property
to override maximum users. Removes MOUNTED broadcasts for secondary
users. Allows INTERACT_ACROSS_USERS to getCurrentUser().

Bug: 6925114
Change-Id: I02b4a1b535af95fb2142655887b6d15a8068d18a
/frameworks/base/core/java/android/os/UserManager.java
f7a6dfcafc1eaa8014b4fa796e4b31208f72fd36 18-Sep-2012 Amith Yamasani <yamasani@google.com> Merge "Pass Bitmap instead of ParcelFileDescriptor in UserManager" into jb-mr1-dev
e928d7d95dbb64627e6ff3a0572190c555b59d96 18-Sep-2012 Amith Yamasani <yamasani@google.com> Pass Bitmap instead of ParcelFileDescriptor in UserManager

Add a USER_INFO_CHANGED intent for lockscreen and quicksettings to use
to monitor changes to the user name or icon.

Bug: 7164040
Change-Id: Id6fb8b6d38ce04ccd02bbadcf0c10699783d6c03
/frameworks/base/core/java/android/os/UserManager.java
c33f94e2a50c9b03cb771237e8672743da8b1314 18-Sep-2012 Dianne Hackborn <hackbod@google.com> Merge "Fix API review bugs." into jb-mr1-dev
8832c18d8b63367929c2d394c9c508f56003d400 18-Sep-2012 Dianne Hackborn <hackbod@google.com> Fix API review bugs.

7173152 API REVIEW: android.content.pm.PackageUserState
7172969 API REVIEW: android.app.PendingIntent
7172730 API REVIEW: android.content.Context
7172726 API REVIEW: android.manifest.permission

Change-Id: Iad470256d3b5ca5596487f6a699ec1871457c3b5
/frameworks/base/core/java/android/os/UserManager.java
3b49f07a452e0a77c1d22db2065255689a461d31 17-Sep-2012 Amith Yamasani <yamasani@google.com> Add UserManager.getUserIcon()

So that we don't abuse the setUserIcon() for reading. So the new method won't try
to create the file, only return it if it exists.

Change-Id: I7a81d3f1b29d14d37e71f531744ce39f21d827ac
/frameworks/base/core/java/android/os/UserManager.java
1952637425eece18aa1ce3d80d4b49086ef3bcf7 22-Aug-2012 Amith Yamasani <yamasani@google.com> Remove permission requirement for some UserManager calls

Update javadocs to be explicit about permissions.
Minor fixes in UserManagerService

Change-Id: I0d355e0a60e5dbdb49ed06091111d480ff249f3d
/frameworks/base/core/java/android/os/UserManager.java
79af1dd54c16cde063152922b42c96d72ae9eca8 17-Aug-2012 Dianne Hackborn <hackbod@google.com> Switch public APIs to use new UserHandle class for identifying users.

Gets rid of "yet another integer" confusion.

Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
/frameworks/base/core/java/android/os/UserManager.java
2a00329c6d55c6cd9166e01963d7410e95d80d21 15-Aug-2012 Amith Yamasani <yamasani@google.com> UserHandle to UserSerialNo mapping

Use AtomicFile for usermanager files.

Added a MANAGE_USERS permission that apps (signature permission) can use
to create/query/modify/remove users.

Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
/frameworks/base/core/java/android/os/UserManager.java
258848d2ae04f447ff1c18023fa76b139fcc0862 11-Aug-2012 Amith Yamasani <yamasani@google.com> User Manager service to manage users and query user details

Moved a bunch of methods from PackageManager to UserManager.

Fix launching of activities from recents to correct user.

Guest creation APIs

Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
/frameworks/base/core/java/android/os/UserManager.java