From ad443f808390d065b6156252e5e37e9c16bbbd64 Mon Sep 17 00:00:00 2001
From: kholoud mohamed It will be used to update the drawable defined by {@code drawableId} with style
* {@code drawableStyle} located in source {@code drawableSource} to the drawable with ID
- * {@code callingPackageResourceId} in the calling package
It will be used to update the drawable defined by {@code drawableId} with style - * {@code drawableStyle} to the drawable with ID {@code callingPackageResourceId} in the + * {@code drawableStyle} to the drawable with ID {@code resourceIdInCallingPackage} in the * calling package
* * @param drawableId The ID of the drawable to update. * @param drawableStyle The style of the drawable to update. - * @param callingPackageResourceId The ID of the drawable resource in the calling package to + * @param resourceIdInCallingPackage The ID of the drawable resource in the calling package to * use as an updated resource. * * @throws IllegalStateException if the resource with ID - * {@code callingPackageResourceId} doesn't exist in the calling package. + * {@code resourceIdInCallingPackage} doesn't exist in the calling package. */ public DevicePolicyDrawableResource( @NonNull Context context, @NonNull @DevicePolicyResources.UpdatableDrawableId String drawableId, @NonNull @DevicePolicyResources.UpdatableDrawableStyle String drawableStyle, - @DrawableRes int callingPackageResourceId) { + @DrawableRes int resourceIdInCallingPackage) { this(context, drawableId, drawableStyle, Drawables.Source.UNDEFINED, - callingPackageResourceId); + resourceIdInCallingPackage); } /** @@ -144,8 +144,8 @@ public final class DevicePolicyDrawableResource implements Parcelable { * resource. */ @DrawableRes - public int getCallingPackageResourceId() { - return mCallingPackageResourceId; + public int getResourceIdInCallingPackage() { + return mResourceIdInCallingPackage; } /** @@ -166,14 +166,14 @@ public final class DevicePolicyDrawableResource implements Parcelable { return mDrawableId.equals(other.mDrawableId) && mDrawableStyle.equals(other.mDrawableStyle) && mDrawableSource.equals(other.mDrawableSource) - && mCallingPackageResourceId == other.mCallingPackageResourceId + && mResourceIdInCallingPackage == other.mResourceIdInCallingPackage && mResource.equals(other.mResource); } @Override public int hashCode() { - return Objects.hash( - mDrawableId, mDrawableStyle, mDrawableSource, mCallingPackageResourceId, mResource); + return Objects.hash(mDrawableId, mDrawableStyle, mDrawableSource, + mResourceIdInCallingPackage, mResource); } @Override @@ -186,7 +186,7 @@ public final class DevicePolicyDrawableResource implements Parcelable { dest.writeString(mDrawableId); dest.writeString(mDrawableStyle); dest.writeString(mDrawableSource); - dest.writeInt(mCallingPackageResourceId); + dest.writeInt(mResourceIdInCallingPackage); dest.writeTypedObject(mResource, flags); } @@ -197,11 +197,11 @@ public final class DevicePolicyDrawableResource implements Parcelable { String drawableId = in.readString(); String drawableStyle = in.readString(); String drawableSource = in.readString(); - int callingPackageResourceId = in.readInt(); + int resourceIdInCallingPackage = in.readInt(); ParcelableResource resource = in.readTypedObject(ParcelableResource.CREATOR); return new DevicePolicyDrawableResource( - drawableId, drawableStyle, drawableSource, callingPackageResourceId, + drawableId, drawableStyle, drawableSource, resourceIdInCallingPackage, resource); } diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index c7259d9d1e699..96dd6e7ff8a1d 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -15134,7 +15134,7 @@ public class DevicePolicyManager { * the combination of {@link DevicePolicyDrawableResource#getDrawableId()} and * {@link DevicePolicyDrawableResource#getDrawableStyle()}, (see * {@link DevicePolicyResources.Drawables} and {@link DevicePolicyResources.Drawables.Style}) to - * the drawable with ID {@link DevicePolicyDrawableResource#getCallingPackageResourceId()}, + * the drawable with ID {@link DevicePolicyDrawableResource#getResourceIdInCallingPackage()}, * meaning any system UI surface calling {@link #getDrawable} * with {@code drawableId} and {@code drawableStyle} will get the new resource after this API * is called. @@ -15149,12 +15149,12 @@ public class DevicePolicyManager { *Important notes to consider when using this API: *
It will be used to update the string defined by {@code stringId} to the string with ID - * {@code callingPackageResourceId} in the calling package
+ * {@code resourceIdInCallingPackage} in the calling package * * @param stringId The ID of the string to update. - * @param callingPackageResourceId The ID of the {@link StringRes} in the calling package to + * @param resourceIdInCallingPackage The ID of the {@link StringRes} in the calling package to * use as an updated resource. * - * @throws IllegalStateException if the resource with ID {@code callingPackageResourceId} + * @throws IllegalStateException if the resource with ID {@code resourceIdInCallingPackage} * doesn't exist in the {@code context} package. */ public DevicePolicyStringResource( @NonNull Context context, @NonNull @DevicePolicyResources.UpdatableStringId String stringId, - @StringRes int callingPackageResourceId) { - this(stringId, callingPackageResourceId, new ParcelableResource( - context, callingPackageResourceId, ParcelableResource.RESOURCE_TYPE_STRING)); + @StringRes int resourceIdInCallingPackage) { + this(stringId, resourceIdInCallingPackage, new ParcelableResource( + context, resourceIdInCallingPackage, ParcelableResource.RESOURCE_TYPE_STRING)); } private DevicePolicyStringResource( @NonNull @DevicePolicyResources.UpdatableStringId String stringId, - @StringRes int callingPackageResourceId, + @StringRes int resourceIdInCallingPackage, @NonNull ParcelableResource resource) { Objects.requireNonNull(stringId, "stringId must be provided."); Objects.requireNonNull(resource, "ParcelableResource must be provided."); this.mStringId = stringId; - this.mCallingPackageResourceId = callingPackageResourceId; + this.mResourceIdInCallingPackage = resourceIdInCallingPackage; this.mResource = resource; } @@ -85,8 +85,8 @@ public final class DevicePolicyStringResource implements Parcelable { * Returns the ID of the {@link StringRes} in the calling package to use as an updated * resource. */ - public int getCallingPackageResourceId() { - return mCallingPackageResourceId; + public int getResourceIdInCallingPackage() { + return mResourceIdInCallingPackage; } /** @@ -105,13 +105,13 @@ public final class DevicePolicyStringResource implements Parcelable { if (o == null || getClass() != o.getClass()) return false; DevicePolicyStringResource other = (DevicePolicyStringResource) o; return mStringId == other.mStringId - && mCallingPackageResourceId == other.mCallingPackageResourceId + && mResourceIdInCallingPackage == other.mResourceIdInCallingPackage && mResource.equals(other.mResource); } @Override public int hashCode() { - return Objects.hash(mStringId, mCallingPackageResourceId, mResource); + return Objects.hash(mStringId, mResourceIdInCallingPackage, mResource); } @Override @@ -122,7 +122,7 @@ public final class DevicePolicyStringResource implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString(mStringId); - dest.writeInt(mCallingPackageResourceId); + dest.writeInt(mResourceIdInCallingPackage); dest.writeTypedObject(mResource, flags); } @@ -131,10 +131,10 @@ public final class DevicePolicyStringResource implements Parcelable { @Override public DevicePolicyStringResource createFromParcel(Parcel in) { String stringId = in.readString(); - int callingPackageResourceId = in.readInt(); + int resourceIdInCallingPackage = in.readInt(); ParcelableResource resource = in.readTypedObject(ParcelableResource.CREATOR); - return new DevicePolicyStringResource(stringId, callingPackageResourceId, resource); + return new DevicePolicyStringResource(stringId, resourceIdInCallingPackage, resource); } @Override