185 Commits

Author SHA1 Message Date
Amith Yamasani
eee5094f96 Fix a security exception when checking cross-profile caller-id cap.
No need to enforce that the caller is in the system process.
We're only checking if the device policy is allowing access.

Bug: 16301261
Change-Id: I87a7c808d116c86aa68cebb36631c46d0a54be96
2014-07-21 17:04:44 -07:00
Amith Yamasani
e5bcff624f Rename setApplicationBlocked to setApplicationHidden
This corrects the expected behavior of the app state. Hidden apps
can be installed by the store to be brought out of hidden state.

Bug: 16191518
Change-Id: Id128ce971ceee99ba1dea14ba07ce03bd8d77335
2014-07-21 22:18:40 +00:00
Adam Connors
c8fa3ae2ce Merge "Create DPM APIs for cross profile callerId" into lmp-dev 2014-07-17 00:15:07 +00:00
Adam Connors
210fe21e95 Create DPM APIs for cross profile callerId
Contact information in the managed profile is shown
in the incoming call UI unless blocked using this API.

TODO: Actually plumb this into the caller-id logic.

Bug: 16301261
Change-Id: If03adc907d9558baa0a45a1833b857206b7bf96a
2014-07-17 16:28:52 +01:00
Alexandra Gherghina
999d394ade Ads per-user APIs to manage accounts through the AccountManager
Bug: 16056552
Bug: 14642886
Change-Id: I17ff6c2515285e63c84cecf2f861d10666c393c5
2014-07-17 17:08:49 +00:00
Amith Yamasani
3f4f2fbcd0 Merge "Keep track of user_setup_complete in DPMS" into lmp-dev 2014-07-17 16:16:48 +00:00
Amith Yamasani
ed239cb950 Keep track of user_setup_complete in DPMS
This is to ensure that some system app can't modify that
state for purposes of changing the profile owner without
user consent.

Bug: 16207721

Change-Id: Ic5f454d7568cd824b83456eed0e2611779a9adf8
2014-07-16 20:36:41 -07:00
Adam Connors
655be2a98e Revert "Remove enableSystemApp methods."
We need to go back to uninstalling system apps so we can
re-install non-default system applications through Play.

This reverts commit e3dbcd138c07f2d32ac84229d0a49052cc18d424.

Change-Id: I0a7af094614c4a10800971c82e10571f7312e079
2014-07-16 09:48:43 +00:00
Jason Monk
582d9111d7 Add API for device owner to switch users
Once verified that caller is device owner just calls through to
the activity manager and acts like that call.

Change-Id: I34023313cd6742b73d2105655ec6b631879aa37a
2014-07-10 11:05:07 -04:00
Jim Miller
85516d028b Add new "pin complex" type to supported keyguard PINs
This adds a feature to allow DevicePolicyAdmins to prevent using
simple PINs, which are defined as those containing more than 3
repeated values. Examples include '1234', '2468', '1111', '9876', etc.

Bug 12081139

Change-Id: I4ebe1c76a48087dcd7c878e9bd79a4e3ee2a27fe
2014-07-10 01:54:49 +00:00
Julia Reynolds
fe05380984 Restrict factory reset with user restrictions.
Bug: 15985879
Change-Id: I524bd8a790798a85a679aa195e634f6e0227d09f
2014-07-09 11:52:42 -04:00
Kenny Guy
c13053bf1c Add package state to block uninstall.
Add package state to allow profile or device
owners to block uninstall of packages.
Add API to DevicePolicyManager to set/get the
state.

Bug: 14127299
Change-Id: I03528819850b42df7bafa7747bb9e4558d20c4e6
2014-07-04 11:35:17 +00:00
Jessica Hummel
1333ea1ed7 Provide api to set the managed profile name.
Instead of sending the profile name in the provisioning intent
the mdm should set the profile name after provisioning has completed.
This allows us to simplify the provisioning flow and the mdm can
change the name of the profile later on if required.

Change-Id: I821ef2300eae74e89872152ae1c89ac3ecbb82e7
2014-06-30 12:40:37 +01:00
Adrian Roos
ef1de65117 Trust Agents: Disable until next unlock if device is locked by DPM
Bug: 15871777
Change-Id: I1a6e43848e600ffa2092282081b18ddf92419d4a
2014-06-26 01:54:52 +02:00
Jason Monk
c5185f2bf1 The profile owner shouldn't control lock task
Since managed profiles are started on bootup, the managed profile
would be allowed to set an app (possibly itself) as a lock task
app and then run itself on bootup and constantly control the
device.  This privelege should be restricted to device owners.

Change-Id: I4a93aabd6054cbe75076ef0517fce03ffa74dc93
2014-06-24 14:12:20 -04:00
Robin Lee
aab72f3b0a Merge "Revert "Revert "Publish DevicePolicyManager CA certificate APIs""" 2014-06-17 21:55:55 +00:00
Robin Lee
306fe08ce2 Revert "Revert "Publish DevicePolicyManager CA certificate APIs""
This reverts commit 792b270dbdc980cfe04e8d461bf00a1f45b5e936.

Change-Id: I18c7e0eca39868230cd8e4f4bbeb3c44ff9e8b78
2014-06-19 14:04:24 +00:00
Robin Lee
2b5e917026 Revert "Publish DevicePolicyManager CA certificate APIs"
This reverts commit 5260bf69946563dc47c17e7441b352adfce384c5.

Change-Id: I5e44fdac8a7375576b25171f58e31a1fa0e3c569
2014-06-17 22:12:28 +00:00
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