Commit Graph

654 Commits

Author SHA1 Message Date
Ashley Smith
fb4d7e8838 Fixing NPE in device policy tests am: 68a2a0feed
am: d83eee9445

Change-Id: I29a02cc933c1bb46b85bb70050123d3c223bed81
2016-08-08 16:37:00 +00:00
Ashley Smith
d83eee9445 Fixing NPE in device policy tests
am: 68a2a0feed

Change-Id: Ic637f7380d674e17b82ce417df82b8e940f92aa8
2016-08-08 16:29:56 +00:00
Suprabh Shukla
f0b9bd4f80 Not trying to remove admins already being removed am: 9704e409df am: 636cd41893
am: 58da13b6fa

Change-Id: I2da5ec521d940156dc6f06019a0b85cddece0ce5
2016-08-05 23:36:16 +00:00
Ashley Smith
68a2a0feed Fixing NPE in device policy tests
Bug: 30224255
Change-Id: I5c21f8d0e5660cca1cf7861649195672348f802c
2016-08-05 11:24:02 -04:00
Suprabh Shukla
9704e409df Not trying to remove admins already being removed
If someone calls removeActiveAdminLocked more than once, it is possible
for the device policy data to end up with more than one copy of an admin
in the list mRemovingAdmins. Due to extra entries, once the admin
component is removed, it is not being allowed to be set as an admin again,
until the device reboots or mRemovingAdmins is cleared from the memory
due to some other reason. Fixing this by making sure we do not add
duplicate entries to mRemovingAdmins

Bug: 30369197
Change-Id: I1d53c41312171425bbd6e6e4153148276f1b098d
2016-08-04 17:05:12 -07:00
Tony Mak
fe84fe01d7 Persist master volume mute across reboot am: c1205111a9
am: c33b549af8

Change-Id: Id5e57ebdf81824af0f86854d8668a05f8109e0e1
2016-07-25 10:45:02 +00:00
Tony Mak
c1205111a9 Persist master volume mute across reboot
Fix: 30133263

Change-Id: I53450a504e40e55516acc88550f369a74a244eaf
2016-07-22 17:12:54 +00:00
Andrew Scull
cca00b0e7f Only check password length for relevant qualities.
The minimum password length is only required for certain password
qualities so only check the minimum length in those cases.

Bug: 30109030
Change-Id: I330c88fc0b22179e126fc1241a9c58d5e0d73e8e
2016-07-22 15:36:55 +00:00
Makoto Onuki
c69f21c357 Merge \\"Remove the DMAgent whitelisting\\" into nyc-mr1-dev am: bf6c6b44e1
am: 41fa9fe0a4

Change-Id: I5bbe059464a8719b92bf16997482382c7de02e99
2016-07-18 18:10:36 +00:00
Makoto Onuki
0b4b58f507 Remove the DMAgent whitelisting
Bug 30075554

Change-Id: Ib089353ff9f58eb175a7b5d9addfb371655afc6b
2016-07-15 16:31:15 -07:00
Benjamin Franz
e4da41e6be Merge \\"Add hidden API to store whether provisioning config has been applied\\" into nyc-mr1-dev am: 17ca90430b
am: b3fa8d87e0

Change-Id: If65317cf6ec5237cff36fba86ed219ab078776ad
2016-07-13 14:42:22 +00:00
Benjamin Franz
2aa9bab8a1 Add hidden API to store whether provisioning config has been applied
Bug: 29629204
Change-Id: Iaf4164357868b17dbc6615a77babb0e7cbc183b7
2016-07-12 17:20:18 +01:00
Mahaver Chopra
1f984d7f6b Merge \\"Add an api to verify if ro.device_owner was set\\" into nyc-mr1-dev am: c1182a8128
am: 325af20235

Change-Id: I18fc9c4d7662c6b05e3b66d9a1fcddb9c9e43730
2016-07-12 10:01:00 +00:00
Mahaver Chopra
790d198860 Add an api to verify if ro.device_owner was set
Currently for OobConfig app we used DEVICE_PROVISIONED Global setting to
verify if device was provisioned. This setting can be modified using
adb. we just need to know if it was set atleast once. Added an api in
DPM to return whether system property "ro.device_owner" was set.

Bug: 29935702
Change-Id: I9a2b5217c0bc2cc11d68282e05a5450ea3f6cf21
2016-07-11 11:22:52 +01:00
Rubin Xu
d134921727 Merge \\"Bump ACTION_CHOOSE_PRIVATE_KEY_ALIAS broadcast to foreground\\" into nyc-mr1-dev am: f627e9c09e
am: 2a1491061d

