577 Commits

Author SHA1 Message Date
Andrei Stingaceanu
16187903b4 AfW custom lock screen message - API polish
DevicePolicyManager:
* getDeviceOwnerLockScreenInfo now returns CharSequence as it returns a string
  for display to a user
* setDeviceOwnerLockScreenInfo
** accepts CharSequence, not String as this is a string displayed to the user
** Returns void; throws an appropriate runtime exception on failure

Bug: 27531295
Change-Id: I30528569cfa66ee76f857fbee1c3196f821718fd
2016-03-29 13:04:29 +00:00
Jeff Sharkey
fac4ddbd25 Work around buggy DMAgent.
They're targeting new API level, but they aren't handling the new
constants.

Bug: 27785116
Change-Id: I8391294d963c86af1f948b91c7d1de6b7f44f66a
2016-03-28 09:14:10 -06:00
Lenka Trochtova
a7c85adeda Let the profile owner set lock-to-apps if the user is affiliated.
BUG: 25632687

Change-Id: I76008b6a8e2194155154dc7693d43ce20f7e9fad
2016-03-24 11:15:23 +01:00
Victor Chang
d3c0cf50b6 Merge "Api change of DPM.setApplicationRestrictionsManagingPackage()" into nyc-dev 2016-03-21 13:08:14 +00:00
Victor Chang
cd14c0a9da Api change of DPM.setApplicationRestrictionsManagingPackage()
Throws NameNotFoundException instead of IllegalArgumentException

Can't throw NameNotFoundException directly from DPMS as
aidl doesn't support checked exception

Bug: 27532565
Change-Id: I202721f41057f92ad2dd851d4769ba4502a8f9b3
2016-03-18 16:44:21 +00:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Michal Karpinski
6235a94ffa Unifying method names and comments to security logging, not device logging
Also move SecurityLog to android.app.admin package.

Bug: 27531824
Bug: 27532560
Bug: 27532564
Bug: 27532425
Change-Id: I2677afdb5685bc5d21e52c41b381b57a41e364b6
2016-03-16 14:32:09 +00:00
Mahaver Chopra
8a8e8ea19a Merge "Update DPM.reboot with new restriction" into nyc-dev 2016-03-15 19:48:33 +00:00
Mahaver Chopra
1216ae5d02 Update DPM.reboot with new restriction
DPM.reboot() should not be called when there is an ongoing call on the
device.

Bug:27531799
Change-Id: Idc1fa4c7aa79b20ec9c2afcccf855455ee316787
2016-03-15 19:46:05 +00:00
Sudheer Shanka
b5a4d9605f Merge "Show admin support dialog if app is suspended." into nyc-dev 2016-03-15 18:50:01 +00:00
Sudheer Shanka
7a9c34bd7a Show admin support dialog if app is suspended.
Bug: 26922950
Change-Id: I21f048873244df52d14910cc01a658af476d9149
2016-03-15 10:40:04 -07:00
Michal Karpinski
c4927b9fd4 Logging of setting ro.device_owner property
Without logging of setting it's impossible to test the setup, unless
device is rooted.

Bug: 22860162
Change-Id: I0532654ef4e4b7272d2749b30590a1b47da9f645
2016-03-15 17:04:59 +00:00
Makoto Onuki
d4c9e541ec Add ENCRYPTION_STATUS_ACTIVE_PER_USER to...
getStorageEncryptionStatus()
Use StorageManager APIs to get the encryption
state instead of from the system properties
directly.

Bug 26547262

Change-Id: Ic27baa9489d43a93873f8bb0428084f8886aed67
2016-03-11 15:50:04 -08:00
Paul Lawrence
03128dceab Fix bug in new encryption API
Bug: 27583871
Change-Id: I372f0a6a411704dc57ca9bcc53c4c5a10b236772
2016-03-10 10:02:07 -08:00
Michal Karpinski
2f79ae98af Tuning down wtf to warning for setting ro.device_owner property
This was logged to often, especially while running CTS hostside tests
and looked too scary to people.

