542 Commits

Author SHA1 Message Date
Tony Mak
e9aa6ec1cf Fix setBluetoothContactSharingDisabled does not persist
The default value of bluetotoh contact sharing is true.
So we should save when it is false.

Bug: 27410265
Change-Id: Icaf4ceeda09eca46d160acfecc53834819b66a18
2016-02-29 21:32:47 +00:00
Makoto Onuki
a4fae1545a Merge "Support safe mode properly." into nyc-dev 2016-02-24 22:20:08 +00:00
Makoto Onuki
889c088066 Support safe mode properly.
In safe mode, IPM.queryXxx() doesn't work.  Use IPM.getReceiverInfo()
directly instead.

Bug 27108276

Change-Id: Ice8f882559b8f0596a19ddb3a16395a4dc538a25
2016-02-24 13:12:01 -08:00
Robin Lee
155a280e18 Merge "DPM: installKeyPair variant: caller can self-grant" into nyc-dev 2016-02-24 18:14:36 +00:00
Robin Lee
ce3399fbb4 DPM: installKeyPair variant: caller can self-grant
If 'requestAccess' is true, the caller (either profile/device owner or a
designated certificate installer) will be granted usage of the keypair
on successful installation.

This has no security implications for a profile/device owner which would
already be able to self-grant. Delegated certificate installers did not
have this ability before.

This is only allowed at install-time- not afterward.

Bug: 24746231
Change-Id: Ia0ec290bb0bcde1d8137c188e2667cb7718dbfd7
2016-02-24 17:14:41 +00:00
Lenka Trochtova
515a6c7030 Merge "Throw UnsupportedOperationException when creating ephemeral user on a system without split system user." into nyc-dev 2016-02-24 13:50:17 +00:00
Michal Karpinski
a0ea967d11 Removing lock contention in SecurityLogMonitor
After being interrupted the monitor thread tried to acquire
a lock that is held by interrupting thread, resulting in timeouting
on join().

Bug: 27061904
Change-Id: Ifbd578d5f5a266083b207fedd8ebb6d26ab08c31
2016-02-24 12:04:17 +00:00
Lenka Trochtova
3dfe7f655d Throw UnsupportedOperationException when creating ephemeral
user on a system without split system user.

BUG: 27143201

Change-Id: I7b7e634ba7fce576dd72a416e802c80939f05d3e
2016-02-23 19:49:39 +01:00
phweiss
27ee33482a Remove deprecated APIs DPM.createUser, createAndInitializeUser
They were deprecated in M and slated for removal in N.

Bug: 26974903
Change-Id: I7ae4d60bcf226c1e1de42852b378ad1ff71a914b
2016-02-22 14:04:14 +01:00
Lenka Trochtova
024f979dfd Allow ephemeral users on the split-system-user systems only.
BUG: 27143201

Change-Id: I37f3ca7366648dbf07df39a7a972857e0ff78a9a
2016-02-19 11:11:26 +01:00
Makoto Onuki
4ab36372fb Merge "Clean up on UserManagerService and DPMS" into nyc-dev 2016-02-19 00:21:48 +00:00
Makoto Onuki
2a3c3da0fc Clean up on UserManagerService and DPMS
- Avoid the ART warning about 4.1 compatibility
- Avoid integer overflow in DPMS

Bug 27243525
Bug 27242859

Change-Id: I92af323287e348fbd0eff31e6cf9823be8e41024
2016-02-19 00:20:56 +00:00
Makoto Onuki
6094928806 Fix bugs in user restriction migration
Originally I didn't know user-0 could have PO, so I excluded this case
from migration.  Now we handle it properly.

