301 Commits

Author SHA1 Message Date
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
Robin Lee
8e99586830 am 26e2da8f: am 374c358d: Merge "Profile owner hint in warning for extra CAs" into lmp-mr1-dev
automerge: 23bb3f1

* commit '23bb3f11cbe4ca64337b5b75c333ea891760213f':
  Profile owner hint in warning for extra CAs
2015-01-07 12:43:41 +00:00
Robin Lee
e1d8dcd9e1 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: I58bddb162799481d5e8feb169b0c0bff17cbeeb7
2015-01-05 19:52:54 +00:00
Esteban Talavera
ea84327fa4 Merge "Remove deprecated version of setProfileOwner that takes packageName" 2014-12-29 10:55:31 +00:00
Robin Lee
77f9a44adb am b4b14e39: Merge "Revert "DevicePolicy: Don\'t warn about managed profile CAs"" into lmp-mr1-dev automerge: c9db16c
automerge: b6b7d42

* commit 'b6b7d4251cdab1843ae9b2ae167ac9276ada241e':
  Revert "DevicePolicy: Don't warn about managed profile CAs"
2014-12-28 05:51:19 +00:00
Esteban Talavera
8add57224f Remove deprecated version of setProfileOwner that takes packageName
The ComponentName equivalent should be used instead.

Bug: 17654371
Change-Id: I7001e86ab1709b824944148a3c44af5243dacb83
2014-12-24 09:38:13 +00:00
Robin Lee
b4b14e391d Merge "Revert "DevicePolicy: Don't warn about managed profile CAs"" into lmp-mr1-dev 2014-12-23 12:30:28 +00:00
Robin Lee
853964927c Revert "DevicePolicy: Don't warn about managed profile CAs"
This reverts commit 80559f4aadb3419eecdf6bf61945af584cd2aa8a.

Bug: 18224038
Change-Id: I108a4e8cf185401fef4806e1ad8c2cc78992e843
2014-12-22 13:22:11 +00:00
Fyodor Kupolov
77779aa3a5 am d483a85e: am fed2812d: am 22afe626: Merge "Added isRemovingAdmin method" into lmp-mr1-dev
* commit 'd483a85e69c3bb83b25473b93806e063b72c9315':
  Added isRemovingAdmin method
2014-12-09 00:18:21 +00:00
Amith Yamasani
f66a43e398 am 81b27f4c: am b2905092: am 0702752c: Merge "Potential fix for accidental deactivation of profile owner" into lmp-mr1-dev
* commit '81b27f4c9fcdb1e3379152d08a3abc0fb5e62c53':
  Potential fix for accidental deactivation of profile owner
2014-12-09 00:18:07 +00:00
Fyodor Kupolov
22afe6261a Merge "Added isRemovingAdmin method" into lmp-mr1-dev 2014-12-05 19:28:12 +00:00
Fyodor Kupolov
96fb932666 Added isRemovingAdmin method
Added isRemovingAdmin method, so that clients can query if device
admin is currently being removed.

Bug: 17609838
Change-Id: I82547a9eeb228fcf8ac2a6e639ca1a75fa41d161
2014-12-04 17:53:45 -08:00
Amith Yamasani
a0116afeaf Potential fix for accidental deactivation of profile owner
This is a safeguard to only check for changing packages when
re-validating active admins.
1. If package is being removed, only check if it's not being
   replaced.
2. If package is changing, only check the changing package that
   matches one of the active admins.
3. If package is being added and is a replacement (update), then
   check if it affects any matching active admins and verify the
   validity of the receivers.

If by any chance some package broadcast was occuring at a time when
an admin was being updated, or the package removed broadcast was
coming in much before the update was registered with package manager
then this will help in avoiding accidental deactivation.

Bug: 18590558
Change-Id: I7f4897e8836f81aa037b8be87d399942ce78b1a2
2014-12-04 14:49:24 -08:00
Paul Crowley
5ff0e5fb6b am 0d122e26: am ba94fd5e: am 77e25331: Merge "Add flag for wiping factory reset protection data." into lmp-mr1-dev
* commit '0d122e265c52ef25dbad652378b3a5e51a86f041':
  Add flag for wiping factory reset protection data.
2014-11-26 12:09:51 +00:00
Robin Lee
e07f2c01af am a7ffed86: am cc19e8b8: am 692e4933: Merge "DevicePolicy: Don\'t warn about managed profile CAs" into lmp-mr1-dev
* commit 'a7ffed86fce0a0cab8915bd6a727605959f08bb7':
  DevicePolicy: Don't warn about managed profile CAs