Change-Id: I30bad0f21b35f98db769a92ea81be7be50b86186
2016-07-07 11:52:25 +00:00
Rubin Xu
ca081ca396 Bump ACTION_CHOOSE_PRIVATE_KEY_ALIAS broadcast to foreground
Bug: 29966726
Change-Id: Ifdbdd26df40518d9e50f9a0b0dfc5c01cb9accb2
2016-07-06 14:21:42 +01:00
Chad Brubaker
6d4f195f1a Merge changes from topics 'handle-storage-update', 'action-storage-changed'
* changes:
  Update trusted certificates when the trust store is changed
  Deprecate ACTION_STORAGE_CHANGED
2016-06-30 19:22:19 +00:00
Chad Brubaker
4de59ef323 Deprecate ACTION_STORAGE_CHANGED
ACTION_STORAGE_CHANGED is too noisy and fires on too many events. It has
been split into ACTION_KEYCHAIN_CHANGED for
addition/modification/removal of user certificates and keys,
ACTION_TRUST_STORE_CHANGED for changes the the user added and system CA
stores on the device and ACTION_KEY_ACCESS_CHANGED for changes to key
grants.

ACTION_STORAGE_CHANGED will only be sent to applications targeting N
and below. Applications targeting future releases should use the new
broadcasts.

Bug:28450538
Change-Id: I34ff838e9858db65f7308ca2b0f7d652c48fae17
2016-06-30 09:23:15 -07:00
Suprabh Shukla
6e150baa88 Merge changes Id876f01f,If7c94cf8 into nyc-mr1-dev am: 634ed6bc17
am: a07ed2f383

Change-Id: I795b47e1c7e2c944c0c7525bb108af577546ee53
2016-06-29 01:48:41 +00:00
Suprabh Shukla
f8c04cbe95 Enabling auto-ota in retail demo mode
Bug: 29542384
Change-Id: If7c94cf8a8e5851011f23dc5d64fc795f9a07b22
2016-06-28 14:38:29 -07:00
Tony Mak
f574cf568b Merge "setProfileEnabled should be no-op when the profile is already enabled" 2016-06-28 11:11:28 +00:00
Nicolas Prevot
709a63d9c0 Show policy transparency screen if adding an account is not allowed.
If DISALLOW_MODIFY_ACCOUNTS has been set by a profile/device owner,
or account management is disabled:
When an app tries to add an account, show the policy transparency screen.

BUG:26762383
Change-Id: I721220c37c74493020f5a1be1f15731e9863a1de
2016-06-27 14:10:38 +01:00
Amith Yamasani
d04aaa323c More thorough cleansing of expired users
If any /data/system_[c|d]e folders were not erased
when the user was removed (maybe due to a reboot),
make sure they're cleaned up on restart as well
as when the userId is recycled later.

Mark the users' system folders with the correct
serial number for later verification.

AccountManager shouldn't be querying accounts of
partially created/destroyed users.

Change-Id: I4313756b7464f34cd5ce4fb296d61daa50b41fcb
Fixes: 29285673
2016-06-15 11:32:16 -07:00
Makoto Onuki
26704957fe Don't take the DPMS lock in DPMI.createPackageSuspendedDialogIntent
This method is called by AM with the lock held, so can't take the
DPMS lock.

It still takes a different lock, but we don't call into the external
world while holding this lock, so this is fine.

Bug 29242568

Change-Id: Idbecdd7d97385ca66c693903443471fdbae833e6
2016-06-14 09:41:21 -07:00
Tony Mak
bd4148bbab setProfileEnabled should be no-op when the profile is already enabled
Just printing log if we encounter this situation, we may consider to
throw exception if we provide API to check is profile enabled later.

Bug: 29069975

Change-Id: I819be0f97b038dbdd6c6cea81c42ff73be60027b
2016-06-14 13:18:49 +00:00
Makoto Onuki
c29f62c738 Push DO/PO package names from DPMS to PM
Bug 29126573

Change-Id: I95ea1559f6acf5d2f0e1b0953568cdfc938e83b9
2016-06-08 11:52:13 -07:00
Ricky Wai
90c9dbc919 Do not get device owner admin info when device owner is null
Bug: 29043723
Change-Id: I355c549f891a5e71f654f42ed16a7139da86482a
2016-05-31 18:01:46 +01:00
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 895504e557.
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