117 Commits

Author SHA1 Message Date
Nicolas Prevot
e7cd37e613 Merge "Introducing crossProfileIntentFilters that skip the current profile." 2014-06-17 21:55:55 +00:00
Nicolas Prevot
63798c596d Introducing crossProfileIntentFilters that skip the current profile.
For these crossProfileIntentFilters, the activities in the current profile cannot
respond to the intent.
Only activities in the target profile can respond to the intent.

BUG: 14936725

Change-Id: I5e2704c2b56ff50a8339dd49284956391d7fad7e
2014-06-18 14:13:19 +01:00
Jason Monk
fbe6be4f65 Merge "Notify any profile/device owners of lock task" 2014-06-17 21:07:42 +00:00
Jason Monk
35c62a4668 Notify any profile/device owners of lock task
Add a method for DeviceAdminReceivers of profile/device owners to
be notified that lock task mode has entered or exited for an app
they have whitelisted.

Change-Id: Id124287d41564bbfccdacccf1977b7acb3ddec3f
2014-06-18 14:56:24 -04:00
Robin Lee
6d3912e2ef Merge "Revert "Publish DevicePolicyManager CA certificate APIs"" 2014-06-17 21:55:55 +00:00
Jason Monk
d7b8621bde Change lock-task DPM authorization to packages
Switch the DPM lock-task authorization to be controlled by a package
rather than a component.

Change-Id: Ife9bed068f31ff2449b4451ab69d3586a3f09d89
2014-06-17 09:24:18 -04:00
Robin Lee
b12f1778d6 Merge "Publish DevicePolicyManager CA certificate APIs" 2014-06-17 05:12:50 +00:00
Robin Lee
837304f6f6 Publish DevicePolicyManager CA certificate APIs
Exposes these methods:
 - hasCaCertInstalled
 - hasAnyCaCertsInstalled
 - installCaCert
 - uninstallCaCert

Allows device and profile owners to perform some certificate management
including querying for and enabling/disabling specific CA certificates.

Change-Id: I4aa8a1a8601b234e30acde99dfa382e04cb62495
2014-06-11 16:55:32 +01:00
Jason Monk
4e81913a66 Merge "Allow device owner to configure secondary users" 2014-06-12 17:09:07 +00:00
Jason Monk
03978a40b3 Allow device owner to configure secondary users
Currently the device owner can create secondary users, but unless
it is a system app it will not be installed and will not be able
to pass data easily from the code that creates the user and any
code running on that user.

This allows the device owner to install itself while creating a
user and start up a service to configure that user.  createUser
takes an bundle so that the device owner can pass across any
initial setup data it needs to, this bundle will be sent to
the admin receiver in onEnable.

Change-Id: Ic1f8565dd2a7bd85363527cf68b0ecd4dc9c3636
2014-06-12 16:30:00 -04:00
Robin Lee
122c595cd9 More meaningful errors for DPM calls by non-owners
Now throws an exception titled something like "Admin X does not own the
profile" instead of the rather unhelpful NullPointerException that was
thrown previously.

Change-Id: I33f6da5ea5eb70d8ea3939cfa280c794b01c3382
2014-06-11 18:01:07 +01:00
Julia Reynolds
4a21b25fad Allow profile and device owners to change and get the master volume mute state.
Also protect muting master volume with op code OP_AUDIO_MASTER_VOLUME.
Bug: 13585918
Change-Id: I91fe7ee60cd291cca15966b3127c0bb8a4828f6a
2014-06-09 14:18:01 -04:00
Jason Monk
b0dced8173 Add an API to clear the device owner.
Only the device owner will be able to clear itself.

Change-Id: Ie3231467d92e8c5d22ec51256177793f34110432
2014-06-06 17:03:43 -04:00
Jason Monk
f10606a9a4 Merge "Add device-owner based setting of global proxy." 2014-06-06 20:50:23 +00:00
Jason Monk
03bc991834 Add device-owner based setting of global proxy.
Re-hide the setGlobalProxy on the ConnectivityManager as it requires
CONNECTIVITY_INTERNAL.  Instead add a function to the DevicePolicyManager
to set the global proxy, that can only be called by the device owner.

Change-Id: I9ffb2cc4f30a6dc9b868d86f056e1fbd512d8dfc
2014-06-06 16:43:17 -04:00
Alexandra Gherghina
56e0d8003b Merge "Clean up deleted users in DevicePolicyManagerService" 2014-06-06 16:14:53 +00:00
Kenny Guy
73a41d2c4e Fix bug with sending intents to correct user for device admin.
Password change intents etc. were always being sent to
owner rather than user the device admin was installed for.
Also add TODO to not assume profile parent is OWNER.

Bug: 15442331
Change-Id: I7e58069bc4a6ab94f038ae1b80c044d666986318
2014-06-05 18:10:43 +01:00
Alexandra Gherghina
22745f4c9a Clean up deleted users in DevicePolicyManagerService
Bug: 15405715
Change-Id: Icd958fe9378deb92f25622b341e0502d865b742f
2014-06-05 11:19:29 +01:00
Sander Alewijnse
1b8737ee18 Merge "Remove enableSystemApp() and enableSystemAppWithInten()." 2014-06-04 10:11:46 +00:00
Amith Yamasani
f20d640fa2 Restrictions Manager
Mechanism to register a provider for requesting an
administrator to respond to permission requests.

