301 Commits

Author SHA1 Message Date
Rubin Xu
9fc8bb63d8 Merge "Tweak SystemUpdatePolicy according to API review." into mnc-dev 2015-05-12 09:06:14 +00:00
Svet Ganov
8c7f700a59 Add permission meta-state flags to support grant/revoke permission policy.
We now maintain a mata-state with each permission in the form of flags
specyfying the policy for this permission. This enables support of the
following use cases:

1. The user denies a permission with prejudice in which case an app cannot
   request the permission at runtime. If an app requests such a permssion
   it gets a denial unless the user grants the permission from settings.

2. A legacy app with disabled app-ops being upgraded to support runtime
   permissions. The disabled app ops are converted to permission revocations.
   The app ops manager is a part of the activity manger which sits on top
   of the package manager, hence the latter cannot have a dependency on the
   former. To avoid this the package installer which is the global
   permission managment authority marks the permission as revoked on
   upgrade and the package manager revokes it on upgrade.

3. A device policy fixing a permission in a granted or revoked state. This
   additional information is folded in the meta-state flags and neither
   apps can request such permissions if revoked not the user can change
   the permission state in the UI.

Change-Id: I443e8a7bb94bfcb4ff6003d158e1408c26149811
2015-05-11 17:13:57 -07:00
Rubin Xu
d86d58cd01 Tweak SystemUpdatePolicy according to API review.
Make SystemUpdatePolicy Parcelable; hide public constructor and
expose static builder methods.

Bug: 20820025
Change-Id: I594ba3c7e5514551134ba6c866b24498b66506bf
2015-05-11 18:35:32 +01:00
Craig Lafayette
4e401fa498 DevicePolicyManager API review changes
Renamed DO_NOT_ASK_CREDENTIALS_ON_BOOT to
RESET_PASSWORD_DO_NOT_ASK_CREDENTIALS_ON_BOOT.

Bug: 20820907
Change-Id: I6455f9a6d370afbd5154505f402b409dba3b7918
2015-05-07 10:24:02 -04:00
Benjamin Franz
94fb2024b0 Merge "Rename functions that disable status bar and keyguard" into mnc-dev 2015-05-06 15:16:20 +00:00
Benjamin Franz
bece80645e Rename functions that disable status bar and keyguard
Rename the DevicePolicyManager functions setKeyguardEnabledState and
setStatusBarEnabledState to setKeyguardDisabled and
setStatusBarDisabled respectively.

Bug: 20820039
Change-Id: I06f6a19ac55b24e66e9f2cb340ead5d940cb2235
2015-05-06 13:19:22 +01:00
Amith Yamasani
6f36d42dcc Permission policies are for profile and device owners
Not just device owners

Change-Id: I78ad815651e9bdc4bd78e61d634a5067935fa33f
2015-05-05 17:16:18 -07:00
Robin Lee
ddd553f2ae Device policy: use owner label instead of name
Managed provisioning does not currently set a meaningful profile owner
name. This changes to use the application label as returned by
PackageManager.getApplicationLabel which should be more descriptive.

Bug: 20679292
Change-Id: I5a0e87ef05b62879a73814e6d338e8b984b81c94
2015-04-30 18:01:46 +00:00
Benjamin Franz
c4aa3c781a Merge "Add status bar flag to disable quick settings" into mnc-dev 2015-04-29 08:36:00 +00:00
Amith Yamasani
d49489b3af Permissions control via profile/device owner admin
Profile owners and Device owners can set policies for runtime
permissions. Blanket grant/deny policy can be set for a user.
They can also explicitly grant/revoke permissions for specific apps
which cannot be overridden by the user and will not be prompted.

[More implementation required in PackageManagerService and
 PackageInstaller]