Also make sure only restrictions that can actually be set by each
owner moves to the owner restriction.  (Because of this, we no longer
have to have DISALLOW_WALLPAPER in the exception list, because
owners can't set DISALLOW_WALLPAPER.)

Bug 27225996

Change-Id: I6ad79d90e6c4400abbb1e4feba6ba59e3b650815
2016-02-18 12:09:30 -08:00
Makoto Onuki
aafff2f835 Merge "Ensure DO/PO are also DA." into nyc-dev 2016-02-18 16:57:42 +00:00
Makoto Onuki
184db600df Ensure DO/PO are also DA.
Bug 24503508

Change-Id: Ib957b84d5bee185501636c406d9aaf4985a79d8d
2016-02-17 15:35:01 -08:00
Makoto Onuki
fc482c30b7 Merge "[framework] Don't allow apps on external storage to be active admin" into nyc-dev 2016-02-17 22:48:13 +00:00
Makoto Onuki
f34db0a17e [framework] Don't allow apps on external storage to be active admin
Bug 27149287

Change-Id: I6d959d2e66dc0b19f78e6135fbdcf45ca8551958
2016-02-17 14:24:25 -08:00
Andrei Stingaceanu
eb84b1843a Suspend packages - one call for multiple packages
Refactor setPackageSuspended into setPackagesSuspended. The rationale
is that the consumers of this API are likely to want to remove
multiple packages at once. Rather than calling the API N times, call
it just once.

The good part is that we already have the broadcast intent for
suspended packages take an array so only one broadcast. Less stress
on the system.

Another good part is that (right now) we only have one consumer of
this API and it will be easy to make changes once this CL goes in.

As a shell command, for consistency only allowed one package at
a time.

Bug: 22776761
Change-Id: Ic8b8cf64d0a288ea3a282bb7b72f9d663b3b0049
2016-02-17 15:14:33 +00:00
Andrei Stingaceanu
5ae4e73ef0 Merge "Suspend packages - new API for retrieving the suspended status" into nyc-dev 2016-02-17 11:57:51 +00:00
Michal Karpinski
910a367cbf Merge "Remote bugreport notifications rework" into nyc-dev 2016-02-17 10:53:19 +00:00
Makoto Onuki
dafec11e69 Merge "Don't allow deactivating DAs when the user is not unlocked" into nyc-dev 2016-02-16 20:47:10 +00:00
Esteban Talavera
f79c887c59 Merge "Let admin disable fingerprint for the work challenge" into nyc-dev 2016-02-16 19:29:07 +00:00
Michal Karpinski
e9377a7d84 Remote bugreport notifications rework
Merging two notifications into one.

Bug: 27095707
Change-Id: Ib6582dabb7370f9b3b6e673b19ab43b70c73433a
2016-02-16 16:34:35 +00:00
Andrei Stingaceanu
355b232d79 Suspend packages - new API for retrieving the suspended status
Instead of always rebuilding the full ApplicationInfo for a
package when callers are only interested in the suspended status
add a new fast API in Packagemanager (which only checks the
suspended user setting for the requested package and returns
a boolean) and change the appropriate caller code too.

Bug: 26794775
Bug: 22776761
Change-Id: Ide8428ef734479360d5a8a75fd8e0ed8ddf2da7a
2016-02-16 14:57:29 +00:00
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
Makoto Onuki
1a5ee776ee Don't allow deactivating DAs when the user is not unlocked
Bug 27149570

Change-Id: I772d9cbd6edc822c8f7b1988905b702e05e674cd
2016-02-12 16:04:42 -08: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
Esteban Talavera
2547071ff8 Let admin disable fingerprint for the work challenge
Also, reworked the logic a bit:
* Admins can only set flags that affect the parent on the
  parent DPM instance (i.e. no unredacted notifications)
* Admins can set flags not supported on the work challenge on
  the regular DPM instance. If there is a work challenge,
  they will have no effect (as managed profile policies don't
  affect the regular lockscreen if there is a work challenge).
  If there is no work challenge, they'll affect the parent profile.

Bug: 26891832
Change-Id: I8978e1aa6abe9c8dc07e030dfd069b5f4e1301f6
2016-02-11 15:45:30 +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