468 Commits

Author SHA1 Message Date
Lenka Trochtova
a269c5d584 Merge "Add a flag for creating an ephemeral user with DevicePolicyManager#createAndManageUser." 2016-01-27 13:55:02 +00:00
Lenka Trochtova
c8202c8d1d Add a flag for creating an ephemeral user with
DevicePolicyManager#createAndManageUser.

BUG: 24883058

Change-Id: I225ee6f1f6692663349040676e7a6c742b3ede79
2016-01-27 10:45:24 +01:00
Clara Bayarri
d7693917a7 Check if the profile password would comply as the device lock
Bug: 26801330
Change-Id: Ide31464dd0292ca97b03abe08cdde5b41d517b66
2016-01-26 23:04:28 +00:00
Victor Chang
697815eddb Merge "Launch managed quick contacts without contact id" 2016-01-26 10:37:55 +00:00
Alan Treadway
44a1808154 Merge "Add explicit and persistent user provisioning state." 2016-01-26 09:59:40 +00:00
phweiss
a92e1216ca Make API createAndManageUser public
Remove @hide, and add parameter for specifying profile owner. The PO
has to live in the same package as the device owner.

Bug: 25288732
Bug: 25860170
Change-Id: I40e8984a71ee9d1ff74e57d4e79e298deef9bc35
2016-01-25 22:33:52 +01:00
Victor Chang
97bdacc6d1 Launch managed quick contacts without contact id
set contact id to enterprise base contact id if it's enterprise uri

BUG=26176780

Change-Id: Ie1160bef22d44c90eb4015783fafdafd160bcdd8
2016-01-25 21:32:44 +00:00
Robin Lee
ab83fd5739 Merge "DPMS organisation API - Add a missing checkNotNull" 2016-01-25 18:02:40 +00:00
Philipp Weiß
5f09616e6b Merge "Add new API function createAndManageUser" 2016-01-25 18:00:27 +00:00
Robin Lee
d48788c101 DPMS organisation API - Add a missing checkNotNull
Corrects a failing test.

Change-Id: I6be8a23caef53d1e9681733e5b340237952bd3e5
2016-01-25 17:49:35 +00:00
Alan Treadway
afad878369 Add explicit and persistent user provisioning state.
Add explicit modelling of provisioning state so that integration
of management provisioning flows with packages such as setup-wizard
are cleaner, and can be more direct. Previously we relied upon
USER_SETUP_COMPLETE secure setting and HOME intents to signal intent,
but this is not very clear and can be fragile.

Bug: 25858670
Change-Id: Idc56a040f710c3aee281db420f21717da3960722
2016-01-25 15:46:30 +00:00
phweiss
343fb33a9b Add new API function createAndManageUser
This is a reduced version of the (deprecated) function
createAndInitializeUser, that allows the device owner to create a
new user and pass a bundle with information for initialization. The
new version of the function has the same functionality, but the
profile owner of the new user is always the device owner.

A flag can be specified to skip the setup wizard for the new user.

The new user is not started in the background, as opposed to how
createAndInitializeUser did it. Instead, the bundle with
initialization information is stored and will be broadcast when the
user is started for the first time.

Bug: 25288732, 25860170
Change-Id: I4e1aea6d2b7821b412c131e88454dff5934192aa
2016-01-25 16:33:34 +01:00
Esteban Talavera
fe434a15d6 Merge "Add additional APIs supported work on the parent DPM instance" 2016-01-25 15:19:06 +00:00
Bartosz Fabianowski
4c052f237a Implement user affiliation
A user/profile is considered affiliated if it is managed by the same
entity as the device. This is determined by having the device owner and
profile owners specify a set of opaque affiliation ids each. If the sets
intersect, they must have come from the same source, which means that the
device owner and profile owner are controlled by the same entity.

BUG=25599229

Change-Id: I393fe0de70272307ed3c811aaba4b48a5109c562
2016-01-25 14:18:43 +01:00
Esteban Talavera
6239991850 Add additional APIs supported work on the parent DPM instance
Bug: 22543972
Change-Id: I05061e34d120c64d5c49ca6b7b4014d7dadb68f4
2016-01-25 12:57:12 +00:00
Benjamin Franz
947f3557a5 Merge "Add profile policy to set work challenge background color" 2016-01-22 12:59:24 +00:00
Benjamin Franz
59720bb2a6 Add profile policy to set work challenge background color
Adding a policy for profile owners to set the background color of the
confirm credential screen for the managed profile.

Bug: 26638631

Change-Id: Iea36b94c5a42b6ae12cc36921ec5f840306e81a1
2016-01-22 12:32:10 +00:00
Oleksandr Peletskyi
b7cc096fd4 Merge "Added restriction if a user is allowed to change the icon. BUG: 25305966" 2016-01-21 20:25:46 +00:00
Oleksandr Peletskyi
7f1f1dfc87 Added restriction if a user is allowed to change the icon.
BUG: 25305966

