Package org.robolectric.shadows
Class ShadowVMRuntime
- java.lang.Object
-
- org.robolectric.shadows.ShadowVMRuntime
-
@Implements(value=dalvik.system.VMRuntime.class, isInAndroidSdk=false) public class ShadowVMRuntime extends Object
-
-
Constructor Summary
Constructors Constructor Description ShadowVMRuntime()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddressOf(Object obj)Returns a unique identifier of the object instead of a 'native' address.protected static StringgetCurrentInstructionSet()Returns the instruction set of the current runtime.ObjectgetObjectForAddress(long address)Returns the object previously registered withaddressOf(Object).protected booleanis64Bit()Returns whether the VM is running in 64-bit mode.ObjectnewNonMovableArray(Class<?> type, int size)ObjectnewUnpaddedArray(Class<?> klass, int size)static voidreset()static voidsetCurrentInstructionSet(String currentInstructionSet)Sets the instruction set of the current runtime.static voidsetIs64Bit(boolean is64Bit)Sets whether the VM is running in 64-bit mode.
-
-
-
Method Detail
-
newUnpaddedArray
@Implementation(minSdk=21) public Object newUnpaddedArray(Class<?> klass, int size)
-
newNonMovableArray
@Implementation public Object newNonMovableArray(Class<?> type, int size)
-
addressOf
@Implementation public long addressOf(Object obj)
Returns a unique identifier of the object instead of a 'native' address.
-
getObjectForAddress
@Nullable public Object getObjectForAddress(long address)
Returns the object previously registered withaddressOf(Object).
-
is64Bit
@Implementation(minSdk=21) protected boolean is64Bit()
Returns whether the VM is running in 64-bit mode. Available in Android L+. Defaults to true.
-
setIs64Bit
public static void setIs64Bit(boolean is64Bit)
Sets whether the VM is running in 64-bit mode.
-
getCurrentInstructionSet
@Implementation(minSdk=21) protected static String getCurrentInstructionSet()
Returns the instruction set of the current runtime.
-
setCurrentInstructionSet
public static void setCurrentInstructionSet(@Nullable String currentInstructionSet)
Sets the instruction set of the current runtime.
-
reset
@Resetter public static void reset()
-
-