28 Commits

Author SHA1 Message Date
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
Alexandra Gherghina
9944c2f85c Sends ACTION_MANAGED_PROFILE_ADDED intent at foreground priority to speedup the new profile ui.
Bug: 14073989
Change-Id: I06b57a4cb1b9975f28a5e1e676c76c9e6c5befe7
2014-04-15 10:59:18 +01:00
Alexandra Gherghina
512675b07d Add new call to DevicePolicyManager to enable a profile.
Bug: 13755091
Change-Id: Idb6975431f842ededf78966c578b0533e6f186af
2014-04-11 16:51:49 +01:00
Robin Lee
5c921daa72 Fix privilege escalation for preferred activities
Passing in the name of an actual admin should be enough to pass the
security check as it was. This is now fixed as the caller is not
given the opportunity to spoof its own name any more.

Change-Id: Id8be4ca4c8bf3751a1ee8125cf119fa100c81d22
2014-03-28 15:09:49 +00:00
Sander Alewijnse
627de95925 Merge "Enables a profile owner or device owner to set and clear default intent handler activities." 2014-02-24 10:16:28 +00:00
Sander Alewijnse
f475ca33d9 Enables a profile owner or device owner to set and clear default intent handler activities.
Those intent handlers are persistent preferences. They will remain the default intent
handler even if the set of potential event handlers for the intent filter changes
and if the intent preferences are reset.

Change-Id: Id0cfae46f93c10d89e441f272096a205ec518dd0
2014-02-21 15:24:20 +00:00
Robin Lee
08fc72d031 Check DeviceOwner exists before using packageName
Creating a profile owner when there is no device owner present also
creates a new DeviceOwner object without packageName set -- this
situation can lead to a null pointer access when calling isDeviceOwner.

Change-Id: I31eab498d78cadc67a1aedd205b458dee2d27705
2014-02-20 13:39:10 +00:00
Adam Connors
661ec4710b Change API for setProfileOwner to require userId
Previously the userId of the current process used but it
makes the provisioning process cleaner to be able to pass
it in explicitly.

Change-Id: I670c4cf3638f1340f6d0bf856c3e01045df8c29e
2014-02-17 10:18:59 +00:00
Jeff Brown
cab8617b8c am 25df673b: am 1b51c9cb: Merge "Make SystemService constructor take a Context." into klp-modular-dev
* commit '25df673b849de374cf1de40250dfd8a48b7ac28b':
  Make SystemService constructor take a Context.
2014-02-11 08:33:50 +00:00
Jeff Brown
b880d880c6 Make SystemService constructor take a Context.
This change simplifies the process of initializing a SystemService
by folding the onCreate() step back into the constructor.  It removes
some ambuiguity about what work should happen in the constructor and
should make it possible for services to retain most of their final
fields after refactoring into the new pattern.

Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
2014-02-10 20:01:43 -08:00
Amith Yamasani
9348ac8249 Fix NPE on removing a user
Bug: 12957232

Check for null mDeviceOwner.

Change-Id: I107dc24d1a8de121ebd2c1bb56e1af40bb1c55ac
2014-02-10 13:43:18 -08:00
Adam Lesinski
9f97de1335 am a5a93f55: am 7f416631: Merge "Check feature bits before loading optional services" into klp-modular-dev
* commit 'a5a93f559d337ad5b79716b05ea43707eb779dc8':
  Check feature bits before loading optional services
2014-02-06 20:25:51 +00:00
Adam Connors
776c555d95 Extend DeviceOwner concept to accommodate ProfileOwners
ProfileOwners, like DeviceOwners, are Device Admins that have
additional priviledges. ProfileOwners however are scoped per
user.

Change-Id: I1e22c85878e0672121e6ebbe97fca38591f992b2
2014-02-06 10:07:19 +00:00
Adam Lesinski
898c13df7b Check feature bits before loading optional services
At startup, we check with PackageManager whether a system service is
available before attempting to load it. A system service is available
if its associated feature (similar to hardware features) is present.
This does not remove unavailable services from the compiled jar.

Change-Id: I13571805083aa4e65519a74acb52efd17b9fb3d7
2014-02-05 19:26:40 +00:00
Amith Yamasani
e58a49e411 Merge commit '817ec49e' into manualmerge
Conflicts:
	services/print/java/com/android/server/print/PrintManagerService.java

Change-Id: I1b9bf364ca50ee3c48f53d87ae0ce23e7f3c2bc2
2013-12-20 16:36:48 -08:00
Amith Yamasani
817ec49e79 Wrap some services into a SystemService
These services can now be excluded by modifying the list of REQUIRED_SERVICES (TB renamed)

Changed appwidget, devicepolicy, backup and print services.

Change-Id: Id8e2855d5c045cd57bdb02dca9ed75172803bce7
2013-12-20 14:46:56 -08:00
Amith Yamasani
49782e46c0 am 9158825f: Move some system services to separate directories
* commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce':
  Move some system services to separate directories
2013-12-19 23:30:35 +00:00
Amith Yamasani
9158825f9c Move some system services to separate directories
Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-12-19 15:25:37 -08:00