311 Commits

Author SHA1 Message Date
Rubin Xu
6e1c17a3df Merge "clear caller identify before sending system update notification" into mnc-dev 2015-05-14 14:00:18 +00:00
Rubin Xu
2c84cc2ea2 clear caller identify before sending system update notification
Because DeviceAdminReceiver is protected by BIND_DEVICE_ADMIN permission,
in order to send broadcast to it, we need to clear the caller's identity
and call sendBroadcastAsUser() as system.

Bug: 20213644
Change-Id: Icc7b239b9005e286012ade6580ec92a0a57198e0
2015-05-14 13:48:35 +01:00
Wojciech Staszkiewicz
9e9e2e73c6 Pass charset to XmlPullParser.setInput instead of null
Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
2015-05-14 10:24:34 +01:00
Robin Lee
39087b1cec Replace String host:port/url args with Uri arg
Uri provides a stronger guarantee of well-formedness and lets apps do
nice extra things like specifying scheme etc. without twisting any
expectations.

Bug: 20820034
Change-Id: Ia6bbedb74765444920b667d643fb7e1eb6a7292b
2015-05-14 07:15:18 +01:00
Nick Kralevich
9831fad676 Merge "Modify how USB connections are handled." into mnc-dev 2015-05-13 22:31:57 +00:00
Nick Kralevich
fcf10f7c12 Modify how USB connections are handled.
* Introduce a new "charger only" mode. In this mode, MTP is disabled,
and no file transfers can occur.
* Make charger only mode the default.
* Modify "persist.sys.usb.config" so it now only holds the adb status.
* Make the USB settings non-persistent. Unplugging the USB connection will
reset the device back to "charger only" mode.
* Fixup wording per UI guidelines.

TODO: Re-implement MDM restrictions for USB / MTP access controls.

Bug: 18905620
Change-Id: I99a50d9132a81e98187f431166fd9fef4d437e4f
2015-05-13 14:28:13 -07:00
Kenny Guy
467eb0566f Merge "Allowing profile to set a subset of keyguard restrictions." into mnc-dev 2015-05-13 21:07:17 +00:00
Julia Reynolds
396d944001 Merge "Remove initiator name param." into mnc-dev 2015-05-13 20:14:44 +00:00
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
Julia Reynolds
731051e36b Remove initiator name param.
This won't be shown in the UI; it's not needed.
Bug: 20820224

Change-Id: I51ecd0a9151a49e26faf52e792a0b316a8facc8e
2015-05-11 16:41:20 -04:00
Kenny Guy
0b7dd1e6c8 Allowing profile to set a subset of keyguard restrictions.
Allow admins in managed profiles disable trust related
keyguard features (trust agents and finger prints) for the
parent user.
Allow admins in managed profiles to control whether notifications
from the profile are redacted on the keyguard.

Bug: 18581512
Change-Id: Ic2323671f63781630206cc2efcc8e27ee58c38e6
2015-05-11 20:22:20 +01: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