diff options
-rw-r--r-- | libdvm/src/main/java/dalvik/system/VMRuntime.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libdvm/src/main/java/dalvik/system/VMRuntime.java b/libdvm/src/main/java/dalvik/system/VMRuntime.java index 71098be..48685f6 100644 --- a/libdvm/src/main/java/dalvik/system/VMRuntime.java +++ b/libdvm/src/main/java/dalvik/system/VMRuntime.java @@ -30,6 +30,8 @@ public final class VMRuntime { */ private static final VMRuntime THE_ONE = new VMRuntime(); + private int targetSdkVersion; + /** * Prevents this class from being instantiated. */ @@ -111,9 +113,23 @@ public final class VMRuntime { * app starts to run, because it may change the VM's behavior in * dangerous ways. Use 0 to mean "current" (since callers won't * necessarily know the actual current SDK version, and the - * allocated version numbers start at 1). + * allocated version numbers start at 1), and 10000 to mean + * CUR_DEVELOPMENT. */ - public native void setTargetSdkVersion(int targetSdkVersion); + public synchronized void setTargetSdkVersion(int targetSdkVersion) { + this.targetSdkVersion = targetSdkVersion; + setTargetSdkVersionNative(this.targetSdkVersion); + } + + /** + * Gets the target SDK version. See {@link #setTargetSdkVersion} for + * special values. + */ + public synchronized int getTargetSdkVersion() { + return targetSdkVersion; + } + + private native void setTargetSdkVersionNative(int targetSdkVersion); /** * This method exists for binary compatibility. It was part of a |