2014-11-26 12:09:33 +00:00
Paul Crowley
77e25331ca Merge "Add flag for wiping factory reset protection data." into lmp-mr1-dev 2014-11-25 21:13:30 +00:00
Paul Crowley
a7e87acb24 Add flag for wiping factory reset protection data.
Bug: 18366448
Change-Id: If8904888a6bf8611d34647e6d65d2347d824dbb3
2014-11-25 20:48:41 +00:00
Robin Lee
80559f4aad DevicePolicy: Don't warn about managed profile CAs
Setting up a managed profile should have included a step to warn about
this sort of thing already. As the user should trust the profile owner
anyway it's hard to argue this warning is needed.

Bug: 18224038
Change-Id: Ie86ba26851af726c0dec30eb9c32894ed6bb4a00
2014-11-25 15:48:48 +00:00
Adrian Roos
e1d84dd914 am 9a4d0257: am 520d20c1: am 702d9e31: Merge "Fix DPM.resetPassword("")" into lmp-mr1-dev
* commit '9a4d0257beadf53c706afbcb4abc76c17a44ff00':
  Fix DPM.resetPassword("")
2014-11-25 15:15:35 +00:00
Adrian Roos
702d9e31b1 Merge "Fix DPM.resetPassword("")" into lmp-mr1-dev 2014-11-24 16:02:11 +00:00
Amith Yamasani
9d4e6a8355 am 1f26bf6b: am 108bdbc9: am efb2df69: Merge "Different messages when wiping user and not device" into lmp-mr1-dev
* commit '1f26bf6bfd683b840f688b41d285fd9c942e6ed5':
  Different messages when wiping user and not device
2014-11-22 00:00:01 +00:00
Amith Yamasani
3a3d212a51 Different messages when wiping user and not device
There are 3 types of users
1. Primary - device will be wiped
2. Managed profile - profile will be removed
3. Secondary user - user will be removed

Show different messages for almost wipe and wipe in each
of these 3 cases.

Bug: 16843155
Change-Id: Icecfe520622773da9e45465bf2217e8ed38b266e
2014-11-21 13:57:48 -08:00
Zoltan Szatmary-Ban
ffba290a33 am 5c374a58: am b3d0580f: am 08229e81: Merge "Shutdown backup manager service when device owner is set" into lmp-mr1-dev
* commit '5c374a582ceff913e420d21d63e1d7b087d6fc56':
  Shutdown backup manager service when device owner is set
2014-11-21 15:31:49 +00:00
Zoltan Szatmary-Ban
08229e817e Merge "Shutdown backup manager service when device owner is set" into lmp-mr1-dev 2014-11-21 15:21:07 +00:00
Adrian Roos
f8f56bce42 Fix DPM.resetPassword("")
While we're at it, also fix some multi-user issues in
LockPatternUtils.

Bug: 17496766
Change-Id: I8e557ea640fa589817c8f8f818c91463585d5ea7
2014-11-21 13:34:06 +01:00
Rubin Xu
4221126b95 am 3c1d5e2f: am 40603baa: am 735f2285: Merge "Remove permission check in DevicePolicyManager.isUninstallBlocked()" into lmp-mr1-dev
* commit '3c1d5e2f9d0724f0a10313244d0ef47957d855f2':
  Remove permission check in DevicePolicyManager.isUninstallBlocked()
2014-11-19 00:24:13 +00:00
Rubin Xu
dbf32fe93a am f978e667: am 0122db0a: am 3a7d3fc6: Merge "Fix equality test in getProfileOwnerAdmin()" into lmp-mr1-dev
* commit 'f978e667a6395902be09f3dd6c5c6b8d17ce58da':
  Fix equality test in getProfileOwnerAdmin()
2014-11-19 00:24:09 +00:00
Rubin Xu
735f22850e Merge "Remove permission check in DevicePolicyManager.isUninstallBlocked()" into lmp-mr1-dev 2014-11-18 23:43:17 +00:00
Rubin Xu
3a7d3fc60e Merge "Fix equality test in getProfileOwnerAdmin()" into lmp-mr1-dev 2014-11-18 23:42:21 +00:00
Rubin Xu
a97855b784 Remove permission check in DevicePolicyManager.isUninstallBlocked()
This is to allow Play to use this API to find out whether a package
is uninstallable due to profile or device owner policy's restriction.

