Commit Graph

1256 Commits

Author SHA1 Message Date
Rubin Xu
8b17ad02b7 Add metric logging for new delegated APIs
Add metric logging to:
 * Delegated cert selection
 * Delegated network logging access
 * Delegated silent package installation and removal

Bug: 122639711
Test: manual
Change-Id: I0655b742937b6413bc5c10474e4fd4559a8eaf92
2019-03-14 22:12:23 +00:00
Eran Messeri
c7f498fe0b Merge "Private DNS API: Follow-up on review" 2019-03-12 16:37:15 +00:00
TreeHugger Robot
794d22d0a7 Merge "Update screen lock complexity permission to password complexity" 2019-03-12 16:22:11 +00:00
Eran Messeri
ff9c10593e Private DNS API: Follow-up on review
To follow up on the previous review, rename the success constant from
"success" to "no error" since the enum it's associated with now refers
to error codes.

Bug: 124301971
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy
Change-Id: I6b82dd44cbf2c18fb8c1673a272f22f0e8b39dbb
2019-03-12 13:40:14 +00:00
bernardchau
7ac9a71880 Update screen lock complexity permission to password complexity
This is to match the method name "getPasswordComplexity" as requested by API review feedback

Bug: 128030136
Test: N/A
Change-Id: I999657f88ed425333adbe97b9ecc33da3769ba90
2019-03-11 16:37:44 +00:00
Ram Periathiruvadi
32d5355b4d Notify the TrustAgent when the token is activated.
Previously, the agent will have to query the TrustManager to see if a
recently added escrow token has been activated.  If the agent asked too
soon about the token state, then the result could be inactive.  That
will be hard to distinguish from when the token is actually inactive
because activation failed.

This change pipes the call from LockSettings to the TrustAgentService
through the TrustManager when the token is activated.  So, the trust
agent doesn't have to query, it just gets notified.

Bug: 124312230
Test: Observe the onTokenStateReceived() callback received on the trust
agent.

Change-Id: I0ac674219fd7925ba36f50bb695c9998c18226f7
2019-03-08 13:21:02 -08:00
Lenka Trochtova
cef704e172 Improve documentation of secure lock screen feature.
Add more a specific description of what methods do when the
secure lock screen feature is not supported by the device.

Bug: 123270501
Test: make

Change-Id: Ib6c16f421cf3dc60b0f0cb0c6335c6dc35ac7ece
2019-02-28 12:00:05 +01:00
Rich Cannings
383223ab18 Merge "Refactor passwords/pins/patterns to byte[]" 2019-02-27 03:21:57 +00:00
Philip P. Moltmann
933c8e06e8 Merge changes from topics "policy_fixed_set_via_perm_controller", "protect-policy-flags"
* changes:
  Ask Perm Controller to set policy-fixed perms
  Guard changing policy_fixed flag behind permission
2019-02-22 04:39:31 +00:00
Philip P. Moltmann
41df9f94ae Ask Perm Controller to set policy-fixed perms
This is much slower than the old way as we need to call into a different
process. On the other hand this handles the following cases correctly:
- foreground / background permissions
- pre-M apps
- split permissions

Test: CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPermissionGrant,testPermissionPolicy,testPermissionMixedPolicies,testPermissionAppUpdate,testPermissionGrantPreMApp
Change-Id: I5cd139ad29e5b77b77b02e12c75eb774984a7759
Bug: 124128308
2019-02-21 16:56:25 -08:00
Rich Cannings
f64ec63a02 Refactor passwords/pins/patterns to byte[]
Relating to frameworks/base

Bug: 120484642
Test: manual - test setting and unlocking passwords/pins/patterns.
      automated - about 20 failing due to an issue in the test code.

Change-Id: I57aa530ca2db1a026c56b66f5b4c91172f2667f6
2019-02-21 14:39:05 -08:00
TreeHugger Robot
5bf79b4a3f Merge "Fix logging string" 2019-02-20 04:29:01 +00:00
Eran Messeri
7418ef9c6b Fix logging string
Remove spurious 'if' in the device ID access log message.

