215 Commits

Author SHA1 Message Date
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
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
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