Bug: 27230864
Change-Id: I9e81d9efe87b4aed18aa473be647c560ff9cfa0d
2016-03-10 15:00:08 +00:00
Paul Lawrence
d5a3f3df40 Merge "Add API to IMountService to get encryption state" into nyc-dev 2016-03-09 13:42:41 +00:00
Paul Lawrence
20be5d6247 Add API to IMountService to get encryption state
Bug: 18002358
Change-Id: If7d9c9a5ed38ac37849fcf638ec10c76d2f419a1
2016-03-08 15:03:54 -08:00
Sudheer Shanka
97e89c624e Merge "Update DPM.getWifiMacAddress to take admin component as argument." into nyc-dev 2016-03-08 22:52:11 +00:00
Tony Mak
29d6b9f0f7 Merge "clear calling identity before calling getUserInfo" into nyc-dev 2016-03-08 18:09:35 +00:00
Makoto Onuki
ed58f5f0aa Merge "Introducing ShortcutManager" into nyc-dev 2016-03-08 18:01:05 +00:00
Tony Mak
4d9abf92d4 clear calling identity before calling getUserInfo
Bug: 27523508
Change-Id: I243a5423de850477cf65968c8ea26cbb3ae896d5
2016-03-08 17:00:22 +00:00
Sudheer Shanka
3cb4da16dc Update DPM.getWifiMacAddress to take admin component as argument.
Bug: 27532280
Change-Id: I3a5e9557c3c6ac43c458c911a5309bdb2655fb66
2016-03-07 18:51:49 -08:00
Kenny Guy
1145cd26bd Don't crash if KeyChain can't be bound to.
KeyChain can throw an assertion error if
is not around, don't allow that to take down
system.

Bug: 27518175
Change-Id: I99418dfb65c58d3e07cbda91860cdb493b96a836
2016-03-07 13:59:56 +00:00
Jeff Sharkey
fdc5ba8f43 Merge "Move more PM calls to ParceledListSlice." into nyc-dev 2016-03-05 21:06:39 +00:00
Jeff Sharkey
d5896630f6 Move more PM calls to ParceledListSlice.
Since the data returned by these calls can grow unbounded based on
various GET flags, we need to switch 'em over.

Bug: 27391893
Change-Id: Ie849ca30dbaaa91158da4c83675657715629a0ee
2016-03-04 16:31:34 -07:00
Makoto Onuki
6f7362d925 Introducing ShortcutManager
What's supported:
- Most APIs are implemented, except for SM.updateShortcuts(),
the icon APIs in LA, and LA.startShortcut().
- Persisting information, except for icons
- Throttling

In addition, now PersistableBundle has a public copy
constructor from a Bundle. (Do we want to @hide it?)

TODOs:
- Add icon support
- Implement missing APIs
- Listen to PACKAGE_* broadcasts and do clean-up
- Support multi-launcher apps (pinned shortcuts per launcher)
- Dev option to reset throttling
- Load throttling config from Settings
- Backup & restore
- Figure out LauncherApps permissions (BIND_APPWIDGETS??)
- Other minor TODOs in the code
- Better javadoc

Note: This requires Idf2f9ae816e1f3d822a6286a4cf738c14e29a45e

Bug 27325877

Change-Id: Ia5aa555a4759df5f79a859338f1dc5e624cd0e35
2016-03-04 15:24:49 -08:00
Suprabh Shukla
e1fd7f09d5 Merge "Not clearing data for a package that is a DO or PO" into nyc-dev 2016-03-04 20:38:44 +00:00
Victor Chang
0114263a1a Merge "enforceCanSetDeviceOwnerLocked should enforce userId == USER_SYSTEM for non-split user mode" into nyc-dev 2016-03-04 13:13:27 +00:00
Victor Chang
915d524553 Merge "isDeviceOwnerProvisioningAllowed implementation to match enforceCanSetDeviceOwnerLocked" into nyc-dev 2016-03-04 13:13:14 +00:00
Victor Chang
e29cd4724f enforceCanSetDeviceOwnerLocked should enforce userId == USER_SYSTEM for non-split user mode
Bug: 27453111
Change-Id: I1acdfecdf4474696e904a6a4df189453be306aa4
2016-03-04 10:34:43 +00:00
Victor Chang
5676ae256a isDeviceOwnerProvisioningAllowed implementation to match enforceCanSetDeviceOwnerLocked
The main purpose is to fix the security flaw that
user can force isDeviceOwnerProvisioningAllowed to return true
by setting the device_provisioned without factory reset

Check UserSetupComplete instead, as it's cached by DPMS if it's ever set to true

Refactor common code of isDeviceOwnerProvisioningAllowed and enforceCanSetDeviceOwnerLocked
The functionality of enforceCanSetDeviceOwnerLocked should be exactly the same.
DPM Unit Test all pass

Bug:27403225
Change-Id: I32dae8e222e01e08664abb313ead3a92d4186658
2016-03-04 10:34:33 +00:00
Suprabh Shukla
d04525214b Not clearing data for a package that is a DO or PO
Added a check inside PackageManagerService to make sure data for a
package with a DO or PO for the running user is not cleared. Currently,
the 'pm clear' command goes through without any such checks.

Bug: b/27243904
Change-Id: I87d4ad2db031f47946f34627a5ee465ef144f85e
2016-03-03 16:04:12 -08:00
Michal Karpinski
ba24409033 Rework of remote bugreports UX
New notifications, that open dialogs.

