From b58e4966db1c9bd3d0567ef613e8cb8f80e8e85e Mon Sep 17 00:00:00 2001 From: Michal Karpinski Date: Tue, 1 Mar 2016 14:55:10 +0000 Subject: [PATCH] Adding SecurityException information to all device logging DPM public methods Bug: 22860162 Change-Id: I6cdfad2dcdf14896c855debef34964def190e110 --- .../android/app/admin/DevicePolicyManager.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 74fe13ac19613..6e29eaab26d0d 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -2921,7 +2921,7 @@ public class DevicePolicyManager { * Called by a device owner to request a bugreport. * *

There must be only one user on the device, managed by the device owner. - * Otherwise a security exception will be thrown. + * Otherwise a {@link SecurityException} will be thrown. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return {@code true} if the bugreport collection started successfully, or {@code false} @@ -5686,6 +5686,9 @@ public class DevicePolicyManager { *

Device logs contain various information intended for security auditing purposes. * See {@link SecurityEvent} for details. * + *

There must be only one user on the device, managed by the device owner. + * Otherwise a {@link SecurityException} will be thrown. + * * @param admin Which device owner this request is associated with. * @param enabled whether device logging should be enabled or not. * @see #retrieveDeviceLogs @@ -5701,6 +5704,9 @@ public class DevicePolicyManager { /** * Return whether device logging is enabled or not by the device owner. * + *

Can only be called by the device owner, otherwise a {@link SecurityException} will be + * thrown. + * * @param admin Which device owner this request is associated with. * @return {@code true} if device logging is enabled by device owner, {@code false} otherwise. */ @@ -5720,6 +5726,9 @@ public class DevicePolicyManager { *

Access to the logs is rate limited and it will only return new logs after the device * owner has been notified via {@link DeviceAdminReceiver#onSecurityLogsAvailable}. * + *

There must be only one user on the device, managed by the device owner. + * Otherwise a {@link SecurityException} will be thrown. + * * @param admin Which device owner this request is associated with. * @return the new batch of device logs which is a list of {@link SecurityEvent}, * or {@code null} if rate limitation is exceeded or if logging is currently disabled. @@ -5764,6 +5773,9 @@ public class DevicePolicyManager { * result, this API is provided as best-effort and the returned logs may contain corrupted data. * * + *

There must be only one user on the device, managed by the device owner. + * Otherwise a {@link SecurityException} will be thrown. + * * @param admin Which device owner this request is associated with. * @return Device logs from before the latest reboot of the system. */