Package org.robolectric.shadows
Class ShadowLegacyAssetManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowAssetManager
-
- org.robolectric.shadows.ShadowLegacyAssetManager
-
@Implements(value=android.content.res.AssetManager.class, looseSignatures=true, shadowPicker=Picker.class) public class ShadowLegacyAssetManager extends ShadowAssetManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowAssetManager
ShadowAssetManager.ArscBase, ShadowAssetManager.Picker
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.collect.Ordering<String>ATTRIBUTE_TYPE_PRECIDENCEprotected AssetManagerrealObject
-
Constructor Summary
Constructors Constructor Description ShadowLegacyAssetManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void__constructor__()protected void__constructor__(boolean isSystem)intaddAssetPath(String path)protected intaddAssetPathNative(String path)protected intaddAssetPathNative(String path, boolean appAsLib)protected static booleanapplyStyle(int themeToken, int defStyleAttr, int defStyleRes, int xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)protected static booleanapplyStyle(long themeToken, int defStyleAttr, int defStyleRes, long xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)protected static voidapplyStyle(long themeToken, int defStyleAttr, int defStyleRes, long xmlParserToken, int[] inAttrs, int length, long outValuesAddress, long outIndicesAddress)protected voidapplyStyleToTheme(long themePtr, int resId, boolean force)static voidapplyThemeStyle(int themePtr, int styleRes, boolean force)static voidapplyThemeStyle(long themePtr, int styleRes, boolean force)static voidcopyTheme(int destPtr, int sourcePtr)static voidcopyTheme(long destPtr, long sourcePtr)NumbercreateTheme()protected voiddeleteTheme(int theme)protected voiddeleteTheme(long theme)protected voiddestroyAsset(int asset)protected voiddestroyAsset(long asset)protected static voiddumpTheme(long theme, int priority, String tag, String prefix)protected ObjectensureStringBlocks()int[]getArrayIntResource(int resId)protected intgetArraySize(int id)protected int[]getArrayStringInfo(int arrayResId)protected String[]getArrayStringResource(int arrayResId)protected longgetAssetLength(int asset)protected longgetAssetLength(long asset)protected longgetAssetRemainingLength(int asset)protected longgetAssetRemainingLength(long assetHandle)protected SparseArray<String>getAssignedPackageIdentifiers()TypedResourcegetAttrTypeData(ResName resName)protected String[]getLocales()protected NumbergetNativeStringBlock(int block)CharSequencegetResourceBagText(int ident, int bagEntryId)protected StringgetResourceEntryName(int resid)intgetResourceIdentifier(String name, String defType, String defPackage)protected int[]getResourceIntArray(int resId)protected StringgetResourceName(int resid)protected StringgetResourcePackageName(int resid)String[]getResourceStringArray(int id)protected ResourceTablegetResourceTable()CharSequencegetResourceText(int ident)CharSequence[]getResourceTextArray(int resId)protected StringgetResourceTypeName(int resid)booleangetResourceValue(int ident, int density, TypedValue outValue, boolean resolveRefs)protected intgetStringBlockCount()booleangetThemeValue(int themePtr, int ident, TypedValue outValue, boolean resolveRefs)booleangetThemeValue(long themePtr, int ident, TypedValue outValue, boolean resolveRefs)protected TypedArraygetTypedArrayResource(Resources resources, int resId)protected voidinit()protected voidinit(boolean isSystem)booleanisUpToDate()protected String[]list(String path)protected intloadResourceBagValue(int ident, int bagEntryId, TypedValue outValue, boolean resolve)protected intloadResourceValue(int ident, short density, TypedValue outValue, boolean resolve)protected static intloadThemeAttributeValue(int themeHandle, int ident, TypedValue outValue, boolean resolve)protected static intloadThemeAttributeValue(long themeHandle, int ident, TypedValue outValue, boolean resolve)protected XmlResourceParserloadXmlResourceParser(int resId, String type)protected static voidnativeAssetDestroy(long asset_ptr)protected static longnativeAssetGetLength(long asset_ptr)protected static longnativeAssetGetRemainingLength(long asset_ptr)protected static intnativeAssetRead(long asset_ptr, byte[] java_buffer, int offset, int len)protected static intnativeAssetReadChar(long asset_ptr)protected static longnativeAssetSeek(long asset_ptr, long offset, int whence)protected static longnativeCreate()protected static String[]nativeCreateIdmapsForStaticOverlaysTargetingAndroid()protected static voidnativeThemeCopy(long destPtr, long sourcePtr)protected static voidnativeThemeCopy(long dstAssetManagerPtr, long dstThemePtr, long srcAssetManagerPtr, long srcThemePtr)protected NumbernewTheme()protected InputStreamopen(String fileName)protected InputStreamopen(String fileName, int accessMode)protected NumberopenAsset(String fileName, int mode)protected ParcelFileDescriptoropenAssetFd(String fileName, long[] outOffsets)protected AssetFileDescriptoropenFd(String fileName)InputStreamopenNonAsset(int cookie, String fileName, int accessMode)AssetFileDescriptoropenNonAssetFd(int cookie, String fileName)protected ParcelFileDescriptoropenNonAssetFdNative(int cookie, String fileName, long[] outOffsets)protected NumberopenNonAssetNative(int cookie, String fileName, int accessMode)protected NumberopenXmlAssetNative(int cookie, String fileName)protected XmlResourceParseropenXmlResourceParser(int cookie, String fileName)voidreleaseTheme(int themePtr)voidreleaseTheme(long themePtr)static voidreset()protected static booleanresolveAttrs(long themeToken, int defStyleAttr, int defStyleRes, int[] inValues, int[] attrs, int[] outValues, int[] outIndices)protected ResNameresolveResName(ResName resName, ResTable_config config)protected TypedResourceresolveResourceValue(TypedResource value, ResTable_config config, int resId)protected intretrieveArray(int id, int[] outValues)protected booleanretrieveAttributes(int xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)protected booleanretrieveAttributes(long xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)protected longseekAsset(int asset, long offset, int whence)protected longseekAsset(long asset, long offset, int whence)voidsetApkAssets(Object apkAssetsObject, Object invalidateCachesObject)voidsetConfiguration(int mcc, int mnc, String locale, int orientation, int touchscreen, int density, int keyboard, int keyboardHidden, int navigation, int screenWidth, int screenHeight, int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp, int screenLayout, int uiMode, int sdkVersion)voidsetConfiguration(int mcc, int mnc, String locale, int orientation, int touchscreen, int density, int keyboard, int keyboardHidden, int navigation, int screenWidth, int screenHeight, int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp, int screenLayout, int uiMode, int colorMode, int majorVersion)voidsetLocale(String locale)-
Methods inherited from class org.robolectric.shadows.ShadowAssetManager
useLegacy
-
-
-
-
Field Detail
-
ATTRIBUTE_TYPE_PRECIDENCE
public static final com.google.common.collect.Ordering<String> ATTRIBUTE_TYPE_PRECIDENCE
-
realObject
@RealObject protected AssetManager realObject
-
-
Method Detail
-
getAttrTypeData
public TypedResource getAttrTypeData(ResName resName)
-
__constructor__
@Implementation protected void __constructor__()
-
__constructor__
@Implementation protected void __constructor__(boolean isSystem)
-
nativeCreate
@Implementation(minSdk=28) protected static long nativeCreate()
-
init
@HiddenApi @Implementation(maxSdk=20) protected void init()
-
init
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected void init(boolean isSystem)
-
getResourceTable
protected ResourceTable getResourceTable()
-
getResourceText
@HiddenApi @Implementation public CharSequence getResourceText(int ident)
-
getResourceBagText
@HiddenApi @Implementation public CharSequence getResourceBagText(int ident, int bagEntryId)
-
getStringBlockCount
@HiddenApi @Implementation(maxSdk=27) protected int getStringBlockCount()
-
getResourceStringArray
@HiddenApi @Implementation public String[] getResourceStringArray(int id)
-
getResourceIdentifier
@HiddenApi @Implementation public int getResourceIdentifier(String name, String defType, String defPackage)
-
getResourceValue
@HiddenApi @Implementation public boolean getResourceValue(int ident, int density, TypedValue outValue, boolean resolveRefs)
-
getResourceTextArray
@HiddenApi @Implementation public CharSequence[] getResourceTextArray(int resId)
-
getThemeValue
@HiddenApi @Implementation(maxSdk=20) public boolean getThemeValue(int themePtr, int ident, TypedValue outValue, boolean resolveRefs)
-
getThemeValue
@HiddenApi @Implementation(minSdk=21) public boolean getThemeValue(long themePtr, int ident, TypedValue outValue, boolean resolveRefs)
-
ensureStringBlocks
@HiddenApi @Implementation(maxSdk=27) protected Object ensureStringBlocks()
-
open
@Implementation protected final InputStream open(String fileName) throws IOException
- Throws:
IOException
-
open
@Implementation protected final InputStream open(String fileName, int accessMode) throws IOException
- Throws:
IOException
-
openFd
@Implementation protected final AssetFileDescriptor openFd(String fileName) throws IOException
- Throws:
IOException
-
list
@Implementation protected final String[] list(String path) throws IOException
- Throws:
IOException
-
openAsset
@HiddenApi @Implementation(maxSdk=27) protected Number openAsset(String fileName, int mode) throws FileNotFoundException
- Throws:
FileNotFoundException
-
openAssetFd
@HiddenApi @Implementation(maxSdk=27) protected ParcelFileDescriptor openAssetFd(String fileName, long[] outOffsets) throws IOException
- Throws:
IOException
-
openNonAsset
@HiddenApi @Implementation public final InputStream openNonAsset(int cookie, String fileName, int accessMode) throws IOException
- Throws:
IOException
-
openNonAssetNative
@HiddenApi @Implementation(maxSdk=27) protected Number openNonAssetNative(int cookie, String fileName, int accessMode) throws FileNotFoundException
- Throws:
FileNotFoundException
-
openNonAssetFd
@HiddenApi @Implementation public final AssetFileDescriptor openNonAssetFd(int cookie, String fileName) throws IOException
- Throws:
IOException
-
openNonAssetFdNative
@HiddenApi @Implementation(maxSdk=27) protected ParcelFileDescriptor openNonAssetFdNative(int cookie, String fileName, long[] outOffsets) throws IOException
- Throws:
IOException
-
openXmlAssetNative
@HiddenApi @Implementation(maxSdk=27) protected Number openXmlAssetNative(int cookie, String fileName) throws FileNotFoundException
- Throws:
FileNotFoundException
-
openXmlResourceParser
@Implementation protected final XmlResourceParser openXmlResourceParser(int cookie, String fileName) throws IOException
- Throws:
IOException
-
seekAsset
@HiddenApi @Implementation(maxSdk=20) protected final long seekAsset(int asset, long offset, int whence)
-
seekAsset
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected long seekAsset(long asset, long offset, int whence)
-
getAssetLength
@HiddenApi @Implementation(maxSdk=20) protected final long getAssetLength(int asset)
-
getAssetLength
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected long getAssetLength(long asset)
-
getAssetRemainingLength
@HiddenApi @Implementation(maxSdk=20) protected final long getAssetRemainingLength(int asset)
-
getAssetRemainingLength
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected long getAssetRemainingLength(long assetHandle)
-
destroyAsset
@HiddenApi @Implementation(maxSdk=20) protected final void destroyAsset(int asset)
-
destroyAsset
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected void destroyAsset(long asset)
-
loadXmlResourceParser
protected XmlResourceParser loadXmlResourceParser(int resId, String type) throws Resources.NotFoundException
- Throws:
Resources.NotFoundException
-
addAssetPath
@HiddenApi @Implementation public int addAssetPath(String path)
-
addAssetPathNative
@HiddenApi @Implementation(minSdk=18, maxSdk=23) protected final int addAssetPathNative(String path)
-
addAssetPathNative
@HiddenApi @Implementation(minSdk=24, maxSdk=27) protected int addAssetPathNative(String path, boolean appAsLib)
-
setApkAssets
@HiddenApi @Implementation(minSdk=28) public void setApkAssets(Object apkAssetsObject, Object invalidateCachesObject)
-
isUpToDate
@HiddenApi @Implementation public boolean isUpToDate()
-
setLocale
@HiddenApi @Implementation(maxSdk=23) public void setLocale(String locale)
-
getLocales
@Implementation protected String[] getLocales()
-
setConfiguration
@HiddenApi @Implementation(maxSdk=25) public final void setConfiguration(int mcc, int mnc, String locale, int orientation, int touchscreen, int density, int keyboard, int keyboardHidden, int navigation, int screenWidth, int screenHeight, int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp, int screenLayout, int uiMode, int sdkVersion)
-
setConfiguration
@HiddenApi @Implementation(minSdk=26) public void setConfiguration(int mcc, int mnc, String locale, int orientation, int touchscreen, int density, int keyboard, int keyboardHidden, int navigation, int screenWidth, int screenHeight, int smallestScreenWidthDp, int screenWidthDp, int screenHeightDp, int screenLayout, int uiMode, int colorMode, int majorVersion)
-
getArrayIntResource
@HiddenApi @Implementation(maxSdk=27) public int[] getArrayIntResource(int resId)
-
getResourceIntArray
@HiddenApi @Implementation(minSdk=28) protected int[] getResourceIntArray(int resId)
-
getArrayStringResource
@HiddenApi @Implementation(maxSdk=27) protected String[] getArrayStringResource(int arrayResId)
-
getArrayStringInfo
@HiddenApi @Implementation(maxSdk=27) protected int[] getArrayStringInfo(int arrayResId)
-
newTheme
@HiddenApi @Implementation(maxSdk=27) protected Number newTheme()
-
getTypedArrayResource
protected TypedArray getTypedArrayResource(Resources resources, int resId)
-
createTheme
@HiddenApi @Implementation public Number createTheme()
-
dumpTheme
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected static void dumpTheme(long theme, int priority, String tag, String prefix)
-
releaseTheme
@HiddenApi @Implementation(maxSdk=20) public void releaseTheme(int themePtr)
-
releaseTheme
@HiddenApi @Implementation(minSdk=21) public void releaseTheme(long themePtr)
-
deleteTheme
@HiddenApi @Implementation(maxSdk=20) protected void deleteTheme(int theme)
-
deleteTheme
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected void deleteTheme(long theme)
-
applyThemeStyle
@HiddenApi @Implementation(maxSdk=20) public static void applyThemeStyle(int themePtr, int styleRes, boolean force)
-
applyThemeStyle
@HiddenApi @Implementation(minSdk=21, maxSdk=27) public static void applyThemeStyle(long themePtr, int styleRes, boolean force)
-
copyTheme
@HiddenApi @Implementation(maxSdk=20) public static void copyTheme(int destPtr, int sourcePtr)
-
copyTheme
@HiddenApi @Implementation(minSdk=21, maxSdk=27) public static void copyTheme(long destPtr, long sourcePtr)
-
nativeThemeCopy
@HiddenApi @Implementation(minSdk=28, maxSdk=28) protected static void nativeThemeCopy(long destPtr, long sourcePtr)
-
nativeThemeCopy
@HiddenApi @Implementation(minSdk=29) protected static void nativeThemeCopy(long dstAssetManagerPtr, long dstThemePtr, long srcAssetManagerPtr, long srcThemePtr)
-
applyStyle
@HiddenApi @Implementation(maxSdk=20) protected static boolean applyStyle(int themeToken, int defStyleAttr, int defStyleRes, int xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)
-
applyStyle
@HiddenApi @Implementation(minSdk=26, maxSdk=27) protected static void applyStyle(long themeToken, int defStyleAttr, int defStyleRes, long xmlParserToken, int[] inAttrs, int length, long outValuesAddress, long outIndicesAddress)
-
applyStyleToTheme
@HiddenApi @Implementation(minSdk=28) protected void applyStyleToTheme(long themePtr, int resId, boolean force)
-
applyStyle
@HiddenApi @Implementation(minSdk=21, maxSdk=25) protected static boolean applyStyle(long themeToken, int defStyleAttr, int defStyleRes, long xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)
-
resolveAttrs
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected static boolean resolveAttrs(long themeToken, int defStyleAttr, int defStyleRes, int[] inValues, int[] attrs, int[] outValues, int[] outIndices)
-
retrieveAttributes
@HiddenApi @Implementation(maxSdk=20) protected boolean retrieveAttributes(int xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)
-
retrieveAttributes
@Implementation(minSdk=21, maxSdk=27) protected boolean retrieveAttributes(long xmlParserToken, int[] attrs, int[] outValues, int[] outIndices)
-
loadThemeAttributeValue
@HiddenApi @Implementation(maxSdk=20) protected static int loadThemeAttributeValue(int themeHandle, int ident, TypedValue outValue, boolean resolve)
-
loadThemeAttributeValue
@HiddenApi @Implementation(minSdk=21, maxSdk=27) protected static int loadThemeAttributeValue(long themeHandle, int ident, TypedValue outValue, boolean resolve)
-
resolveResName
protected ResName resolveResName(ResName resName, ResTable_config config)
-
resolveResourceValue
protected TypedResource resolveResourceValue(TypedResource value, ResTable_config config, int resId)
-
getResourceName
@Implementation protected String getResourceName(int resid)
-
getResourcePackageName
@Implementation protected String getResourcePackageName(int resid)
-
getResourceTypeName
@Implementation protected String getResourceTypeName(int resid)
-
getResourceEntryName
@Implementation protected String getResourceEntryName(int resid)
-
getArraySize
@Implementation(maxSdk=27) protected int getArraySize(int id)
-
retrieveArray
@Implementation(maxSdk=27) protected int retrieveArray(int id, int[] outValues)
-
getNativeStringBlock
@Implementation(maxSdk=27) protected Number getNativeStringBlock(int block)
-
getAssignedPackageIdentifiers
@Implementation(minSdk=21, maxSdk=27) protected final SparseArray<String> getAssignedPackageIdentifiers()
-
loadResourceValue
@Implementation(maxSdk=27) protected int loadResourceValue(int ident, short density, TypedValue outValue, boolean resolve)
-
loadResourceBagValue
@Implementation(maxSdk=27) protected int loadResourceBagValue(int ident, int bagEntryId, TypedValue outValue, boolean resolve)
-
nativeAssetDestroy
@Implementation(minSdk=28) protected static void nativeAssetDestroy(long asset_ptr)
-
nativeAssetReadChar
@Implementation(minSdk=28) protected static int nativeAssetReadChar(long asset_ptr)
-
nativeAssetRead
@Implementation(minSdk=28) protected static int nativeAssetRead(long asset_ptr, byte[] java_buffer, int offset, int len) throws IOException
- Throws:
IOException
-
nativeAssetSeek
@Implementation(minSdk=28) protected static long nativeAssetSeek(long asset_ptr, long offset, int whence)
-
nativeAssetGetLength
@Implementation(minSdk=28) protected static long nativeAssetGetLength(long asset_ptr)
-
nativeAssetGetRemainingLength
@Implementation(minSdk=28) protected static long nativeAssetGetRemainingLength(long asset_ptr)
-
nativeCreateIdmapsForStaticOverlaysTargetingAndroid
@Implementation(minSdk=29, maxSdk=30) protected static String[] nativeCreateIdmapsForStaticOverlaysTargetingAndroid()
-
reset
@Resetter public static void reset()
-
-