242 Commits

Author SHA1 Message Date
Robin Lee
ee1f24ff29 Merge "Recognise insecure encryption with a new constant" 2015-03-16 14:32:12 +00:00
Nicolas Prevot
8458e531bf Merge "Remove the owner userid of cross-profile intent filters." 2015-03-16 11:25:51 +00:00
Fyodor Kupolov
916b1e503d Merge "Changed the logic of calculating effective password limits" 2015-03-13 16:17:10 +00:00
Benjamin Franz
68cc42009e Allow DO to set Settings.Global.STAY_ON_WHILE_PLUGGED_IN
Bug: 19704419
Change-Id: I3fc970eae8ef947775b6b565916bb245dea1b43b
2015-03-13 09:44:44 +00:00
Fyodor Kupolov
0a32d35ce2 Changed the logic of calculating effective password limits
Admins without limit-password policy or passwordQuality below
PASSWORD_QUALITY_COMPLEX, should be excluded from the list when
calculating effective limits.

Bug: 19603660
Change-Id: I7b7d8498c8a072a4c050be48709ce34bddba39a5
2015-03-12 15:59:00 -07:00
Benjamin Franz
f3ece36535 Block setting wallpapers from managed profiles.
Silently fail when a managed profile app tries to change the
wallpaper and return default values for getters in that case.
This is implemented through a new AppOp that is controlled by
a new user restriction that will be set during provisioning.

Bug: 18725052
Change-Id: I1601852617e738be86560f054daf3435dd9f5a9f
2015-03-09 10:39:21 +00:00
Julia Reynolds
2482100fed Merge "Allow device and profile owners to set a user icon." 2015-03-05 23:39:04 +00:00
Julia Reynolds
1c3754a35c Add security check for clearDeviceInitializer in the service.
Bug: 19230954
Change-Id: I5c648492bef0d2b579b6f59b91afc890e3092d36
2015-03-05 11:47:14 -05:00
Nicolas Prevot
4b8d582151 Remove the owner userid of cross-profile intent filters.
The owner user id was used to identify in which user an app had set
a cross-profile intent filter. But it's not really necessary.

BUG:19505190

Change-Id: Iacc49d31c95e34efee1895e5fbe7224277dbc493
2015-03-05 15:28:54 +00:00
John Spurlock
75328b703f Merge "Audio: Remove the concept of master volume." 2015-03-04 22:59:41 +00:00
John Spurlock
ee5ad729b9 Audio: Remove the concept of master volume.
- Remove two config resources (use master volume, and volume ramp).
- Remove master volume adjustments / getters / intents.
- Retain @hidden setMasterMute, needed for device admin
- Remove master volume logic in AudioService.
- Remove master volume logic in VolumePanel.
- Rename "getMasterStreamType" to "getUiSoundsStreamType" to avoid confusion.

Bug: 19582978
Change-Id: Id02c8fa4898cff3b913147f5ac1b4038e2e7cc24
2015-03-04 17:51:44 -05:00
Julia Reynolds
e925440a55 DOs can clear the DI; rehide hasUserSetupCompleted.
Bug: 19230954
Change-Id: I97467229b23f3c9be1c3c4fff1c888a812f14a95
2015-03-04 17:36:00 -05:00
Julia Reynolds
fca04ca096 Allow device and profile owners to set a user icon.
Change-Id: I7c2bafb85cff3fa063af7a2f27b76c69172f0525
2015-03-04 16:04:22 -05:00
Julia Reynolds
20118f18c1 Allow the device initializer to perform user setup tasks.
A device initializer is an application that is allowed to run
during user provisioning on device owner devices. During
device provisioning (or, user provisioning of the first user
of the device), a device initializer is granted device owner
permissions. During secondary user provisioning, a device
initializer is granted profile owner permissions. Once
provisioning is complete for a user, all elevated permissions
are removed from the device initializer and the device admin
component of the app is disabled.

Bug: 19230954
Change-Id: Ib6725fb3b09bb21e4198a5dc0b445ccebb40b27e
2015-03-04 10:25:43 -05:00
Nicolas Prevot
abc03c7ae8 Merge "Fail silently when changing BLUETOOTH_ON/WIFI_ON directly" 2015-02-26 16:51:56 +00:00
Nicolas Prevot
41916d492c Fail silently when changing BLUETOOTH_ON/WIFI_ON directly
If the device owner tries to change BLUETOOTH_ON or WIFI_ON via
DevicePolicyManager.setGlobalSetting, fail silently.

There was not much point for the device owner to do it since it can
also change bluetooth/wifi state via normal bluetooth and wifi apis.

BUG:19311992

Change-Id: Ifba163800aa413865b8a2877cb21aacfa5cfc6c8
2015-02-26 11:57:29 +00:00
Esteban Talavera
4b7656f183 Allow setting a Device Owner via ADB on unprovisioned device with preinstalled account
Some devices come from carriers with a preinstalled account. This
means that we couldn't set a device owner via "adb shell dpm"
commands, while the regular device owner flow worked (as the
latter just checked whether the device was provisioned).

