629 Commits

Author SHA1 Message Date
Ricky Wai
977ade26dd Do not allow DPM.resetPassword() when child profile exists or user is locked
Bug: 28878708
Change-Id: Iaae2a9ba9c7c0ff388264c474c78a0dcd9fec258
2016-05-25 13:09:44 +00:00
Victor Chang
12753ded44 Fix Certificate authority installed notification is gone when turning off and on the work mode.
cause: Work mode is turned on before entering USER_STOPPED state.
Thus, BOOT_COMPLETED broadcast is not sent, but the notification has been dismissed.

use USER_STARTED + USER_UNLOCKED because both are foreground.

Bug: 28864104
Change-Id: I4796b61586e194d8367b9e52a9c56f858cbcbe7d
2016-05-23 17:41:01 +01:00
Sudheer Shanka
93f8fd714a Update RestrictedLockUtils to use UM.getUserRestrictionSource.
Bug: 28269827
Change-Id: Ib4a1441b71986ca6637a9236136b60e18dbc1643
2016-05-17 13:27:27 -07:00
Robin Lee
bc73347152 Merge "Skip 'network may be monitored' if dying or locked" into nyc-dev 2016-05-17 09:17:21 +00:00
Ashley Smith
820ae5a475 Fixing a NPE in DevicePolicyManagerService
Bug: 28786940
Change-Id: I73de8dea9221765ed0751039f3d472cf78d341af
2016-05-16 15:55:14 +00:00
Robin Lee
fe47b6eefa Skip 'network may be monitored' if dying or locked
KeyChain isn't direct boot aware & attempting to bind to a service
inside a dying user isn't going to end well.

Change-Id: I5a0acc34f98c39705ec404765c87e7ac61ca9b71
Fix: 28725354
2016-05-13 18:05:33 +01:00
Victor Chang
090b5a8e8c Merge "Fix ConfirmCredential is not presented before trusting cert installed by PO/DO" into nyc-dev 2016-05-11 14:43:15 +00:00
Victor Chang
8560a7c2a1 Fix ConfirmCredential is not presented before trusting cert installed by PO/DO
- TrustedCredential is responsible to show ConfirmCredential
- Show the MonitoringCerInfoActivity in personal side instead to avoid showing work challenge
- put user id into extra

Bug: 28619980
Change-Id: Iedbc0b721ef56675f3c9eb6f1d12daf1222ad080
2016-05-09 16:05:32 +01:00
Rubin Xu
0fb6b9e18c Guard retrievePreRebootSecurityLogs with config flag
Bug: 28160645
Change-Id: Ifce884c319019758dfaaa39bc239e9f30962c920
2016-05-05 12:00:50 +01:00
Paul Lawrence
fc0810b4d4 Merge "Revert "Don't enforce this API - it's not sensitive"" into nyc-dev 2016-05-04 22:46:10 +00:00
Paul Lawrence
9de713d422 Revert "Don't enforce this API - it's not sensitive"
This reverts commit 895504e55788c5c7fd90830dcf01c41a79ca7fe4.
Also adds a change to device manager to prevent failure there
as in the bug below.

Bug: 28512889

Change-Id: I4a445ec365133e9e2764e2d625d61fc6ee2008ec
2016-05-04 18:25:23 +00:00
Robin Lee
dc67971a99 Add lockdownEnabled parameter to always-on VPN API
Allows callers to opt-out of blockading network traffic during boot and
on VPN app failure.

Bug: 26694104
Change-Id: Ibfbd43ad09a25f2e38053fcd6306df3711f8bde2
2016-05-03 13:24:42 +01:00
Jeff Sharkey
ce18c81677 Introduce "unlocking" vs "unlocked" nuance.
There is a narrow window of time during user unlock where we're
reconciling user storage and dispatching the "unlock" status to
various internal system services.  While in this "unlocking" state,
apps need to be told that the user still isn't actually "unlocked"
so they don't try making calls to AccountManager, etc.

The majority of internal services are interested in merging together
both the "unlocking" and "unlocked" state, so update them.

Clarify naming in AccountManagerService to make it clear that a local
list is being used, which mirrors the naming in MountService.

To match UX/PM requested behavior, move PRE_BOOT_COMPLETED dispatch
after the user is unlocked, but block BOOT_COMPLETED dispatch until
after all PRE_BOOT receivers are finished to avoid ANRs.

Bug: 28040947, 28164677
Change-Id: I57af2351633d9159f4483f19657ce0b62118d1ce
2016-04-28 10:51:39 -06:00
Victor Chang
c0440e5f4d Merge "Deleting lock screen clears all CA approvals" into nyc-dev 2016-04-22 11:02:43 +00:00
Victor Chang
dc068eba6f Deleting lock screen clears all CA approvals
When both screenlocks for profile user and parent user has been removed (both set to none),
remove CA approvls on that user, and show the "Certificate authority installed" notification.

