Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -7848,6 +7848,7 @@ package android.app.admin { method public boolean isResetPasswordTokenActive(android.content.ComponentName); method public boolean isSafeOperation(int); method public boolean isSecurityLoggingEnabled(@Nullable android.content.ComponentName); method public boolean isStatusBarDisabled(); method public boolean isUninstallBlocked(@Nullable android.content.ComponentName, String); method public boolean isUniqueDeviceAttestationSupported(); method public boolean isUsbDataSignalingEnabled(); core/java/android/app/admin/DevicePolicyManager.java +27 −0 Original line number Diff line number Diff line Loading @@ -12570,6 +12570,33 @@ public class DevicePolicyManager { } } /** * Returns whether the status bar is disabled/enabled, see {@link #setStatusBarDisabled}. * * <p>Callable by device owner or profile owner of secondary users that is affiliated with the * device owner. * * <p>This policy has no effect in LockTask mode. The behavior of the * status bar in LockTask mode can be configured with * {@link #setLockTaskFeatures(ComponentName, int)}. * * <p>This policy also does not have any effect while on the lock screen, where the status bar * will not be disabled. * * @throws SecurityException if the caller is not the device owner, or a profile owner of * secondary user that is affiliated with the device. * @see #isAffiliatedUser * @see #getSecondaryUsers */ public boolean isStatusBarDisabled() { throwIfParentInstance("isStatusBarDisabled"); try { return mService.isStatusBarDisabled(mContext.getPackageName()); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Called by the system update service to notify device and profile owners of pending system * updates. core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,7 @@ interface IDevicePolicyManager { boolean setKeyguardDisabled(in ComponentName admin, boolean disabled); boolean setStatusBarDisabled(in ComponentName who, boolean disabled); boolean isStatusBarDisabled(in String callerPackage); boolean getDoNotAskCredentialsOnBoot(); void notifyPendingSystemUpdate(in SystemUpdateInfo info); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +20 −0 Original line number Diff line number Diff line Loading @@ -13771,6 +13771,26 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return false; } @Override public boolean isStatusBarDisabled(String callerPackage) { final CallerIdentity caller = getCallerIdentity(callerPackage); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); int userId = caller.getUserId(); synchronized (getLockObject()) { Preconditions.checkCallAuthorization(isUserAffiliatedWithDeviceLocked(userId), "Admin " + callerPackage + " is neither the device owner or affiliated user's profile owner."); if (isManagedProfile(userId)) { throw new SecurityException("Managed profile cannot disable status bar"); } DevicePolicyData policy = getUserData(userId); return policy.mStatusBarDisabled; } } /** * We need to update the internal state of whether a user has completed setup or a * device has paired once. After that, we ignore any changes that reset the Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -7848,6 +7848,7 @@ package android.app.admin { method public boolean isResetPasswordTokenActive(android.content.ComponentName); method public boolean isSafeOperation(int); method public boolean isSecurityLoggingEnabled(@Nullable android.content.ComponentName); method public boolean isStatusBarDisabled(); method public boolean isUninstallBlocked(@Nullable android.content.ComponentName, String); method public boolean isUniqueDeviceAttestationSupported(); method public boolean isUsbDataSignalingEnabled();
core/java/android/app/admin/DevicePolicyManager.java +27 −0 Original line number Diff line number Diff line Loading @@ -12570,6 +12570,33 @@ public class DevicePolicyManager { } } /** * Returns whether the status bar is disabled/enabled, see {@link #setStatusBarDisabled}. * * <p>Callable by device owner or profile owner of secondary users that is affiliated with the * device owner. * * <p>This policy has no effect in LockTask mode. The behavior of the * status bar in LockTask mode can be configured with * {@link #setLockTaskFeatures(ComponentName, int)}. * * <p>This policy also does not have any effect while on the lock screen, where the status bar * will not be disabled. * * @throws SecurityException if the caller is not the device owner, or a profile owner of * secondary user that is affiliated with the device. * @see #isAffiliatedUser * @see #getSecondaryUsers */ public boolean isStatusBarDisabled() { throwIfParentInstance("isStatusBarDisabled"); try { return mService.isStatusBarDisabled(mContext.getPackageName()); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Called by the system update service to notify device and profile owners of pending system * updates.
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,7 @@ interface IDevicePolicyManager { boolean setKeyguardDisabled(in ComponentName admin, boolean disabled); boolean setStatusBarDisabled(in ComponentName who, boolean disabled); boolean isStatusBarDisabled(in String callerPackage); boolean getDoNotAskCredentialsOnBoot(); void notifyPendingSystemUpdate(in SystemUpdateInfo info); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +20 −0 Original line number Diff line number Diff line Loading @@ -13771,6 +13771,26 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return false; } @Override public boolean isStatusBarDisabled(String callerPackage) { final CallerIdentity caller = getCallerIdentity(callerPackage); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); int userId = caller.getUserId(); synchronized (getLockObject()) { Preconditions.checkCallAuthorization(isUserAffiliatedWithDeviceLocked(userId), "Admin " + callerPackage + " is neither the device owner or affiliated user's profile owner."); if (isManagedProfile(userId)) { throw new SecurityException("Managed profile cannot disable status bar"); } DevicePolicyData policy = getUserData(userId); return policy.mStatusBarDisabled; } } /** * We need to update the internal state of whether a user has completed setup or a * device has paired once. After that, we ignore any changes that reset the