Bug: 124732723
Test: That it builds
Change-Id: I4cee42942e3d1f4d37794ad9d722cf77c54814eb
2019-02-19 12:31:02 +00:00
Pavel Grafov
846ad2ded2 Dummy change to test postsubmit invocation
Bug: 124653467
Test: builds
Change-Id: I3cdf2a2647c8e0e4dd2e4bc49cd5cd5ff1daed4e
2019-02-19 11:26:46 +00:00
Alex Kershaw
bc40490aeb Merge "Managed system update API council changes." 2019-02-13 12:47:22 +00:00
TreeHugger Robot
afd14bfd44 Merge "Updated permission name according to API review" 2019-02-12 18:27:47 +00:00
Michal Karpinski
4026caebf2 Push the device owner packageName from DPMS to ATMS
instead of calling DPM.isDeviceOwnerApp()

Due to lock ordering AM/ATM cannot call DPM directly.

Bug: 123950811
Test: atest WmTests:ActivityStarterTests
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: manual with TestDPC (set DO, reboot device, etc.)
Change-Id: I14c6f48fe07243fe324ea41e9403c37aaceea304
2019-02-12 12:37:32 +00:00
Alex Kershaw
97d0e8f3e4 Managed system update API council changes.
Clarify the errorMessage Javadoc and rename InstallUpdateCallback.

Bug: 123697817
Test: Not applicable
Change-Id: I257b6353310e56bf1877a6f97bf1977ef5962af9
2019-02-11 16:28:10 +00:00
Bernard Chau
09121906be Updated permission name according to API review
Fix: 123661671
Test: N/A
Change-Id: I4520532deee054e1fe650fbeee10a6088d20a677
2019-02-08 15:57:14 +00:00
Stefano
508db9d003 Fix javadoc for enabling backup in DevicePolicyManager
Test: only changing javadoc.
Bug: 121198006
Change-Id: I157804343dd2d74c868ef696f0c5b26b394110c3
2019-02-08 13:50:28 +00:00
TreeHugger Robot
12d08fd37a Merge "Logging getPasswordComplexity events with the calling app package name" 2019-02-04 13:45:45 +00:00
Yueming Wang
6f6ab37890 Merge "Enforce cross profile calendar policies in one place." 2019-01-31 19:02:43 +00:00
Eran Messeri
8f2c1913dd Grant Device ID access to PO/DO delegates
Let the delegated certificate installer access device identifiers
(serial number, IMEI, meid) via the standard platform APIs.

This makes sense since the DO/PO can already access Device IDs and
there's no technical barrier from the DO/PO to send the Device IDs to
the app it nominated as the delegate.

To make things simpler for the delegate and DPC, let the delegate access
the Device IDs directly.

Bug: 120616022
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDirectly
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegatedCertInstallerDirectly
Change-Id: I0c996eeb0d35e99821ca3dcfe1afda01cd5ceb2f
2019-01-31 11:27:48 +00:00
yuemingw
dded98f7c4 Enforce cross profile calendar policies in one place.
Instead of checking dpm policy in primary user and settings value
in managed profile user, we'd better check them all in primary user.

Calendar provider will need INTERACT_ACROSS_USER_FULL to access
settings provider and this permission is not granted to any app
in privapp-permissions-platform.xml. So I think it's safer to
change isPackageAllowedToAccessCalendar to check both
admin policy & settings value.

Bug: 123629973
Test: atest CalendarProvider2Test
Change-Id: I01bff1317916bac6de72a71a029a2f99dc8e9a0b
2019-01-31 02:17:10 +00:00
Stefano Tommasini
4ac2c95f78 Merge "Revert "Revert "Add support for enabling backup in work profile in""" 2019-01-30 17:53:47 +00:00
Bernard Chau
4e2fd163eb Logging getPasswordComplexity events with the calling app package name
Every call to the method is logged regardless of permission check result

