Commit Graph

514 Commits

Author SHA1 Message Date
Jeff Sharkey
115d2c189a Add feature versions for devices and apps.
We're starting to see more instances of device features that will
increment separately from the SDK API level, such as camera HAL,
GPU capabilities, Bluetooth, and other hardware standards.

This change adds the ability for device features to specify a
version, which is defined to be backwards compatible.  That is, apps
requesting an older version of a feature must continue working on
devices with a newer version of that same feature.

When a version is undefined, we assume the default version "0".

Bug: 27162500
Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
2016-02-15 17:45:42 -07:00
Nicolas Prévot
eff90bd5ff Merge "Allow privileged apps to set the organization color." into nyc-dev 2016-02-15 10:47:41 +00:00
Clara Bayarri
29b13190cd Merge "Add support for current failed lock attempts and max attempts" into nyc-dev 2016-02-12 13:54:10 +00:00
Clara Bayarri
51e41ad887 Add support for current failed lock attempts and max attempts
This is needed from Settings to show a message informing the user
of the number of attempts before their work profile gets wiped
when using ConfirmDeviceCredentials.

Bug: 26677759
Change-Id: I4b16f7dc2f415d0ce0215a3b7a646f98fabece33
2016-02-12 13:50:43 +00:00
Rubin Xu
d6c90a8883 Merge "Fix testApplicationRestrictionsManagingApp unit test" into nyc-dev 2016-02-12 11:53:45 +00:00
Nicolas Prevot
8f7698aaf6 Allow privileged apps to set the organization color.
BUG:26923835
Change-Id: I97b0cbbc0d4fb9e9ca0e3d335a9d15eb5a1f9602
2016-02-12 10:23:32 +00:00
Makoto Onuki
5f05cf9612 Merge "If package has no active admins, just uninstall right away" into nyc-dev 2016-02-11 19:42:54 +00:00
Kenny Guy
641ea634ee Merge "DPMS shouldn't remove admins that aren't crypto aware." into nyc-dev 2016-02-11 19:27:22 +00:00
Kenny Guy
44fc4aeb1f DPMS shouldn't remove admins that aren't crypto aware.
DevicePolicyManagerService checks admins on boot
and removes ones that aren't found so it needs
to match crypto and non-crypto admins.
Match non-crypto aware apps when admin is enabling
system apps.

Bug: 27126412
Change-Id: Ibb20841679fb660de281782964b068d5a13b8fe9
2016-02-11 17:48:43 +00:00
Rubin Xu
ed1928a981 Fix testApplicationRestrictionsManagingApp unit test
The API now requires the app restriction manager app to exist
on the current user when it is called.

Change-Id: I809816d4f5d73378c23b18d7b74ebb282b7dc444
2016-02-11 17:23:06 +00:00
Philipp Weiß
09f8568059 Merge "DPM.createAndManageUser should work even with DISALLOW_ADD_USER set" into nyc-dev 2016-02-11 17:17:39 +00:00
phweiss
e9c440638e 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
2016-02-11 14:43:18 +01:00
Michal Karpinski
ed5c8f0216 Log strength of auth method used into security log
As approved by Android Security team, added logging of
strength of auth method as well as logging of fingerprint
keyguard actions.

Bug: 26841997
Change-Id: Ic8e3f125f775a7585fe56003f4c6442390edea61
2016-02-11 10:36:56 +00:00
Makoto Onuki
ed9fa2ca3c If package has no active admins, just uninstall right away
Also fix the bug where removeAdminArtifacts() is called
for all active admins on the target user.

Bug 27107878

Change-Id: I6edbdadffe8c75628539976d304e39d6abed73a4
2016-02-10 16:40:30 -08:00
Suprabh Shukla
338c1d8607 Merge "Added an api to uninstall a packge with active DAs" into nyc-dev 2016-02-10 22:47:59 +00:00
Jeff Sharkey
8212ae0aee Consistent naming for internal storage APIs.
Also completely remove a few confusingly named deprecated APIs.

Change-Id: Ia7e4ea3190a97f0a7dfa9bebf2118da0866ec38f
2016-02-10 15:03:33 -07:00
Suprabh Shukla
a2ae2238e5 Added an api to uninstall a packge with active DAs
The api deactivates all the active admins in the package, then force
stops the package and starts the uninstall intent for the package. This
is intended to provide an easy way for a user to delete a misbehaving
Device Admin

Bug: b/22359208
cherrypick of Ic7ddd89ef6db53e7e76f805808d9e806100374db

Change-Id: I0d677839120c46f22231a7d6f9cf6630cb020227
2016-02-10 13:57:22 -08:00
Esteban Talavera
66a320d368 Merge "Check for null on app restrictions managing app APIs" into nyc-dev 2016-02-10 16:43:50 +00:00
Rubin Xu
f03d0a6bfc Require delegated cert installer and app restriction manager to exist
Enforce that apps with delegated powers to exist on device before
empowering them. This is consistent with DevicePolicyManagerService's
internal logic to clear the delegation power once the package is removed.
For delegated cert installer, only enforce this new restriction on
device admins targeting N or later.

Bug: 26233778
Change-Id: Ia8f45dfd5290958cebb36991c4b6baa03e8c28ae
2016-02-10 16:29:01 +00:00
Esteban Talavera
48e64f20f3 Check for null on app restrictions managing app APIs
Change-Id: I3d3cc9b4a4bd6a2526fd0bd7d8662c6b07183208
2016-02-10 16:24:28 +00:00
Nicolas Prevot
e28e5a9d3b Fail if setProfileEnabled is called outside a managed profile.
BUG:26709495
Change-Id: I98adf2dab1e7b27fef926144c460af8823fe96e7
2016-02-08 14:03:39 +00:00
Sudheer Shanka
57218cbbf7 Merge "Made changes to fix some policy transparency options." 2016-02-04 19:14:14 +00:00
Sudheer Shanka
569258689a Made changes to fix some policy transparency options.
Add isInputMethodPermittedByAdmin and
isAccessibilityServicePermittedByAdmin APIs in DevicePolicyManager.
And update utility methods in RestrictedLockUtils to use the correct
userId when checking if disabled by admin.

Bug: 26897250
Bug: 26767564
Bug: 26966213
Change-Id: I0b74b3e57904a82f8ce72d856769d35b5e8403e5
2016-02-04 01:12:44 +00:00
Kenny Guy
8c41a1c9bc Match non-crypto aware admins when registering.
Profile owners are registered before the user is
started and unlocked, so we need to check for
components that aren't cryptoware when looking
for the admin.

Bug: 26924254
Change-Id: I61fca0a3d6e490ca6fea9a7bdc8f2c44efde74f2
2016-02-03 14:20:30 +00:00
Makoto Onuki
a0fddc1ed4 Merge "Ignore unknown user restrictions and WTF instead." 2016-02-03 01:38:33 +00:00
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 3861bf7e73.

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