Request format and response format constants.

Description of manifest template for static restrictions.
Int type introduced in RestrictionEntry.

Needs more javadoc and better description of manifest templates,
including specifying the XML attributes.

Change-Id: I5a654d364e98379fc60f73db2e06bf9a8310263d
2014-05-31 16:41:35 -07:00
Sander Alewijnse
866896df16 Remove enableSystemApp() and enableSystemAppWithInten().
Use setApplicationBlocked() and setApplicationsBlocked() instead.

Change-Id: I3d323d704db0a45e936f63675821707b4fddc48b
2014-05-27 11:56:49 +01:00
Nicolas Prevot
8194899071 Rename code related to cross-profile intents.
For example, replace ForwardingIntentFilter by CrossProfileIntentFilter

Bug: 15023443

Change-Id: Iee8cdf578817ef9956bcdece803a49b0d07b67f7
2014-05-23 13:16:01 +01:00
Julia Reynolds
1e95839823 Create deviceowner gated APIs for creating and removing users in devicepolicymanager.
This will allow DMAgent to manage users for EDU's cart model user case.
Bug: 15015887

Change-Id: I1eadf1701cb75fc4b50eb1a0df1525eff818286e
2014-05-22 12:02:23 -04:00
Robin Lee
a9e460aefc Remove enforceManagedProfile for listing keyguard features
Change-Id: Ic89f09ada046f64b089b977868b6f37bc0a6de91
2014-05-21 15:19:40 +01:00
Narayan Kamath
d862ebb603 resolved conflicts for merge of fcc4fed3 to master
Change-Id: Icebca982b01debd67a1470c02651ef8936f6e5b0
2014-05-21 12:07:35 +01:00
Robin Lee
c8e4b8107a Merge "DPM: Disallow some DeviceAdmin policies for ProfileOwners" 2014-05-21 09:41:19 +00:00
Robin Lee
a9ee672953 DPM: Disallow some DeviceAdmin policies for ProfileOwners
A profile owner should only have control over the profile. All of the
following device admin APIs that affect the device beyond the profile
that they are called from are now disallowed:

 - Camera enable/disable
 - Keyguard
 - Wipe external storage

@bug 14434826

Change-Id: I69acfdf6f654f48b5db91aeb3ea86662d7857075
2014-05-21 09:40:19 +00:00
Jeff Brown
6d8fd27e51 Make power button behavior configurable.
Allow power button to be used to either go to sleep as usual,
which may doze, or skip that completely and really go to sleep.
May also really go to sleep and go home all at once.

Bug: 14406056
Change-Id: Ia19e2551b9c2a72271bb2eddd5c0d1749761e019
2014-05-20 21:24:38 -07:00
Julia Reynolds
37f4e44ae6 Merge "Add Device/Profile Owner gated apis for setting/getting blocked packages." 2014-05-20 22:19:02 +00:00
Julia Reynolds
966881e895 Add Device/Profile Owner gated apis for setting/getting blocked packages.
DMAgent currently needs to live in /system/priv-app in order to
(among other things) set and get blocked packages. These APIs will
get us closer to being able to move DMAgent out of priv-app.
Bug: 14945334

Change-Id: I108e2013c67409dca554acf78e3a710745900706
2014-05-20 17:59:58 -04:00
Julia Reynolds
da55165321 Allow device/profile owners to update settings.
Device owners can update Settings.Secure and Settings.Global settings.
Profile owners can update Settings.Secure settings.

DMAgent currently needs to live in /system/priv-app in order to
(among other things) update global and secure settings. This change will
get us closer to being able to move DMAgent out of priv-app.
Bug: 14965414

Change-Id: If2cc3a56de91bffde33b838ab8ecea2c32412803
2014-05-20 17:49:45 -04:00
Amith Yamasani
3a48359443 Use correct package name for profile owner
Fixes reboot loop when you have a managed profile on your device.

Change-Id: I935ded447f226ee0507d3dcf22a730a7fb61a0c0
2014-05-16 15:25:33 -07:00
Jason Monk
9fcff5aadd Fix NPE in DevicePolicyManagerService
Bug: 15015897
Change-Id: Id9f6ae8b5abf96d35f799b150210813fb52da54c
2014-05-16 14:56:57 -04:00
Jason Monk
62062996dd Notify AppOpsService of UserRestrictions and Owners
This makes the DevicePolicyManagerService and UserManagerService
push the DeviceOwner/ProfileOwners and user restrictions on boot
as well as on any change.

This also adds a list of restrictions that allow any op to connected with
a user restriction such that it will return MODE_IGNORED when the user
restriction is present (except for the device/profile owner).

Change-Id: Id8a9591d8f04fe5ecebd95750d9010afc0cd786c
2014-05-16 13:12:41 -04:00
Jessica Hummel
91da58ded2 Allow setting password restrictions from a managed profile.
A managed profile will now share password settings with its parent.