Bug: 120840632
Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Change-Id: Ie690b465a2ee1088e2e0df3fdf7733a41538fbb3
2019-01-30 16:15:15 +00:00
Stefano Tommasini
fc86b8e16a Revert "Revert "Add support for enabling backup in work profile in""
This reverts commit 0bfafb7f41.

Reason for revert: Removing enforceUnlocked() should fix the bug and Backup now supports it.

Change-Id: Id06f63c62b0f43cd70da77df48674146d4cc0412
2019-01-30 14:15:11 +00:00
yuemingw
05896da8de Update startViewCalendarEventInManagedProfile API according to API review
1. Replaced ACTION_VIEW_WORK_CALENDAR_EVENT with
ACTION_VIEW_MANAGED_PROFILE_CALENDAR_EVENT
2. Improved the javadoc for EXTRA_EVENT_ID
3. Improved the javadoc for startMs and endMs

Bug: 122899642
Bug: 122898273
Bug: 122900059
Test: atest ManagedProfileTest#testCrossProfileCalendar
Change-Id: Ida84cd0d7d941e18acb9140c8fffc27b1ebd0a6c
2019-01-30 01:42:42 +00:00
Pavel Grafov
0c0af4b0cc Merge "Whitelist packages from VPN lockdown: DPM API." into pi-dev-plus-aosp
am: 299f825678

Change-Id: I3deb4a865e109e2b2e67dc7d8ffc775747f34303
2019-01-29 14:13:19 -08:00
Pavel Grafov
5cba336daf Whitelist packages from VPN lockdown: DPM API.
Bug: 77468593
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7508070f828fb7150df5d9e34846535d57c6a7c3
2019-01-29 19:37:21 +00:00
Dan Albert
fe1cdd047f resolve merge conflicts of fb54fde402 to master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7256999a13b713607cfb4c844bf1bc7b37b827a7
2019-01-24 14:46:02 -08:00
Dan Albert
fb54fde402 Merge "Revert "Whitelist packages from VPN lockdown."" am: 9f73671651
am: 2f94ef95c4

Change-Id: I933a58f97b48f7a2db372cff6fb43318c840c6f8
2019-01-24 13:58:15 -08:00
Dan Albert
ee8e6a0fae Revert "Whitelist packages from VPN lockdown."
This reverts commit bb9cef04c5.

Reason for revert: broke pi-dev-plus-aosp

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68
2019-01-24 21:05:39 +00:00
TreeHugger Robot
356227b0f6 Merge "Add back @NonNull to DevicePolicyManager.wipeData" 2019-01-24 20:19:22 +00:00
Pavel Grafov
52e0e403d2 Merge "Whitelist packages from VPN lockdown." am: efc773525c
am: 295016b22b

Change-Id: I643fc2603f7cd2b928fe517eb473048004273835
2019-01-24 10:06:37 -08:00
Pavel Grafov
bb9cef04c5 Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
Merged-In: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
2019-01-24 16:17:11 +00:00
Pavel Grafov
46165b5d61 Merge "Whitelist packages from VPN lockdown." 2019-01-24 16:15:08 +00:00
Alex Chau
d4ad549702 Add back @NonNull to DevicePolicyManager.wipeData
- Added WIPE_SILENTLY to skip notifying user

Bug: 114711242
Test: cts-tradefed run singleCommand cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.ManagedProfileTest#testWipeDataWithoutReason
Change-Id: I163e0f3e1ab1e6feef668070a73b1f86db9691b3
2019-01-24 12:08:22 +00:00
Pavel Grafov
1d58621a1f Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
2019-01-24 11:34:17 +00:00
yuemingw
d2bfbc8246 API change for cross profile calendar feature.
According to new requirements in b/121179845, we are changing the
API pattern from "add/remove" to "set(set<string>)" to support
"enable all packages" operation. Setting the whitelist to null
will enable all packages. This behavior is consistent with existing
methods in DevicePolicyManager, e.g. setPermittedInputMethods.