Bug: 17914630
Change-Id: I4ce2963884ecdf3306805f36db80ed1ebf04d88f
2014-11-18 17:53:46 +00:00
Fyodor Kupolov
0477f71631 am 70b2de7c: am 6dd9f86f: Merge "Added synchronization to handlePackagesChanged method" into lmp-mr1-dev automerge: a07bdda
* commit '70b2de7c25a083a44042ddd0cb8b2a24dde53e6e':
  Added synchronization to handlePackagesChanged method
2014-11-14 21:45:57 +00:00
Zoltan Szatmary-Ban
26ac6a6fd0 Shutdown backup manager service when device owner is set
Bug: 16641441
Change-Id: I3fe54e43324c15dabd56834a923e8e8cb4eea98d
2014-11-13 20:49:43 +00:00
Fyodor Kupolov
d01ff6d4c3 Added synchronization to handlePackagesChanged method
Method handlePackagesChanged modifies the policy data without holding the
lock. It also calls methods which expect a lock to be held -
validatePasswordOwnerLocked, syncDeviceCapabilitiesLocked, saveSettingsLocked.

Bug: 18262633
Change-Id: Ia4bdc6edc66bccf8a4288e048171ff20858ae2f6
2014-11-12 11:27:21 -08:00
Amith Yamasani
7c2f242230 am e73cab5f: Merge "Allow profile owners to set the unknown source setting" into lmp-mr1-dev automerge: 93ffd5d automerge: 15de62d
* commit 'e73cab5f1226f7434fa8bbf341e91891916683c5':
  Allow profile owners to set the unknown source setting
2014-11-12 03:44:49 +00:00
Jeff Brown
70170261cb am 32f7a6d8: Merge "Move device admin max screen off timeout to internal interface." into lmp-mr1-dev automerge: c1275e7
automerge: a473878

* commit 'a4738781584d58e133fc4d0f55d9b7ebcb246ff6':
  Move device admin max screen off timeout to internal interface.
2014-11-12 02:46:10 +00:00
Amith Yamasani
52c39a16db Allow profile owners to set the unknown source setting
This allows work profile MDM to enable unknown sources
even if the user doesn't have UI for it. Installing an
app from an unknown source will still prompt the user
with the package installer dialog, so it's not like the
MDM can now quietly install apps from non-market sources.

Bug: 18316350

Change-Id: Ia8f4fe36f12a258aa888e085acc0b358925f4817
2014-11-11 23:38:24 +00:00
Jeff Brown
5ce1cb240b Move device admin max screen off timeout to internal interface.
The setting was previously exposed in IPowerManager but it
doesn't need to be there.

Bug: 17656076
Change-Id: If3ed0cbe89f67c60aa00376be0c54b1bd9656144
2014-11-06 19:34:21 -08:00
Jim Miller
cc56956025 am 767ae175: am 6230cdf5: am 262dc4da: Merge "Update TrustAgentService API after review" into lmp-mr1-dev
* commit '767ae175fab5a93f4948b3722549448eb4b55e41':
  Update TrustAgentService API after review
2014-11-06 03:12:08 +00:00
Jim Miller
e303bf4435 Update TrustAgentService API after review
This change incorporates API council feedback and enables the
TrustAgent whitelisting API.

It also contains a minor cleanup of DPM's use of UserHandle
to eliminate unnecessary object creation.

Fixes bug 17008504

Change-Id: I63cc50169fde54b34406845818bcaf6aadc1a3db
2014-11-05 18:17:56 -08:00
Rubin Xu
d7892e71a8 Fix equality test in getProfileOwnerAdmin()
The equality test should compare a ComponentName, which admin.info is not.

Bug: 18186447
Change-Id: If984ae2e0da958889564ba30716d65245a78d60f
2014-10-30 17:57:23 +00:00
Yohei Yukawa
7e351fdae8 Stop querying package names unnecessarily
This is just a code clean-up.  No behavior change is intended.

BUG: 18131340
Change-Id: Ia88374cde7845553530ddd1176f983101e4ec13f
2014-10-29 00:52:46 +00:00
Benjamin Franz
f5c00c1c11 Merge "Send ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED Broadcast when a user restriction has been changed." into lmp-mr1-dev 2014-10-28 16:13:05 +00:00