Change-Id: I3d527224f00087b2bd959879ebb143e2ecb9c914
2016-01-21 20:49:32 +01:00
Oleksandr Peletskyi
0fdcd3df83 Added new password quality constant PASSWORD_QUALITY_MANAGED to make it possible
to prevent user from unlock modification.
BUG: 25549437

Change-Id: Iae9adccbb8f9e1db8a21d596137f69f6cad54988
2016-01-20 14:44:22 +01:00
Michal Karpinski
45aab9d974 Applying finalized strings for remote bugreports
Bug: 26226230
Change-Id: I0764a2d8c67a5d14d91c3e3162f407c74adb7bf8
2016-01-18 11:08:29 +00:00
Michal Karpinski
a8c8851caa Merge "DPM changes to support remote bugreports" 2016-01-18 10:00:55 +00:00
Clara Bayarri
206747d9f6 Fix Device policy crashes after adding the account while checking isActivePasswordSufficient
The calls to LockPatternUtils#isSeparateProfileChallengeEnabled
require MANAGE_USERS permission, wrapped them in a clear identity

Bug: 26565169
Change-Id: I4a18cec3ae7beb13320350d4c3fdc63e4a7d741d
2016-01-15 15:19:35 +00:00
Robin Lee
b68d2d5b68 Merge "Always-on app VPNs" 2016-01-14 11:37:18 +00:00
Michal Karpinski
3fc437e89b DPM changes to support remote bugreports
Bug: 22860136
Change-Id: If984318e421f511d9b0fc7138aacd36d5334698f
2016-01-14 11:00:22 +00:00
Clara Bayarri
a1771110d6 Create Work Challenge per-user condition
Change the current static condition to a per-user condition so we
can check and enable/disable the work challenge properly. Also add
an isAllowed API, as the Work Challenge can only be used when the
user's DPC targets N or above to maintain backwards compatibility.

Change-Id: I0cb8b475838816801868ffb24726407aa257b4de
2016-01-13 10:27:12 +00:00
Robin Lee
244ce8ef5f Always-on app VPNs
Bug: 22547950
Change-Id: I46b204170bfac58d944f39b22f815b080de71a58
2016-01-12 19:54:54 +00:00
Victor Chang
c754dffe19 Merge "Create a new device policy for controlling work contacts search" 2016-01-12 11:51:01 +00:00
Victor Chang
1060c61866 Create a new device policy for controlling work contacts search
BUG=25981902

Change-Id: I5cea59d7d09bf54051ae0e56e824e4d3a08a49e7
2016-01-12 11:31:16 +00:00
Clara Bayarri
3e826effed Create parent APIs in DevicePolicyManager
This change creates the infrastructure for a parent
DPM and implements the actual parent APIs for
- set/getPasswordQuality
- isActivePasswordSufficient

This is part of the Separate Work Challenge

Change-Id: I0477051b3162cbb26aac79467da08932f22fd1b7
2016-01-07 10:55:24 +00:00
Jeff Sharkey
51f3908c6a Merge "Consistent naming for PackageManager methods." 2016-01-06 22:26:16 +00:00
Jeff Sharkey
e06b4d1d9f Consistent naming for PackageManager methods.
When hidden PackageManager methods take a userId argument, they
should be named explicitly with the "AsUser" suffix.  This fixes
several lagging examples so that we can pave the way to safely
start passing flags to new methods without scary overloading.

Also fix spacing issues in various logging statements.

Change-Id: I1e42f7f66427410275df713bea04f6e0445fba28
2016-01-06 15:21:06 -07:00
Kenny Guy
06de4e77c2 Add support message for device admins
Allow admins to set a long and short support
message for settings to display.

Bug: 25659579
Change-Id: Ib645490785642e49c69d8dbc65455eb3398547ee
2016-01-05 19:07:04 +00:00
Sudheer Shanka
137241c714 Update an error message.
Change-Id: Ifc32120ccccd14e8e821770995de91008ed518d7
2015-12-30 18:09:10 +00:00
Esteban Talavera
f3378a29e9 Merge "Device or profile owner can let another app manage app restrictions" 2015-12-17 10:59:16 +00:00
Mahaver Chopra
699d537d1b Merge "Adding DPM.reboot" 2015-12-17 10:59:01 +00:00
Esteban Talavera
bf60f728cc Device or profile owner can let another app manage app restrictions
The device or profile owner can allow another
package to set app restrictions for any app in that user

Similar to the way it can give permission to access
CA certificate related APIs from M.

Bug: 22541936
Change-Id: I0c1b0804ad300dfa4fbdc1c7721c5d8653d77861
2015-12-17 10:57:09 +00:00
Andrei Stingaceanu
1e2839188f Wire call to suspend a package
Adds APIs in DevicePolicyManager and PackageManager for allowing
a device admin to suspend a package. PackageManagerService sets
or unsets a new PackageUserState 'suspended' setting. Terminal
command to suspend/unsuspend has been added via
PackageManagerShellCommand (as root).

Next steps:
* use the new 'suspended' setting for denying access to start app
(probably in ActivityStackSupervisor)
* broadcast a PACKAGE_(UN)SUSPENDED intent for launchers to pick up
* remove app from recents (go further and kill it if it is running)
* erase existing notifications for this app