Also corrected some languages in the comments and annotations.

Bug: 121179845
Test: atest ManagedProfileTest#testCrossProfileCalendar
atest DevicePolicyManagerTest

Change-Id: I87f17a2094792e44fdeb672658bddb871c2c1eeb
2019-01-24 10:04:50 +00:00
TreeHugger Robot
161833f209 Merge "Revert "Add support for enabling backup in work profile in"" 2019-01-23 17:12:43 +00:00
Stefano Tommasini
0bfafb7f41 Revert "Add support for enabling backup in work profile in"
This reverts commit 00a6e52734.

Reason for revert: b/123237328

Change-Id: I0e38e6187760264f16f3cd00389a4e1cdb316086
2019-01-23 10:43:06 +00:00
Lenka Trochtova
66c492a87e Add a feature flag for secure lock screen.
Disable certain APIs which require secure lock screen if the device
doesn't have the feature.
Make sure one cannot set the password/PIN if there is no secure lock
screen, because the password/PIN wouldn't be really used afterwards
while the password strength checks would succeed, creating a false
sense of security.
Allow setting password strength requirements in DPM - test if the
current password is sufficient will fail automatically if there is
no secure lock screen.

Bug: 111072170
Bug: 111071972
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases
Test: cts-tradefed run cts -m CtsAdminTestCases
Test: frameworks/base/core/tests/utiltests/runtests.sh
Test: adb shell am instrument -w -e class com.android.internal.widget.LockPatternUtilsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: atest SyntheticPasswordTests
Test: atest LockSettingsServiceTests
Test: atest LockSettingsShellCommandTest
Test: atest DevicePolicyManagerTest (for servicestests)

Change-Id: Ie46b0de6cb03c26dd05c05711c5c3b5e36a872df
2019-01-22 17:51:56 +01:00
TreeHugger Robot
f9c42c76a0 Merge "Fix dpm force-network-logs" 2019-01-22 14:45:35 +00:00
Rubin Xu
259732a8d7 Fix dpm force-network-logs
A new permission check in AlarmManager means that we need to clear caller
identity before calling into mNetworkLogger.forceBatchFinalization to
force network logs.

Bug: 123028500
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
Change-Id: I62a9473fa4ec5493a3db4fdad3469e46737fadc0
2019-01-22 12:17:44 +00:00
Stefano Tommasini
69fbfdb787 Merge "Add support for enabling backup in work profile in DevicePolicyManager." 2019-01-22 11:48:28 +00:00
Alex Kershaw
30eceeca21 Fix NPE in UpdateInstaller.
Fix the NPE caused when the battery condition fails. To make this CTS
testable, change the battery check mechanism and force
DevicePolicyConstants to reload when the device_policy_constants global
settings are modified.

Change-Id: I59d4630a6dd2d1b52f1adb1da4238ee53c20c0e6
Fixes: 112076619
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testInstallUpdate
2019-01-18 17:59:08 +00:00
Stefano
00a6e52734 Add support for enabling backup in work profile in
DevicePolicyManager.

Test: atest ProfileOwnerTest
BUG: 121198006
Change-Id: I9a1d4bf5530c432be3276e17f0535e26e77c8d59
2019-01-18 12:33:45 +00:00
TreeHugger Robot
d47259a203 Merge "Do not emit WTF if there is no delegate" 2019-01-11 16:50:04 +00:00
Rubin Xu
417601034d Do not emit WTF if there is no delegate
WTF should only be logged when there is more than one delegates,
not when there is none.

Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testKeyManagement
      and check logcat for the absence of WTF logs
Bug: 122363826

Change-Id: I51972ec4fabb2de70a6fe1700afae3aea95e34ab
2019-01-11 15:10:41 +00:00