541 Commits

Author SHA1 Message Date
Makoto Onuki
939be87776 Slightly change the "pre-N" so it's CTS-friendly.
Right now, the value of VERSION_CODES.N is 10000, but I'm writing
a caller app with target SDK level 24 for CTS, and the previous
logic didn't work for it.

Bug 25506830

Change-Id: I73613f30b437fb19406736f897d01d59b1f84c9d
2016-02-02 17:24:59 -08:00
Makoto Onuki
1f1ceef0f8 Ignore unknown user restrictions and WTF instead.
Bug 23902097

Change-Id: I1ac147ecd0286a8eb674d6f9f527edfea6e1198e
2016-02-02 17:10:41 -08:00
Makoto Onuki
90b896533e DO / PO Shouldn't be removed as active admin...
even if they asked.

Also clear(Device|Profile)Owner should remove them as the active admin
too.

Also add some more unit tests.

Bug 26858840

Change-Id: I7b3ed92e1b4cbe803381ed6e3f64d8de17b2ebb0
2016-02-02 14:54:06 -08:00
Rubin Xu
49caead1c2 Call SecurityLog methods via Injector
This is to make sure the unit test can mock them out.

Bug: 26911599
Change-Id: I07a1a8b43ad5716a4b667bc5266b3b03997268c5
2016-02-02 18:00:28 +00:00
Victor Chang
fe13c5fbe1 Merge "Fix that can't launch managed QuickContact in ContactSearch" 2016-02-02 11:02:07 +00:00
Makoto Onuki
d38308e4d0 Merge "Fix DPM unit tests" 2016-02-01 23:24:20 +00:00
Makoto Onuki
3f3657a61b Fix DPM unit tests
Bug 26911599

Change-Id: I874c9cd4f63c79bc984777ef3b1b654a414c4911
2016-02-01 15:21:49 -08:00
Victor Chang
70b1751d14 Fix that can't launch managed QuickContact in ContactSearch
It happens when caller id is disabled but contacts search is enabled

BUG=26740020

Change-Id: I4ca79c82ed27f6f1da514b31d8d89fc71fd243fb
2016-02-01 21:01:13 +00:00
Makoto Onuki
b4ec8aaaba Merge "Revert "Throw for unknown user restrictions."" 2016-02-01 18:26:08 +00:00
Makoto Onuki
2ec157d928 Revert "Throw for unknown user restrictions."
This reverts commit 3861bf7e73fab9e39e8d1f6e5194f3600ed929a0.

Bug 26896902

Change-Id: I26fa0159b5bb832048ccd013054a01f91b54947b
2016-02-01 18:23:55 +00:00
Rubin Xu
c3cd05f8a4 Add DevicePolicyManager APIs for process logging.
Add Device Owner APIs for controlling and retrieving the logs. Retrieving the
logs should be rate limited unless we are at the risk of losing logs due to
constrained buffer space.

Bug: 22860162
Change-Id: I80658f5a14e86d7cfd42402fbc5e98dc11698c0e
2016-02-01 10:28:24 +00:00
Makoto Onuki
f3bc593a62 Merge "Throw for unknown user restrictions." 2016-01-29 19:19:40 +00:00
Makoto Onuki
3861bf7e73 Throw for unknown user restrictions.
Bug 23902097

Change-Id: I78a4b09db880134577d690be0c50ee9a64e6a309
2016-01-29 11:17:57 -08:00
Benjamin Franz
dd231a16a1 Merge "Add policy to set the organization name" 2016-01-29 11:38:54 +00:00
Benjamin Franz
3e8a709064 Add policy to set the organization name
We allow the profile owner of a managed profile to set the name of the
managed organization.

This name is used as the default header message shown in the confirm
credentials screen a.k.a. work challenge.

Bug: 26638631
Change-Id: I03c5acc9fffe06cdb9d0d60dd1580b20e21783b1
2016-01-29 11:15:12 +00:00
Esteban Talavera
d4efab1173 Merge "Fix exception when calling setPasswordExpirationTimeout" 2016-01-28 18:44:34 +00:00
Esteban Talavera
d07438f300 Fix exception when calling setPasswordExpirationTimeout
Prevent exception when calling setPasswordExpirationTimeout on the parent
DPM instance. Callen setExpirationAlarmCheckLocked with the parent userHandle
was breaking because getPasswordExpirationLocked was trying to call getProfiles
on a different user.

Bug: 26847085
Change-Id: I9d584573245aba65af7ecf236f2021b47afb5d7e
2016-01-28 18:14:23 +00:00
Michal Karpinski
bc0ce99043 Merge "Logging of keyguard actions into security log" 2016-01-28 11:47:23 +00:00
Michal Karpinski
31502d3d95 Logging of keyguard actions into security log
Bug: 22860162
Change-Id: I7dbe68fff7d9d45b6c417d960cf025c8d0694917
2016-01-28 11:07:56 +00:00
Makoto Onuki
ca3f6fae60 Fix exception message
Change-Id: I6fe4b8b745414ed589337079e2893d87dadb34f5
2016-01-27 16:19:38 -08:00
Makoto Onuki
1244ece2e3 Merge "Make DPM.clearProfileOwner() public." 2016-01-27 22:25:43 +00:00
Makoto Onuki
5bf68027cf Make DPM.clearProfileOwner() public.
Bug 26827204

Change-Id: Ib32e5370b493aa3e36b869d9ed3d78782df4c895
2016-01-27 14:07:41 -08:00
Lenka Trochtova
f348e8e22b Add policy for enforcing that all users are ephemeral.
BUG: 24883058

Change-Id: I8e53ca677c935a6c828dd6ece00b345d0eff182a
2016-01-27 21:06:09 +01:00
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