106 Commits

Author SHA1 Message Date
Jason Monk
95d9ad0f79 Merge "Fixes to lock task API from API review" into lmp-dev 2014-08-16 04:32:18 +00:00
Julia Reynolds
d438deffad Merge "Apply lockdowns when user restrictions are set." into lmp-dev 2014-08-15 19:03:20 +00:00
Julia Reynolds
3d9eb78fe9 Apply lockdowns when user restrictions are set.
Previously DMAgent would apply these lockdowns before/
after setting the matching user restrictions.

Bug: 16701642
Bug: 16945830
Bug: 16944983
Change-Id: Ib4f7145055687f12408d6ccacd8e6380406a32b2
2014-08-15 16:16:38 -04:00
Narayan Kamath
29564cd245 Remove system_server classes from the boot image.
We set the system_server classpath in the environment
(like we do with BOOTCLASSPATH). After the zygote forks
the system_server, we dexopt the classpath (if needed)
and then launch the system server with the correct
PathClassLoader. This needed several small / medium
refactorings :

- The logic for connecting to installd is now in a separate
  class and belongs in the system_server.
- SystemService / SystemServiceManager have now moved to
  classes.jar. They are only used from there, and since they
  use Class.forName, we want them to be loaded by the
  system_server classloader, and not the bootclassloader.
- BootReceiver now moves to frameworks.jar, because it is
  used by ActivityThread and friends.

bug: 16555230

Change-Id: Ic84f0b2baf611eeedff6d123cb7191bb0259e600
2014-08-15 13:37:03 +01:00
Jason Monk
48aacba761 Fixes to lock task API from API review
Adding ComponentNames and some splitting/renaming of broadcasts.

Bug: 17005622
Change-Id: I9ece3553310fb20b0c3c3e4032b408e86384363a
2014-08-14 11:37:58 -04:00
Adrian Roos
b8b4774e61 Fix NPE in DevicePolicyManagerService that crashed SystemUI
Bug: 16857795
Change-Id: I6234f03c4ee31311af9f9c556b790594ee1a8b2f
2014-08-07 15:55:21 +02:00
Esteban Talavera
00f201e41b Merge "Wipe only managed profile when max number of incorrect passwords exceeded" into lmp-dev 2014-08-05 00:35:13 +00:00
Esteban Talavera
fe0f24cc92 Wipe only managed profile when max number of incorrect passwords exceeded
When the maximum number of retries that has been exceeded is not for the primary profile of the user, wipe only the profile that set that policy (e.g. the managed profile) rather than the entire user. At the moment the whole device is wiped if the max number of incorrect passwords for a managed profile is reached, as the password is shared with the USER_OWNER.

Bug: 14453697
Change-Id: I5746de104133c0ea0a51d75b9c92e1516d365d8c
2014-08-06 18:10:16 +01:00
Svetoslav
318f91b784 Fix NPE in device policy manager service.
Change-Id: I796359f903077eb0ef825ed926557f1a13b2e4c4
2014-08-06 19:05:57 -07:00
Svetoslav
976e8bd201 Allow adding widgets from user profiles.
The goal of this change is to enable support for appwidget from
user profiles to the user main profile. A user profile is a user
which is associated as a child of the main user profile. For example,
a user may have a personal (parent) and corporate (child) profile.
The device policy should be able to control whether adding a widget
from a child profile and given packages is allowed. This change
assumes that all packages from managed profiles are white listed.
Another change will add the device policy changes.

Change-Id: I267260b55d74c48b112a29979a9f59eef7a8194e
2014-08-05 20:57:20 +00:00
Sander Alewijnse
a87863a8bd Fix deadlock window manager and device policy manager.
Removed all communication from wm to device policy manager.
Added initialization of cache in wm by dpms.

Change-Id: Ifa0b8bfcd625464b156d5cc0fb66d342deda1c27
2014-07-31 09:16:46 +00:00
Robin Lee
50c360790c Don't turn off screen after wiping user profiles
The activity manager should know when to lock the screen. If an admin
does want this to happen then they should be able to run both commands
in succession.

Also rectifies some creative code styling in the same DPM method.

@bug 15558805

Change-Id: I8918184a4585aa8b061eb4a68edc2ec6805d8127
2014-07-30 14:18:22 +00:00
Amith Yamasani
bf3a946548 Set profile owner via an intent
priv apps can request to become a profile owner after setup has
completed. This will pop up a consent dialog (in Settings).

Also, clean up profile owner concept to be a component name.

Change-Id: I5e8532866e8018f61836c4e84fbbadb6150218ae
2014-07-29 23:43:32 +00:00
Jim Miller
604e7558ef Add new DevicePolicyManager API to allow fine-grained TrustAgent management
This adds a new feature that allows a device admin to specify a
whitelist of features that are allowed for the given admin.

Change-Id: I83f853318efbcf72308532d0a997374f73fa9c10
2014-07-28 21:32:01 -07:00
Julia Reynolds
ea4f01070a Merge "Remove the profile/device owner user restriction bypass." into lmp-dev 2014-07-24 15:36:21 +00:00
Julia Reynolds
401de1785e Remove the profile/device owner user restriction bypass.
Bug: 16566096

Change-Id: I4a56046df44d36d82edc64fc727e8cad5dc75382
2014-07-26 17:13:48 +00:00
Amith Yamasani
0da218be00 Don't update user's setup state unless it changed
Eliminates an extra write on every boot.

Bug: 16416936
Change-Id: I9ca16676c1b39dafeed3fc744a69c5bde819990c
2014-07-25 08:03:00 -07:00
Nicolas Prevot
3f7777fa4f Storing the app who sets a CrossProfileIntentFilter.
When we add a CrossProfileIntentFilter, we store the package and userId of the calling app
inside the CrossProfileIntentFilter.
When an app calls clearCrossProfileIntentFilters, we only remove the filters that the calling app
has set itself.

BUG: 16537557

Change-Id: I6e7bc859383ea66553d9f4230365df8ba27525f3
2014-07-28 10:47:12 +01:00
Sander Alewijnse
d2a1eec400 Add Device Policy API to disable screen capture.
WindowManager will set secure flag on SurfaceControl for
all windows of a flagged user to prevent screen capture.
API is consistent with the camera disable API.

Change-Id: Ib180f67f1ad827b6f4aca2af615274256cce58f4
2014-07-23 13:44:28 +00:00
Dianne Hackborn
8ddeee98b8 Use foreground broadcast to get device admin msg.
Using a background broadcast is bad, it can take a long
time to get the message back, either accidentally (backed up
behind other broadcasts) or from a deliberately malicious
admin.

Change-Id: Ib7491f8e27dacdc002562aef027ee4664e78e97b
2014-07-22 18:27:52 -07:00
Robin Lee
9c2be6c7ba Stop double-loading device admins
loadSettingsLocked() was being called twice for USER_OWNER at
systemReady(), doubling the number of admin entries at every boot.

Also guards against double-adding admins which appear twice in the
same XML file, favouring more recently-refreshed entries for
backward compatibility.

Previously an application calling in with 'refreshing = true' would
double-insert whatever admin was being refreshed into its user's list
of device admins. This is fixed too.

@bug 16416936

Change-Id: Idd147aa130e6bce7bcc40532f0a7fb07117b3151
2014-07-22 21:35:09 +00:00
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