Bug: 20666663
Change-Id: I2c25c18c2a195db9023a17716d5896970848bb45
2015-04-28 14:30:09 -07:00
Benjamin Franz
27cf146361 Add status bar flag to disable quick settings
Bug: 20331928
Change-Id: I79dc7f2c9e64245bdeeea3916d339985a8b17f92
2015-04-28 18:49:47 +01:00
Julia Reynolds
13c58bacc8 Allow device initializers to set a preferred setup activity.
This activity will launch by default on device reboot or user switch
during user initialization, even if there are higher priority 'home'
activities.

Bug: 20223050
Change-Id: I335aeb010a1ae5db07a4343d26e160c74bd299e1
2015-04-27 12:57:15 -04:00
Julia Reynolds
f7d3a766f0 Merge "Only skip unrecognized tags." 2015-04-25 01:09:25 +00:00
Julia Reynolds
6afa666c9f Only skip unrecognized tags.
This fixes policy loss seen on device reboot when device admins
applied certain policies.

Bug: 20516960
Change-Id: I6e2a3b8de610c00ea1a2edbb026523bfdc365775
2015-04-24 17:35:16 -04:00
Nicolas Prevot
2806374f95 Restrict setting the profile/device owner with a signature-level permission.
Create the new permission MANAGE_PROFILE_OWNERS to restrict setting
the profile/device owner.

BUG:19838376

Change-Id: Ib55a2db85fcb6f34e3b88c398683bddb0ad66868
2015-04-24 11:36:52 +01:00
Svetoslav
917c4e4d45 Merge "Clear binder identity before reaching into keyguard settings" 2015-04-23 23:00:06 +00:00
Svetoslav
5bd5d4c2b0 Clear binder identity before reaching into keyguard settings
Change-Id: I80eeaed235acc165ddd4799ba46700afea2dff55
2015-04-23 15:55:03 -07:00
Craig Mautner
1513ff171a Fix NPE when load() returns nulls.
Fixes bug 20528625.

Change-Id: I825c95fd212a1928a34e9ed0e20d2f7563939cbb
2015-04-23 12:52:58 -07:00
Craig Mautner
015c5e57b5 Disallow data clearing of DeviceOwner.
There are OEM provided apps that are able to clear the data of the
device owner. That creates a security hole that this fixes.

Fixes bug 20107015.

Change-Id: I4ef313b394bd8059d19d20aa6533396305d1357d
2015-04-23 11:05:02 -07:00
Craig Mautner
5173dc28f3 Add and remove DeviceInitializer from whitelist
Add the DeviceInitializer to the locktask whitelist when set or when a
new user is created. Remove DeviceInitializer from whitelist when
user setup complete.

Fixes bug 20267837.

Change-Id: I8a33bceb6e6f3d0316a1227b2ed2b713f4ca3a9e
2015-04-23 08:30:20 -07:00
Rubin Xu
dc105cc91c Enable system service to notify device owners about pending update
Create a DevicePolicyManager API which can be used by OTA subsystem
to tell device owners about pending updates. Device owners will get
a callback from its DeviceAdminReceiver when the update service sends
out such notifications.

Bug: 20213644
Change-Id: Ifcc755655e4f441980cf77d76175a046112ca9ae
2015-04-22 22:11:04 +01:00
Benjamin Franz
07ba37a713 Merge "Recover status bar enabled state for all users" 2015-04-22 11:43:03 +00:00
Benjamin Franz
6d6290d282 Merge "Check for null packages in setLockTaskPackages" 2015-04-22 11:00:02 +00:00
Benjamin Franz
837f1035a6 Recover status bar enabled state for all users
Move the update of status bar enabled setting to loadSettingsLocked and
thereby recovering the enabled state for all users, not only the user
owner.

Bug: 20416833
Change-Id: Iee3d6e0f3ea8ebc5d72c0ed165bea4595ed073ba
2015-04-22 11:44:57 +01:00
Andrei Kapishnikov
4eb6a36922 Introduced DO_NOT_ASK_CREDENTIALS_ON_BOOT flag
A new flag for DPM.resetPassword() method that specifies that the
device should be decrypted without asking for the password or pattern.