Bug: 28161447
Change-Id: I3c78dc5cfcdf7c02c91b64abe44984ee790d8f3e
2016-04-21 16:55:34 +01:00
Kenny Guy
38dcca51a7 Add test method to remove admins.
Add test method to remove admins that declare
FLAG_TEST_APP without informing them.
The method will also remove the device and profile
owner status of the admin.

Bug: 28027468
Change-Id: Idb4d3299a9c6595c94bfb424546cd8a384131835
2016-04-19 20:10:56 +01:00
Sudheer Shanka
fd580f7d1a Merge "Update {set,get}{Long,Short}SupportMessage APIs to use CharSequence." into nyc-dev 2016-04-13 20:12:05 +00:00
Michal Karpinski
1271cef419 Merge "API polish in DPM for organization color and name methods" into nyc-dev 2016-04-13 13:28:08 +00:00
Victor Chang
caf566a537 Merge "Update display text in cert notification" into nyc-dev 2016-04-13 10:15:29 +00:00
Michal Karpinski
74cd73079c API polish in DPM for organization color and name methods
- Returning and accepting CharSequence instead of String
- Enforcing 100% opacity and adjusting javadocs for color
format
- Adding @ColorInt annotations

Bug: 27531295
Change-Id: Id27d4fd5e7bb4d746cc61288457eb4eb86224505
2016-04-12 15:17:52 +01:00
Sudheer Shanka
3ccca91e6e Update {set,get}{Long,Short}SupportMessage APIs to use CharSequence.
Bug: 27531295
Change-Id: Ib28c509a3112046c14d812265ce43bc5b5574f12
2016-04-11 21:46:24 -07:00
Fyodor Kupolov
4c74334c44 Merge "Added getProfileIds method returning array of userIds" into nyc-dev 2016-04-11 16:40:55 +00:00
Victor Chang
355d47697c Update display text in cert notification
- Show DPC app name for PO
- Check user id for DO
- Update notification title for all cases
- update symbols for private resource ssl_ca_cert_warning changed from string to plural
- Pass number of certificate to MonitoringCertInfoActivity

Bug: 25772443
Bug: 18224038
Change-Id: I68db06f55a24879c1d5f532e38b97e2932bf990e
2016-04-11 15:00:50 +01:00
Nicolas Prévot
a078b4ba6a Merge "Still return a package suspsended dialog if there is no owner." into nyc-dev 2016-04-08 12:41:50 +00:00
Nicolas Prevot
8aa48028f3 Still return a package suspsended dialog if there is no owner.
When an application cannot be started, and there is no profile/device
owner, still return a PackageSuspendedDialog.

BUG: 28042198
Change-Id: I5c30393f9481840a965bb815235af5181561a063
2016-04-08 12:13:52 +01:00
Fyodor Kupolov
7f98aa4aa9 Added getProfileIds method returning array of userIds
Previously many usages of UserManager.getProfiles and getEnabledProfiles
were only using ids of returned users. Given that the list of users needs
to be parceled and unparceled for Binder calls, returning array of ids
minimizes memory usage and serialization time.

A new method getProfileIds was introduced which returns an array of userIds.
Existing method calls were updated where appropriate.

Bug: 27705805
Change-Id: Ic5d5decd77567ba0f749e48837a2c6fa10e812c0
2016-04-07 16:41:57 -07:00
Ricky Wai
035e924470 Fix work profile screen timeout policy
Settings screen should apply both primary and managed maximum
timeout policy, even separate profile challenge is enabled.

Bug: 27493348
Change-Id: Ia1ec1cafc7665c54816833af64e0f446a77a55b2
2016-04-07 17:16:03 +01:00
Ricky Wai
dc283a8976 Keymaster init for work profile
Changes:
(1) When unified work challenge is enabled and screen lock is secure
  - Store work profile secure key in primary profile
  - When primary user keystore unlocked, unlock work profile keystore
  - When primary user change lock to none, remove work secure key
(2) When unified work challenge is enabled but screen lock is not secure
  - When screen lock changes to secure, store work secure key in primary
(3) When user changes work challenge from unified to separated
  - Remove work secure key in primary
(4) When user changes work challenge from separate to unified
  - Do (1) and (2)

Bug: 27460698