Bug: 26226230
Change-Id: I50f9ab23b6c6d03892889d9081cabb0a3d858f91
2016-03-03 17:06:14 +00:00
Ricky Wai
8bbace3afc Merge "Fix clearDeviceOwner() not working in split-user mode" into nyc-dev 2016-03-03 06:02:31 +00:00
Tony Mak
e9aa6ec1cf Fix setBluetoothContactSharingDisabled does not persist
The default value of bluetotoh contact sharing is true.
So we should save when it is false.

Bug: 27410265
Change-Id: Icaf4ceeda09eca46d160acfecc53834819b66a18
2016-02-29 21:32:47 +00:00
Ricky Wai
45eb8bd9b9 Fix clearDeviceOwner() not working in split-user mode
Bug: 25906481
Change-Id: Iefe004b4bac7a7fc79c613e61a42f916fce7230e
2016-02-29 15:13:35 +00:00
Makoto Onuki
a4fae1545a Merge "Support safe mode properly." into nyc-dev 2016-02-24 22:20:08 +00:00
Makoto Onuki
889c088066 Support safe mode properly.
In safe mode, IPM.queryXxx() doesn't work.  Use IPM.getReceiverInfo()
directly instead.

Bug 27108276

Change-Id: Ice8f882559b8f0596a19ddb3a16395a4dc538a25
2016-02-24 13:12:01 -08:00
Robin Lee
155a280e18 Merge "DPM: installKeyPair variant: caller can self-grant" into nyc-dev 2016-02-24 18:14:36 +00:00
Robin Lee
ce3399fbb4 DPM: installKeyPair variant: caller can self-grant
If 'requestAccess' is true, the caller (either profile/device owner or a
designated certificate installer) will be granted usage of the keypair
on successful installation.

This has no security implications for a profile/device owner which would
already be able to self-grant. Delegated certificate installers did not
have this ability before.

This is only allowed at install-time- not afterward.

Bug: 24746231
Change-Id: Ia0ec290bb0bcde1d8137c188e2667cb7718dbfd7
2016-02-24 17:14:41 +00:00
Lenka Trochtova
515a6c7030 Merge "Throw UnsupportedOperationException when creating ephemeral user on a system without split system user." into nyc-dev 2016-02-24 13:50:17 +00:00
Michal Karpinski
a0ea967d11 Removing lock contention in SecurityLogMonitor
After being interrupted the monitor thread tried to acquire
a lock that is held by interrupting thread, resulting in timeouting
on join().

Bug: 27061904
Change-Id: Ifbd578d5f5a266083b207fedd8ebb6d26ab08c31
2016-02-24 12:04:17 +00:00
Lenka Trochtova
3dfe7f655d Throw UnsupportedOperationException when creating ephemeral
user on a system without split system user.

BUG: 27143201

Change-Id: I7b7e634ba7fce576dd72a416e802c80939f05d3e
2016-02-23 19:49:39 +01:00
phweiss
27ee33482a Remove deprecated APIs DPM.createUser, createAndInitializeUser
They were deprecated in M and slated for removal in N.

Bug: 26974903
Change-Id: I7ae4d60bcf226c1e1de42852b378ad1ff71a914b
2016-02-22 14:04:14 +01:00
Lenka Trochtova
024f979dfd Allow ephemeral users on the split-system-user systems only.
BUG: 27143201

Change-Id: I37f3ca7366648dbf07df39a7a972857e0ff78a9a
2016-02-19 11:11:26 +01:00
Makoto Onuki
4ab36372fb Merge "Clean up on UserManagerService and DPMS" into nyc-dev 2016-02-19 00:21:48 +00:00
Makoto Onuki
2a3c3da0fc Clean up on UserManagerService and DPMS
- Avoid the ART warning about 4.1 compatibility
- Avoid integer overflow in DPMS

Bug 27243525
Bug 27242859

Change-Id: I92af323287e348fbd0eff31e6cf9823be8e41024
2016-02-19 00:20:56 +00:00
Makoto Onuki
6094928806 Fix bugs in user restriction migration
Originally I didn't know user-0 could have PO, so I excluded this case
from migration.  Now we handle it properly.

Also make sure only restrictions that can actually be set by each
owner moves to the owner restriction.  (Because of this, we no longer
have to have DISALLOW_WALLPAPER in the exception list, because
owners can't set DISALLOW_WALLPAPER.)

Bug 27225996

Change-Id: I6ad79d90e6c4400abbb1e4feba6ba59e3b650815
2016-02-18 12:09:30 -08:00
Makoto Onuki
aafff2f835 Merge "Ensure DO/PO are also DA." into nyc-dev 2016-02-18 16:57:42 +00:00
Makoto Onuki
184db600df Ensure DO/PO are also DA.
Bug 24503508

Change-Id: Ib957b84d5bee185501636c406d9aaf4985a79d8d
2016-02-17 15:35:01 -08:00