Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6205,6 +6205,7 @@ package android.app.admin { method public java.lang.String getDeviceOwner(); method public java.lang.CharSequence getDeviceOwnerLockScreenInfo(); method public java.lang.String getDeviceOwnerNameOnAnyUser(); method public java.lang.CharSequence getDeviceOwnerOrganizationName(); method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName); method public int getKeyguardDisabledFeatures(android.content.ComponentName); method public java.lang.CharSequence getLongSupportMessage(android.content.ComponentName); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6046,6 +6046,7 @@ package android.app.admin { method public java.util.List<java.lang.String> getCrossProfileWidgetProviders(android.content.ComponentName); method public int getCurrentFailedPasswordAttempts(); method public java.lang.CharSequence getDeviceOwnerLockScreenInfo(); method public java.lang.CharSequence getDeviceOwnerOrganizationName(); method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName); method public int getKeyguardDisabledFeatures(android.content.ComponentName); method public long getLastBugReportRequestTime(); core/java/android/app/admin/DevicePolicyManager.java +21 −2 Original line number Diff line number Diff line Loading @@ -6424,7 +6424,7 @@ public class DevicePolicyManager { } /** * Called by a profile owner of a managed profile to set the name of the organization under * Called by the device owner or profile owner to set the name of the organization under * management. * <p> * If the organization name needs to be localized, it is the responsibility of the Loading @@ -6433,7 +6433,7 @@ public class DevicePolicyManager { * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param title The organization name or {@code null} to clear a previously set name. * @throws SecurityException if {@code admin} is not a profile owner. * @throws SecurityException if {@code admin} is not a device or profile owner. */ public void setOrganizationName(@NonNull ComponentName admin, @Nullable CharSequence title) { throwIfParentInstance("setOrganizationName"); Loading Loading @@ -6461,6 +6461,25 @@ public class DevicePolicyManager { } } /** * Called by the system to retrieve the name of the organization managing the device. * * @return The organization name or {@code null} if none is set. * @throws SecurityException if the caller is not the device owner, does not hold the * MANAGE_USERS permission and is not the system. * * @hide */ @SystemApi @TestApi public @Nullable CharSequence getDeviceOwnerOrganizationName() { try { return mService.getDeviceOwnerOrganizationName(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Retrieve the default title message used in the confirm credentials screen for a given user. * Loading core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,7 @@ interface IDevicePolicyManager { void setOrganizationName(in ComponentName admin, in CharSequence title); CharSequence getOrganizationName(in ComponentName admin); CharSequence getDeviceOwnerOrganizationName(); CharSequence getOrganizationNameForUser(int userHandle); int getUserProvisioningState(); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +13 −1 Original line number Diff line number Diff line Loading @@ -9126,7 +9126,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } Preconditions.checkNotNull(who, "ComponentName is null"); final int userHandle = mInjector.userHandleGetCallingUserId(); enforceManagedProfile(userHandle, "set organization name"); synchronized (this) { ActiveAdmin admin = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); Loading @@ -9152,6 +9152,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } @Override public CharSequence getDeviceOwnerOrganizationName() { if (!mHasFeature) { return null; } enforceDeviceOwnerOrManageUsers(); synchronized(this) { final ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked(); return deviceOwnerAdmin == null ? null : deviceOwnerAdmin.organizationName; } } @Override public CharSequence getOrganizationNameForUser(int userHandle) { if (!mHasFeature) { Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6205,6 +6205,7 @@ package android.app.admin { method public java.lang.String getDeviceOwner(); method public java.lang.CharSequence getDeviceOwnerLockScreenInfo(); method public java.lang.String getDeviceOwnerNameOnAnyUser(); method public java.lang.CharSequence getDeviceOwnerOrganizationName(); method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName); method public int getKeyguardDisabledFeatures(android.content.ComponentName); method public java.lang.CharSequence getLongSupportMessage(android.content.ComponentName);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6046,6 +6046,7 @@ package android.app.admin { method public java.util.List<java.lang.String> getCrossProfileWidgetProviders(android.content.ComponentName); method public int getCurrentFailedPasswordAttempts(); method public java.lang.CharSequence getDeviceOwnerLockScreenInfo(); method public java.lang.CharSequence getDeviceOwnerOrganizationName(); method public java.util.List<byte[]> getInstalledCaCerts(android.content.ComponentName); method public int getKeyguardDisabledFeatures(android.content.ComponentName); method public long getLastBugReportRequestTime();
core/java/android/app/admin/DevicePolicyManager.java +21 −2 Original line number Diff line number Diff line Loading @@ -6424,7 +6424,7 @@ public class DevicePolicyManager { } /** * Called by a profile owner of a managed profile to set the name of the organization under * Called by the device owner or profile owner to set the name of the organization under * management. * <p> * If the organization name needs to be localized, it is the responsibility of the Loading @@ -6433,7 +6433,7 @@ public class DevicePolicyManager { * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param title The organization name or {@code null} to clear a previously set name. * @throws SecurityException if {@code admin} is not a profile owner. * @throws SecurityException if {@code admin} is not a device or profile owner. */ public void setOrganizationName(@NonNull ComponentName admin, @Nullable CharSequence title) { throwIfParentInstance("setOrganizationName"); Loading Loading @@ -6461,6 +6461,25 @@ public class DevicePolicyManager { } } /** * Called by the system to retrieve the name of the organization managing the device. * * @return The organization name or {@code null} if none is set. * @throws SecurityException if the caller is not the device owner, does not hold the * MANAGE_USERS permission and is not the system. * * @hide */ @SystemApi @TestApi public @Nullable CharSequence getDeviceOwnerOrganizationName() { try { return mService.getDeviceOwnerOrganizationName(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Retrieve the default title message used in the confirm credentials screen for a given user. * Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,7 @@ interface IDevicePolicyManager { void setOrganizationName(in ComponentName admin, in CharSequence title); CharSequence getOrganizationName(in ComponentName admin); CharSequence getDeviceOwnerOrganizationName(); CharSequence getOrganizationNameForUser(int userHandle); int getUserProvisioningState(); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +13 −1 Original line number Diff line number Diff line Loading @@ -9126,7 +9126,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } Preconditions.checkNotNull(who, "ComponentName is null"); final int userHandle = mInjector.userHandleGetCallingUserId(); enforceManagedProfile(userHandle, "set organization name"); synchronized (this) { ActiveAdmin admin = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); Loading @@ -9152,6 +9152,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } @Override public CharSequence getDeviceOwnerOrganizationName() { if (!mHasFeature) { return null; } enforceDeviceOwnerOrManageUsers(); synchronized(this) { final ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked(); return deviceOwnerAdmin == null ? null : deviceOwnerAdmin.organizationName; } } @Override public CharSequence getOrganizationNameForUser(int userHandle) { if (!mHasFeature) { Loading