aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-06-04 17:55:50 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-06-08 16:19:57 -0700
commite08be735a431fe3f688418a04f8bb75603a6c5a9 (patch)
treed05f54cc442ba878d5dda17745c356a74bfe6e39 /src/java
parent16cd8dd48f6ea491f369ea9a382e7ffff39e8332 (diff)
downloadlineage-sdk-e08be735a431fe3f688418a04f8bb75603a6c5a9.tar.gz
lineage-sdk-e08be735a431fe3f688418a04f8bb75603a6c5a9.tar.bz2
lineage-sdk-e08be735a431fe3f688418a04f8bb75603a6c5a9.zip
CMSDK: Create versioning for platform SDK.
Introduce Apricot, the first version for the platform sdk. Change-Id: I4963650cb861725508aa71276977ac6157f248fc
Diffstat (limited to 'src/java')
-rw-r--r--src/java/cyanogenmod/os/Build.java67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/java/cyanogenmod/os/Build.java b/src/java/cyanogenmod/os/Build.java
new file mode 100644
index 00000000..55b5cd09
--- /dev/null
+++ b/src/java/cyanogenmod/os/Build.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2015 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package cyanogenmod.os;
+
+import android.os.SystemProperties;
+
+import java.util.HashMap;
+
+/**
+ * Information about the current CyanogenMod build, extracted from system properties.
+ */
+public class Build {
+ /** Value used for when a build property is unknown. */
+ public static final String UNKNOWN = "unknown";
+
+ private static final HashMap<Integer, String> sdkMap;
+ static
+ {
+ sdkMap = new HashMap<Integer, String>();
+ sdkMap.put(CM_VERSION_CODES.APRICOT, "Apricot");
+ }
+
+ /** Various version strings. */
+ public static class CM_VERSION {
+ /**
+ * The user-visible SDK version of the framework; its possible
+ * values are defined in {@link Build.CM_VERSION_CODES}.
+ */
+ public static final int SDK_INT = SystemProperties.getInt(
+ "ro.cm.build.version.plat.sdk", 0);
+ }
+
+ /**
+ * Enumeration of the currently known SDK version codes. These are the
+ * values that can be found in {@link CM_VERSION#SDK_INT}. Version numbers
+ * increment monotonically with each official platform release.
+ */
+ public static class CM_VERSION_CODES {
+ /**
+ * June 2015: The first version of the platform sdk for CyanogenMod
+ */
+ public static final int APRICOT = 1;
+ }
+
+ /**
+ * Retrieve the name for the SDK int
+ * @param sdkInt
+ * @return name of the SDK int
+ */
+ public static String getNameForSDKInt(int sdkInt) {
+ return sdkMap.get(sdkInt);
+ }
+}