Bug: 18354022
Change-Id: I9a677de9d34d073e218b9179ec4b0f5b4b82adc9
2015-02-25 17:48:39 +00:00
Robin Lee
3795fb0a13 Recognise insecure encryption with a new constant
This is the default state on some devices which ship with encrypted key
storage set up already but no initial password.

Bug: 18048558
Change-Id: I055527fde21298bae2dbdca8c3a145f19b045aad
2015-02-23 11:46:33 +00:00
Nicolas Prevot
f580c91618 Merge "Dump the profile/device owner when dumping device policy state." 2015-02-20 10:33:18 +00:00
Fyodor Kupolov
fcc87275e3 Merge "Code cleanup" 2015-02-19 22:53:26 +00:00
Fyodor Kupolov
22029f0a50 Code cleanup
Use preconditions for argument checking.

Change-Id: I2e9dcd8da1e0bdac917393376d1a7442ab63a638
2015-02-19 14:50:44 -08:00
Amith Yamasani
397999f084 Merge "Save per-user camera policy in different system properties" 2015-02-18 00:20:08 +00:00
Robin Lee
abf3570f38 DevicePolicy: Make uid parameter an int
This should not have been a long to begin with.

Change-Id: Icbf6e2e97cb6301b968b3eb8b3f9a46331f7983e
2015-02-17 14:18:32 +00:00
Nicolas Prevot
7a7f0c9756 Dump the profile/device owner when dumping device policy state.
BUG:19363615
Change-Id: Icf04b39ce8c592544e69c52f229a2c1bdab661e2
2015-02-16 13:32:35 +00:00
Robin Lee
f6901eb9e2 Merge "Device Policy API to choose a private key silently" 2015-02-16 10:47:51 +00:00
Amith Yamasani
5095698074 Save per-user camera policy in different system properties
If a device admin for a user disables the device cameras,
only apply that policy to that user and not globally.

Corresponding change in CameraService looks into the
per-user system property.

This also fixes the bug that managed profile owner is
able to disable camera for the personal profile.

Bug: 19345698
Change-Id: Ibd5e438544a0409f26087ced247d50c706fcf843
2015-02-13 13:48:40 -08:00
Nicolas Prevot
5cfd3d8b51 Merge "Avoid NullPointerException in enableSystemApp if the app is absent." 2015-02-11 17:05:19 +00:00
Nicolas Prevot
0413046f12 Dont throw an exception for non-system apps when enabling system apps.
In EnableSystemAppWithIntent: if a non-system app matches the intent:
ignore it instead of throwing an exception.

Change-Id: I64dc9a0bbc1a6bc5e2159a33b7273464ed2518c5
2015-02-11 14:17:21 +00:00
Nicolas Prevot
637baaf0db Avoid NullPointerException in enableSystemApp if the app is absent.
In enableSystemApp: if the app is absent, throw a IllegalArgumentException
instead of failing with a NullPointerException.

BUG:19321306

Change-Id: I4ec09a0a77d29ca04e8d52f5546c1e4d0f8641e5
2015-02-10 17:33:31 +00:00
Kenny Guy
3775a3f886 am a2ced3e8: am 8d12d3da: Merge "Only switch user if current user is being wiped" into lmp-mr1-dev automerge: eeb43fb
* commit 'a2ced3e879458786edf715a0016293791db7fd65':
  Only switch user if current user is being wiped
2015-02-05 19:39:36 +00:00
Robin Lee
3798ed5e0b Device Policy API to choose a private key silently
Support for certificate chooser (keychain) to first query a profile
owner (if one exists) for a silent credentials grant which will be
passed back to the caller as an alias.

Bug: 15065444
Change-Id: I0729b435c218b7991e6cb5faedefb7900577afcc
2015-02-05 19:38:43 +00:00
Kenny Guy
e9acb59a91 Only switch user if current user is being wiped
Only try and switch to owner if the current user
is being removed.

Bug: 19252449
Change-Id: I0143d87360db0834876821cbf52fec4933ecbd35
2015-02-04 17:55:42 +00:00
Fyodor Kupolov
babdb0dc36 Merge "Removed userHandle from setXXX methods" 2015-01-30 19:21:10 +00:00
Fyodor Kupolov
bdc58c66af Removed userHandle from setXXX methods
User handle is now extracted from UID of the calling process.

Previously setXXX methods may not work properly, if userHandle parameter
was different from a user of the calling process. In practice, this wouldn't
have happened because setters were always called with a userHandle of the
caller process.

Bug:17202572
Change-Id: I1c08c54c975a04b8c54719a1e280ad3cfaff2e67
2015-01-29 17:54:06 -08:00
RoboErik
4197cb60bc Move mute/unmute handling to adjust volume paths
This deprecates the setStreamMute and setStreamSolo APIs. Soloing is no
longer supported and muting is redirected through the adjust volume APIs.

Also updates the hidden master versions of these APIs.

