Loading core/java/android/app/admin/DevicePolicyManager.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -13876,8 +13876,7 @@ public class DevicePolicyManager { } } /** /** * Called by device owner or profile owner of an organization-owned managed profile to return * Returns whether USB data signaling is currently enabled by the admin. Callable by any app. * whether USB data signaling is currently enabled by the admin. * * * @return {@code true} if USB data signaling is enabled, {@code false} otherwise. * @return {@code true} if USB data signaling is enabled, {@code false} otherwise. */ */ services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +2 −7 Original line number Original line Diff line number Diff line Loading @@ -17462,14 +17462,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override @Override public boolean isUsbDataSignalingEnabled(String packageName) { public boolean isUsbDataSignalingEnabled(String packageName) { final CallerIdentity caller = getCallerIdentity(packageName); Preconditions.checkCallAuthorization( isDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller), "USB data signaling can only be controlled by a device owner or " + "a profile owner on an organization-owned device."); synchronized (getLockObject()) { synchronized (getLockObject()) { final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked( getCallerIdentity(packageName)); return admin.mUsbDataSignalingEnabled; return admin.mUsbDataSignalingEnabled; } } } } Loading
core/java/android/app/admin/DevicePolicyManager.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -13876,8 +13876,7 @@ public class DevicePolicyManager { } } /** /** * Called by device owner or profile owner of an organization-owned managed profile to return * Returns whether USB data signaling is currently enabled by the admin. Callable by any app. * whether USB data signaling is currently enabled by the admin. * * * @return {@code true} if USB data signaling is enabled, {@code false} otherwise. * @return {@code true} if USB data signaling is enabled, {@code false} otherwise. */ */
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +2 −7 Original line number Original line Diff line number Diff line Loading @@ -17462,14 +17462,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { @Override @Override public boolean isUsbDataSignalingEnabled(String packageName) { public boolean isUsbDataSignalingEnabled(String packageName) { final CallerIdentity caller = getCallerIdentity(packageName); Preconditions.checkCallAuthorization( isDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller), "USB data signaling can only be controlled by a device owner or " + "a profile owner on an organization-owned device."); synchronized (getLockObject()) { synchronized (getLockObject()) { final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked( getCallerIdentity(packageName)); return admin.mUsbDataSignalingEnabled; return admin.mUsbDataSignalingEnabled; } } } }