Change-Id: I8f77bde5dc6b8e59c90256e75c5990100e93366b
2016-04-07 14:23:37 +00:00
Tony Mak
a01c1f0d90 Merge "xxxTrustAgentConfiguration should be supported in the parent DPM instance" into nyc-dev 2016-04-06 18:39:21 +00:00
Robin Lee
589b855719 Merge "Remove bool return from setAlwaysOnVpnPackage" into nyc-dev 2016-04-06 17:01:24 +00:00
Robin Lee
ee5eb934e3 Remove bool return from setAlwaysOnVpnPackage
Bug: 27533151
Change-Id: I4c656488e69cb5247dbb9cfd62d6f6f7043f9a90
2016-04-06 16:30:22 +01:00
Tony Mak
73ebf33d76 Merge "getProfiles should only returns non-partial user info" into nyc-dev 2016-04-05 17:24:30 +00:00
Sudheer Shanka
f4b30e2147 Merge "Remove the admin from the removing list when refreshing that admin." into nyc-dev 2016-04-05 17:21:36 +00:00
Tony Mak
80189cdece getProfiles should only returns non-partial user info
Bug: 26928524
Change-Id: I537bb0a9632cad603717a367b81d5e072452a6d7
2016-04-05 16:59:39 +00:00
Tony Mak
089d840383 xxxTrustAgentConfiguration should be supported in the parent DPM instance
1. Fix trust agent config does not persist across reboot
2. xxxTrustAgentConfiguration now supported in parent DPM instance

Bug: 27601827

Change-Id: I6ea4a089bf590d6c44be40318f3a69c35c54f796
2016-04-05 17:42:55 +01:00
Robin Lee
691b1a6005 Merge "Switch to work challenge if MP calls resetPassword" into nyc-dev 2016-04-05 14:04:40 +00:00
Sudheer Shanka
7c92133134 Remove the admin from the removing list when refreshing that admin.
Change-Id: I9b597a116db4f1fb894427b4e885f29c3e94abdb
Fixes: 27909181
2016-04-04 21:05:54 -07:00
Robin Lee
ce5c4009cf Switch to work challenge if MP calls resetPassword
If the profile owner wants to set a lock screen for a profile which they
created, we should let them. This will cancel any lock screen
unification that has been set up.

Attempting to clear the password will continue to throw
SecurityException if called from a managed profile.

Bug: 26682008
Change-Id: Ia09aef879a21c074ccb517905e43f62696837998
2016-04-01 16:12:32 +00:00
Robin Lee
f1fe782e91 Merge "API to approve CA certificates" into nyc-dev 2016-03-31 18:26:32 +00:00
Robin Lee
2f7e1e487c API to approve CA certificates
Bug: 18224038
Change-Id: Id928872cd70dac5a5ecfdcd52150fe6dea544e3b
2016-03-31 18:06:44 +01:00
Victor Chang
e04ac3d7d2 Merge "Unit test for isProvisioningAllowed" into nyc-dev 2016-03-31 17:04:38 +00:00
Andrei Stingaceanu
aa60469445 Merge "AfW - suspend apps - API polish" into nyc-dev 2016-03-31 10:57:58 +00:00
Sudheer Shanka
d2a968f9c3 Merge "Return null value if getActiveAdminUncheckedLocked returns null." into nyc-dev 2016-03-31 01:14:21 +00:00
Sudheer Shanka
549b969280 Return null value if getActiveAdminUncheckedLocked returns null.
- Split per user version of getUserRestrictions into a separate method
  in DPMS and make the per-user version return null if the admin
  parameter is not a valid one.
- Update isAccessibilityServicePermittedByAdmin and
  isInputMethodPermittedByAdmin to return false if the admin parameter
  is not a valid one.

Bug: 27909087
Change-Id: I6f4cae6552cbfe02dc4a92b04eeeddf0314e0974
2016-03-30 17:12:07 -07:00
Victor Chang
3e794afb82 Unit test for isProvisioningAllowed
Note:
DevicePolicyManagerService is changed to inject ContentObserver notifier

Test: all test cases in DevicePolicyManagerTest pass

BUG: 25710621
Change-Id: I347cec71769d0e9dd6a334d7d6339d5ce6a3fa6a
2016-03-30 20:27:22 +01:00
Rubin Xu
5b7ca24f14 Merge "Add DevicePolicyManager API to install a client cert chain." into nyc-dev 2016-03-30 17:46:18 +00:00
Clara Bayarri
30fb053449 Merge "Change default work challenge background color" into nyc-dev 2016-03-30 16:13:00 +00:00
Clara Bayarri
8d0bd7fa63 Change default work challenge background color
Requested by UX

Bug: 27829562
Change-Id: I815c06784189e68b09e464e936521e82091c93c3
2016-03-30 17:12:08 +01:00
Andrei Stingaceanu
b70ba1971c Merge "AfW custom lock screen message - API polish" into nyc-dev 2016-03-30 12:23:56 +00:00
Rubin Xu
b436591708 Add DevicePolicyManager API to install a client cert chain.
When installing a keypair the caller will have the option to specify a
certificate chain which will later be returned to whoever requests access
to the keypair via KeyChain.

Bug: 18239590
Change-Id: Id21ef026e31537db38d891cb9b712dd4fe7159c7
2016-03-30 11:57:58 +01:00