Bug: 22776576
Change-Id: I718b3498f6a53cc0c6fdfb6d15031e53ddca4353
2015-12-16 18:14:14 +00:00
Mahaver Chopra
1ce53bc571 Adding DPM.reboot
Adding new policy in DPM to trigger reboot on the device.
Requirement: Device owner can reboot the device if it is stuck or is
not useable due to some unresponsive UI.

Bug: 25304994
Change-Id: I7a6d5c8ad611de9c1cf6619378e492a306b41626
2015-12-16 17:55:54 +00:00
Esteban Talavera
5b9f167a8e 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
2015-12-15 18:36:34 +00:00
Makoto Onuki
055d8396ef Merge "Allow PO to set DO restrictions if it's on user 0" 2015-12-11 18:14:19 +00:00
Makoto Onuki
5485ed46ff Allow PO to set DO restrictions if it's on user 0
Bug 26091525

Change-Id: Ie6d2cd4ade076d8d2ec47243ff1280b95b7c9044
2015-12-10 15:54:26 -08:00
Makoto Onuki
55c46f291d Clean up DPM/DPMS to reduce code size.
Change-Id: Id6c1666ef4cdba795e3b6e4ddcb9c32e6ee90665
2015-12-10 15:38:32 -08:00
Robin Lee
fbc65644b9 DevicePolicy API to remove an installed KeyPair
The keypair is specified by alias and removed via a call to the
KeyChainService, which will have installed the pair in the first place.

Bug: 22541933
Change-Id: I37317e7c22e89816156e6e9a7abf4c5a59e8440a
2015-12-08 16:40:56 +00:00
Robin Lee
ee3a437464 Send pwchange broadcast to caller only in FBE case
When per-user encryption is set up and we change the password of a
profile, the parent and other profiles shouldn't receive an
ACTION_PASSWORD_CHANGED as they have their own distinct passwords.

Change-Id: I70d4ec81277a9bdc3ac6cd952b84cd769a2800b4
2015-12-07 13:39:11 +00:00
Clara Bayarri
10ad84a17d Create a separate Work Challenge check
This allows us to tell lock checks from FBE checks separately,
and will be useful when dealing with password unification.

Change-Id: Ifbea425f749fee4d6d51faddd8b64bf717a1a5f8
2015-12-03 16:18:53 +00:00
Clara Bayarri
29fcf1b1db Apply Admin password restrictions to work profile
When the Work Challenge is in place, re-route the
enforcing of Admin policies on the password to the
work profile. The Admin should not be allowed to
dictate policies on the device lock in this case.

This is part of the Separate Work Challenge feature.

Change-Id: I757973e540797b5fb10bea7a2fd1925561655bc9
2015-12-03 16:18:53 +00:00
Robin Lee
968dea0969 DPMS: Replace ArrayList<>(1) with SingletonList
Change-Id: I78f8230d959f17c3aa2f248122973a8cd5c96693
2015-12-03 14:54:38 +00:00
Robin Lee
574f038a57 Resolve merge conflicts of 5ec51457e1 to master.
Change-Id: I70c12ad663c3b4d3b5e3b8f40bc659cb94d82c14
2015-12-02 13:48:32 +00:00
Svet Ganov
9c165d7601 Add optional permission review for legacy apps - framework
For some markets we have to allow the user to review permissions
for legacy apps at runtime despite them not supporting the new
permission model. This is achieved by showing a review UI before
launching any app component. If an update is installed the user
should see a permission review UI for the newly requested
permissions.

To allow distinguishing which permissions need a review we set
a special flag in the permission flags that a review is required.
This flag is set if a runtime permission is granted to a legacy
app and the system does not launch any app components until this
flag is cleared. Since install permissions are shared across all
users the dangerous permissions for legacy apps in review mode
are represented as always granted runtime permissions since the
reivew requirement is on a per user basis.

Whether the build supports permission review for legacy apps is
determined by a build constant allowing us to compile away the
unnecessary code for markets that do not require a permissions
review.

If an app launches an activity in another app that has some
permissions needing review, we launch the permissions review
UI and pass it a pending intent to launch the activity after
the review is completed.

If an app sends a broadcast to another app that has some permissions
needing review, we do not deliver the broadcast and if the sending
app is in the foreground plus the broadcast is explicit (has a
component) we launch the review UI giving it a pending intent to
send the broadcast after the review is completed.

If an app starts a service in another app that has some permissions
needing review, we do not start the service and if the calling app
is in the foreground we launch the review UI and pass it a pending
intent to start the service after the review is completed.

If an app binds to a service in another app that has some permissions
needing review, we schedule the binding but do not spin the target
service's process and we launch the review UI and pass it a callback
to invoke after the review is completed which spins the service
process and completes the binding.

If an app requests a content provider in another app that has some
permissions needing review we do not return the provider and if
the calling app is in the foreground we show the review UI.

Change-Id: I550f5ff6cadc46a98a1d1a7b8415eca551203acf
2015-12-02 04:23:02 +00:00