Added in API level 33

DevicePolicyResourcesManager


public class DevicePolicyResourcesManager
extends Object

java.lang.Object
   ↳ android.app.admin.DevicePolicyResourcesManager


Class containing required APIs to set, reset, and get device policy related resources.

Summary

Public methods

Drawable getDrawable(String drawableId, String drawableStyle, Supplier<Drawable> defaultDrawableLoader)

Returns the appropriate updated drawable for the drawableId with style drawableStyle if one was set using setDrawables, otherwise returns the drawable from defaultDrawableLoader.

Drawable getDrawable(String drawableId, String drawableStyle, String drawableSource, Supplier<Drawable> defaultDrawableLoader)

Similar to getDrawable(String,String,Supplier), but also accepts a drawableSource which could result in returning a different drawable than getDrawable(String,String,Supplier) if an override was set for that specific source.

Icon getDrawableAsIcon(String drawableId, String drawableStyle, String drawableSource, Icon defaultIcon)

Similar to getDrawable(String,String,String,Supplier) but returns an Icon instead of a Drawable.

Icon getDrawableAsIcon(String drawableId, String drawableStyle, Icon defaultIcon)

Similar to getDrawable(String,String,Supplier) but returns an Icon instead of a Drawable.

Drawable getDrawableForDensity(String drawableId, String drawableStyle, int density, Supplier<Drawable> defaultDrawableLoader)

Similar to getDrawable(String,String,Supplier), but also accepts density.

Drawable getDrawableForDensity(String drawableId, String drawableStyle, String drawableSource, int density, Supplier<Drawable> defaultDrawableLoader)

Similar to getDrawable(String,String,String,Supplier), but also accepts density.

String getString(String stringId, Supplier<String> defaultStringLoader, Object... formatArgs)

Similar to getString(String,Supplier) but accepts formatArgs and returns a localized formatted string, substituting the format arguments as defined in Formatter and String.format(String, Object), (see Resources.getString(int,Object...)).

String getString(String stringId, Supplier<String> defaultStringLoader)

Returns the appropriate updated string for the stringId (see DevicePolicyResources.Strings) if one was set using setStrings, otherwise returns the string from defaultStringLoader.

Inherited methods