- the current password is always stored in the parent
- admins of profiles are notified if that password changes
- checks for password quality now take the requirements of admins on
   the parent and its profiles into account

Todo:

- Currently KeyguardSecurityContainer wipes the whole device when
  the maximum fails has been reached on any profile.
  We need to limit the wipe to the profile for which the fails exceeded
  the maximum number.
- Intents with ACTION_SET_NEW_PASSWORD need to be forwarded to the parent
  of the profile when sent from a managed profile

Change-Id: I8532c59f753f8d9c61200f553f275214ad90276e
2014-05-09 16:16:02 +01:00
justinzhang
511e0d8323 DevicePolicyManager Authentication for Lock Task
Here we let DevicePolicyManager keep a list of tasks that are
allowed to start the lock task mode. This list can only be set by
a device owner app. The ActivityManager will call
DevicePolicyManager to check whether a given task can start the
lock task mode or not.

Change-Id: I650fdae43fc35bf9fd63452283f4e2bbadd11551
Bug: 14611303
2014-05-08 15:00:14 -04:00
Sander Alewijnse
5c02db60be Add API to disable account management for certain types
of accounts.

The account types with disabled account management are stored in a
blacklist in the active admin object, editable by profile owners.

Change-Id: I57dc5f709ad79674fa28dd006969283585daea24
2014-05-08 12:28:07 +01:00
Jason Monk
54a9ebb509 Fix build
Change-Id: I87c037faee19b434be741104cdddb9c467f20606
2014-05-07 15:26:34 -04:00
Adam Connors
010cfd4581 Add enableSystemApp methods to DevicePolicyManager
These methods allow profile or device owners to enable
systems apps pre-installed in the primary user in the
managed profile. Apps can be specified by either package
name or intent.

Bug: 13587051

Change-Id: Ifcbc68c139308506b6c18cf3c0ea62b8026ff75f
2014-05-07 16:20:38 +01:00
Nicolas Prevot
c79586ede6 Cleaning code related to the forwarding intent filters.
Checking for INTERACT_ACROSS_USERS_FULL
Adding equivalent methods in the PackageManager

Change-Id: Iaa1328fa666613a78e67ca669ea045144275e895
2014-05-06 13:54:48 +01:00
Nicolas Prevot
6fee7d4cf9 Introducing removable and non-removable ForwardingIntentFilters.
clearForwardingIntentFilters removes only non-removable IntentFilters.
The ForwardingIntentFilters set by the profile owner are always removable.

Change-Id: If950ccd7e69261b86360ea647fdb501c92f5440b
2014-05-06 12:37:20 +01:00
Dianne Hackborn
d83a096f29 Bump up priority of system receiving BOOT_COMPLETED.
Change-Id: I5166f88f11f781914312e867cb653c8ecbefa705
2014-05-02 16:29:10 -07:00
Alexandra Gherghina
3c4d9c56db Merge "Adds an enabled state in UserInfo instead of DevicePolicyManager" 2014-05-01 10:49:21 +00:00
Alexandra Gherghina
df35d570ed Adds an enabled state in UserInfo instead of DevicePolicyManager
Bug: 14377459
Change-Id: Ib4ec43d87da96c3dddaf9b7ae1796f261863a182
2014-05-01 11:34:27 +01:00
Nicolas Prevot
10fa67c77e Introduce forwarding intents across profiles.
The package manager service maintains, for some user ids, a list of forwarding intent filters.
A forwarding intent filter is an intent filter with a destination (a user id).
If an intent matches the forwarding intent filter, then activities in the destination can also respond to the intent.

When the package manager service is asked for components that resolve an intent:
If the intent matches the forwarding intent filter, and at least one activity in the destination user can respond to the intent:
The package manager service also returns the IntentForwarderActivity.
This activity will forward the intent to the destination.

Change-Id: Id8957de3e4a4fdbc1e0dea073eadb45e04ef985a
2014-04-30 19:24:52 +01:00
Nicolas Prevot
f2a5bf88cd Small fix in DeviceOwner.java.
Change-Id: Ibfa4ae7b1bc269bc51532026f8a6cc3c75cc42bf
2014-04-29 10:43:53 +01:00
Amith Yamasani
be46532c9f 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
2014-04-24 16:24:13 -07:00
Alexandra Gherghina
a4fcb44033 Fix two potential NPEs in DeviceInfo
Change-Id: Ic4b5b203af25cda9ae65b477c92c1fb5f31ab093
2014-04-24 17:55:30 +01:00
Alexandra Gherghina
385124d8ce 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
2014-04-24 10:07:51 +01:00
Robin Lee
66e5d96cf9 Allow ProfileOwner apps to manage app restrictions
Simple wrapper around the UserManager.{get|set}ApplicationRestrictions
APIs. Also added a new Intent to signal to running apps that the set
of restrictions has changed since startup.

Change-Id: Ifd108108a73f87325b499d9de2e1b2aacc59b264
2014-04-17 15:58:03 +01:00