Bug 19250601

Related CL in Settings App: https://googleplex-android-review.git.corp.google.com/#/c/670206

Change-Id: I9ca3472dc18e66e618ff772dee16ca4a450e9997
2015-04-21 11:07:09 -04:00
Benjamin Franz
78c05f9742 Check for null packages in setLockTaskPackages
Bug: 20416611
Change-Id: Ibbadc952da29a34de0cf02408093b7bfc01f8779
2015-04-21 09:45:19 +01:00
Rubin Xu
5faad8e4cd Rename public OTA policy APIs in DevicePolicyManager
Use the term "SystemUpdate" instead of "OTA", in public
DevicePolicyManager APIs that handle OTA policies.

Bug: 19650524
Change-Id: Iebdaea91337d617147cb411b6f47e0f3fae8671c
2015-04-20 23:27:14 +01:00
Craig Mautner
15df08abd8 Introduce android:lockTaskMode
The ability for tasks to be started in locktask mode or pinned is
dependent on the value of android:lockTaskMode for the root activity
of the task.

For bug 19995702

Change-Id: I514a144a3a0ff7dbdd4987da5361b94bdfe9a437
2015-04-15 14:27:56 -07:00
Benjamin Franz
47af53ed95 Merge "Introduce device owner API to disable the status bar" 2015-04-15 17:22:40 +00:00
Benjamin Franz
ea2ec97f37 Introduce device owner API to disable the status bar
Let the device owner disable the status bar to achieve multi-app single purpose
mode. When the status bar is disabled, quick settings, notifications and the
assist gesture are blocked.

Bug: 19533026
Change-Id: I72830798135136e5edc53e5e2221aebb9a7c7d57
2015-04-15 15:57:14 +01:00
Benjamin Franz
b4e2188321 Merge "Fix a SecurityException in setKeyguardEnabledState" 2015-04-15 08:29:15 +00:00
Benjamin Franz
3223106dab Fix a SecurityException in setKeyguardEnabledState
A SecurityException is currently thrown when calling this API as
LockPatternUtils.isSecure requires a permission that the DO does not
have.

Bug: 19533026
Change-Id: I28bebb647e46bb631cc4fa1a7c9571eadda69086
2015-04-14 18:19:49 +01:00
Andres Morales
317918e206 Merge changes from topic 'lss-update'
* changes:
  Add challenge to IGateKeeperService
  Wire up GateKeeper to LockSettingsService
2015-04-14 16:12:55 +00:00
Benjamin Franz
e36087e5b6 Introduce device owner API to disable the keyguard
Let the device owner disable the keyguard to achieve undisturbed single
use mode with multiple apps. Calling this API has no effect if a
password
has been set for the calling user.

Bug: 19533026
Change-Id: I6b726b7f36efb669359e9da4b7e3db1f8031dad5
2015-04-14 10:58:36 +01:00
Rubin Xu
c9c9f7b40e Merge "Add setOtaPolicy/getOtaPolicy API in DPMS" 2015-04-14 09:16:28 +00:00
Ricky Wai
0c606812c5 Merge "Add Bluetooth Contacts Sharing policy in DevicePolicyManager" 2015-04-14 08:59:18 +00:00
Ricky Wai
778ba13538 Add Bluetooth Contacts Sharing policy in DevicePolicyManager
Bug: 19990979

Change-Id: Ide9adf66eec5721e50573c03956a1b63b7e8b18b
2015-04-14 08:57:32 +00:00
Rubin Xu
8027a4ffc2 Add setOtaPolicy/getOtaPolicy API in DPMS
Allow device owners to set OTA policy for automatically accept/postpone
incoming OTA system updates. This class only provides the setting
and getting of OTA policy, the actual OTA subsystem should handle
and respect the policy stored here.

