summaryrefslogtreecommitdiffstats
path: root/libdvm
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2013-10-24 16:05:40 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-24 16:05:40 -0700
commit17a9c017e2eb3b4448cefb0e75a74001f2ea286e (patch)
tree5d75224980ea9da3a7e9fe24c7da9f7acabfb9b1 /libdvm
parent23c359e0d0170d905340d8afd80c7833e0966034 (diff)
parent3c91b32f26cd9e11fece356b005cd8437ef4b192 (diff)
downloadlibcore-17a9c017e2eb3b4448cefb0e75a74001f2ea286e.zip
libcore-17a9c017e2eb3b4448cefb0e75a74001f2ea286e.tar.gz
libcore-17a9c017e2eb3b4448cefb0e75a74001f2ea286e.tar.bz2
am 3c91b32f: Merge "Add VMRuntime.getTargetSdkVersion."
* commit '3c91b32f26cd9e11fece356b005cd8437ef4b192': Add VMRuntime.getTargetSdkVersion.
Diffstat (limited to 'libdvm')
-rw-r--r--libdvm/src/main/java/dalvik/system/VMRuntime.java20
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 e1b4a00..f26ca54 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.
*/
@@ -116,9 +118,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