Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76f073c0 authored by Alex Johnston's avatar Alex Johnston
Browse files

Deprecate organization color

* Deprecate setOrganizationColor,
  setOrganizationColorAsUser,
  getOrganizationColor,
  getOrganizationColorAsUser
  from DevicePolicyManager.

Bug: 155464031
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I4ba476168cded62786113bae1db0fdaca0989484
parent 92d089ce
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6893,7 +6893,7 @@ package android.app.admin {
    method public int getMaximumFailedPasswordsForWipe(@Nullable android.content.ComponentName);
    method public long getMaximumTimeToLock(@Nullable android.content.ComponentName);
    method @NonNull public java.util.List<java.lang.String> getMeteredDataDisabledPackages(@NonNull android.content.ComponentName);
    method @ColorInt public int getOrganizationColor(@NonNull android.content.ComponentName);
    method @Deprecated @ColorInt public int getOrganizationColor(@NonNull android.content.ComponentName);
    method @Nullable public CharSequence getOrganizationName(@NonNull android.content.ComponentName);
    method public java.util.List<android.telephony.data.ApnSetting> getOverrideApns(@NonNull android.content.ComponentName);
    method @NonNull public android.app.admin.DevicePolicyManager getParentProfileInstance(@NonNull android.content.ComponentName);
@@ -7025,7 +7025,7 @@ package android.app.admin {
    method public void setMaximumTimeToLock(@NonNull android.content.ComponentName, long);
    method @NonNull public java.util.List<java.lang.String> setMeteredDataDisabledPackages(@NonNull android.content.ComponentName, @NonNull java.util.List<java.lang.String>);
    method public void setNetworkLoggingEnabled(@Nullable android.content.ComponentName, boolean);
    method public void setOrganizationColor(@NonNull android.content.ComponentName, int);
    method @Deprecated public void setOrganizationColor(@NonNull android.content.ComponentName, int);
    method public void setOrganizationName(@NonNull android.content.ComponentName, @Nullable CharSequence);
    method public void setOverrideApnsEnabled(@NonNull android.content.ComponentName, boolean);
    method @NonNull public String[] setPackagesSuspended(@NonNull android.content.ComponentName, @NonNull String[], boolean);
+12 −0
Original line number Diff line number Diff line
@@ -10258,7 +10258,10 @@ public class DevicePolicyManager {
     * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
     * @param color The 24bit (0xRRGGBB) representation of the color to be used.
     * @throws SecurityException if {@code admin} is not a profile owner.
     * @deprecated From {@link android.os.Build.VERSION_CODES#R}, the organization color is never
     * used as the background color of the confirm credentials screen.
     */
    @Deprecated
    public void setOrganizationColor(@NonNull ComponentName admin, int color) {
        throwIfParentInstance("setOrganizationColor");
        try {
@@ -10280,7 +10283,10 @@ public class DevicePolicyManager {
     * @RequiresPermission(allOf = {
     *       Manifest.permission.MANAGE_USERS,
     *       Manifest.permission.INTERACT_ACROSS_USERS_FULL})
     * @deprecated From {@link android.os.Build.VERSION_CODES#R}, the organization color is never
     * used as the background color of the confirm credentials screen.
     */
    @Deprecated
    public void setOrganizationColorForUser(@ColorInt int color, @UserIdInt int userId) {
        try {
            // always enforce alpha channel to have 100% opacity
@@ -10298,7 +10304,10 @@ public class DevicePolicyManager {
     * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
     * @return The 24bit (0xRRGGBB) representation of the color to be used.
     * @throws SecurityException if {@code admin} is not a profile owner.
     * @deprecated From {@link android.os.Build.VERSION_CODES#R}, the organization color is never
     * used as the background color of the confirm credentials screen.
     */
    @Deprecated
    public @ColorInt int getOrganizationColor(@NonNull ComponentName admin) {
        throwIfParentInstance("getOrganizationColor");
        try {
@@ -10314,7 +10323,10 @@ public class DevicePolicyManager {
     *
     * @param userHandle The user id of the user we're interested in.
     * @return The 24bit (0xRRGGBB) representation of the color to be used.
     * @deprecated From {@link android.os.Build.VERSION_CODES#R}, the organization color is never
     * used as the background color of the confirm credentials screen.
     */
    @Deprecated
    public @ColorInt int getOrganizationColorForUser(int userHandle) {
        try {
            return mService.getOrganizationColorForUser(userHandle);