Bug: 19650524
Change-Id: I9b64949fab42097429b7da649039c13f42c10fd1
2015-04-14 09:34:03 +01:00
Andres Morales
8fa5665f0e Wire up GateKeeper to LockSettingsService
Adds:
- Communication to GKService
- password upgrade flow
- enroll takes previous credential

Change-Id: I0161b64642be3d0e34ff4a9e6e3ca8569f2d7c0a
2015-04-13 18:38:45 -07:00
Rubin Xu
c06bbbfe7a Merge "Grant cert installer access to installKeyPair()" 2015-04-13 22:29:12 +00:00
Craig Lafayette
dbe31a6616 Send device initializer status.
- Create method in DevicePolicyManager to send device
  provisioning status to ManagedProvisioning.
- Define status updates used by ManagedProvisioning.

Bug: 20001077
Change-Id: Ia98fc765d1ebb2ba9680636ca15c2c870d160261
2015-04-13 09:14:33 -04:00
Craig Mautner
30b8984903 Merge "No longer unlock activity manager to test whitelist" 2015-04-07 16:17:57 +00:00
Craig Mautner
e56007786a No longer unlock activity manager to test whitelist
In order to check the DevicePolicyManagerService locktask whitelist
the activity manager had to release its lock preserving internal
state. That is undesirable and not scalable now that we need to check
the whitelist at startup for bug 19995702.

This change causes DPMS to update activity manager with the whitelist
whenever it changes so that activity manager can check the whitelist
without releasing the acitivty manager lock.

Change-Id: I3ed6eb5ceae2cd7e7ae3280abd708d5ce43a2851
2015-04-07 09:15:41 -07:00
Jeff Sharkey
16c9c249d5 Fix up ExternalStorageFormatter.
It's not going to be around for much longer, so just fix enough to
work correctly.

Also teach about new "unmountable" state from vold.

Bug: 19993667
Change-Id: Ib72c3e134092b2a895389dd5b056f4bb8043709a
2015-04-04 21:37:47 -07:00
Fyodor Kupolov
25da6b65b0 Merge "Do not log an error when app restriction file does not exist" 2015-04-03 16:43:41 +00:00
Fyodor Kupolov
6f34d363c3 Do not log an error when app restriction file does not exist
Bug: 20040207
Change-Id: Ibd257388a185020258e36bddf5b451dc24c0b7ee
2015-04-03 09:28:44 -07:00
Julia Reynolds
eaafdf72a4 Store the device initializer componentname in addition to package.
This removes ambiguity about which component in the initializer
package handles device initialization when setting up secondary users.
Bug: 19992262

Change-Id: I2e48168907725a56cd05d0b51c9f28b34fa28d1a
2015-04-03 08:27:34 -04:00
Rubin Xu
acdc1839cf Grant cert installer access to installKeyPair()
Bug: 20041977
Change-Id: Id0dc0bce8461c71d7220c1802dcca82933805996
2015-04-02 14:53:52 +01:00
Makoto Onuki
1040da1d4e Enterprise quick contact 1/2
Now openQuickContact goes thorough DPM.  When a lookup URI is build with
a lookup key returned by the enterprise lookup APIs for a corp contact, the
lookup key will have a special prefix.  In that case we go through DPM
and have it launch QC on the managed profile, if the policy allows.

For now we use the same DPM policy as enterprise-caller-id to disable this.

Design doc: go/cp2-mnc-enterprise-dd

Bug 19546108

Change-Id: I831a8190ae902ae3b1248cce6df02e3a48f602d2
2015-03-30 16:28:39 -07:00
Makoto Onuki
4fd8d4ab2a Revert "Enterprise quick contact 1/2"
This reverts commit 75a0882b946df6de4775c9e54ca023ff54f3f678.

Change-Id: Ibe332885824b228bf1b1147d141c9395554ff67f
2015-03-30 20:42:20 +00:00