Change-Id: I65d2a5d5fc15b386bd497abf8ca6869fec75a26a
2015-01-29 16:14:30 -08:00
Benjamin Franz
8e1b6d949b am ad664808: am 6d16b861: Merge "Avoid NullPointerException if createUser returns null" into lmp-mr1-dev automerge: 2805669
* commit 'ad66480838189332b82cd2861bca4357aa2b93da':
  Avoid NullPointerException if createUser returns null
2015-01-26 11:04:41 +00:00
Zoltan Szatmary-Ban
43daa008f3 am 20bd0c23: am 059b8ab6: am 414ea81e: Merge "Ensure notifications are sent when locking/unlocking location share" into lmp-mr1-dev
* commit '20bd0c232cd4421affc871ccd01492ecd04316d0':
  Ensure notifications are sent when locking/unlocking location share
2015-01-26 10:54:55 +00:00
Benjamin Franz
6d16b8614a Merge "Avoid NullPointerException if createUser returns null" into lmp-mr1-dev 2015-01-26 10:49:48 +00:00
Zoltan Szatmary-Ban
414ea81ea3 Merge "Ensure notifications are sent when locking/unlocking location share" into lmp-mr1-dev 2015-01-26 10:36:14 +00:00
Benjamin Franz
f87b174dac Avoid NullPointerException if createUser returns null
If createUser returns null, we run into a NullPointerException
in createAndInitializeUser. This can happen when the policy
DISALLOW_ADD_USER is set.

Bug: 19121141
Change-Id: Id4bda832a243fa42c31eb5a176ecaa248aee68f5
2015-01-23 17:04:16 +00:00
Benjamin Franz
cd7b506c19 am bfca5f40: am 266303fd: Merge "Avoid SecurityException when calling getUserData" into lmp-mr1-dev
automerge: 07b87e5

* commit '07b87e537da3ec658235fe1d874c7dba5b4d696d':
  Avoid SecurityException when calling getUserData
2015-01-23 14:46:31 +00:00
Benjamin Franz
266303fdb0 Merge "Avoid SecurityException when calling getUserData" into lmp-mr1-dev 2015-01-23 14:33:06 +00:00
Zoltan Szatmary-Ban
871fa7343a Ensure notifications are sent when locking/unlocking location share
When the restriction 'DISALLOW_SHARE_LOCATION' is applied or removed on a user
it is important to send out notifications to content observers of
LOCATION_PROVIDERS_ALLOWED.

Bug: 18995405
Change-Id: I8b3910a423a012ea9d15470eec101723c9f0eaf7
2015-01-23 14:08:30 +00:00
Benjamin Franz
fadb2b3a27 Avoid SecurityException when calling getUserData
Currently we risk getting a SecurityException in a number of places,
where getUserData is called for a different user than the calling user.
To avoid this, the caller is cleared in a helper function.

Bug: 18662452
Change-Id: Ibc131c602e52d9f013fe739a9c18e693181ded67
2015-01-22 16:16:16 +00:00
Kenny Guy
2dc53c560b am 4be433dc: am 10dd6eef: am fd846dfb: Merge "Sync file before using JournaledFile commit." into lmp-mr1-dev
* commit '4be433dc0b817fd4129e2bd99edb4c484f980600':
  Sync file before using JournaledFile commit.
2015-01-16 11:36:46 +00:00
Kenny Guy
212037f7cd Sync file before using JournaledFile commit.
Ext4 doesn't guarantee that write file.new / close file.new
rename file.new to file will mean data in file.new makes it
to file atomically. The rename may happen with previous contents
of file.new and then later update to new contents
See docs for noauto_da_alloc
So rebooting the device during JournaledFile.commit may
mean we are left with an empty file.

Bug: 18590558
Change-Id: I35322c82871bed30c2c6ebbd1388338f0471f3ba
2015-01-15 18:48:01 +00:00
Robin Lee
7f7ea82c28 Profile owner hint in warning for extra CAs
The version of the warning with a named installer should be shown in
the case of a managed profile, not only a managed device.

Bug: 18224038
Change-Id: I27865f77e963b9b15416f2e4a4ffc38fed8f5532
2015-01-09 11:25:04 +00:00
Robin Lee
e53b7dd066 Revert "Profile owner hint in warning for extra CAs"
This reverts commit e1d8dcd9e170c1ed8a13b6e1256ea1fb22c26c49.

Something funny happened in the process of submitting this,
swathes of strings.xml became mis-encoded.

Bug: 18224038
Change-Id: I0276ff3f880fe749546e8cc7e3e2f41c22c27705
2015-01-08 22:08:42 +00:00
Adrian Roos
dce0122ea2 Explicitly specify user on LPU's private methods
Also fixes a bug in DevicePolicyManagerService where
the wrong user was used.

Bug: 18931518
Change-Id: I7ae8ecfdb1c835cdee7eafa2b96e1ec8b712977b
2015-01-08 13:53:52 +01:00
Adrian Roos
230635efe7 Purge biometric weak and keyguard widgets
Bug: 18931518
Change-Id: I5da41908b1d6895a69f981e139f2d268327fafcd
2015-01-07 22:10:35 +01:00