summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAndy Mast <andy@cyngn.com>2015-05-26 10:59:20 -0700
committerClark Scheff <clark@cyngn.com>2015-10-27 18:19:33 -0700
commitd92d18ff740c118e07caf5094b53822bfdbbf8a4 (patch)
tree6f1b4102c3c3cc136f95cebe816057b4a4dcf25f /core/java
parentc07ca25126b4f9650f86af043a44fa90c37025fd (diff)
downloadframeworks_base-d92d18ff740c118e07caf5094b53822bfdbbf8a4.zip
frameworks_base-d92d18ff740c118e07caf5094b53822bfdbbf8a4.tar.gz
frameworks_base-d92d18ff740c118e07caf5094b53822bfdbbf8a4.tar.bz2
Introduce Theme Versioning [1/2]
See also the CMSDK Project Change-Id: Id37031f353e059ef1e57f3d5d19a6c0f8d3c5ad1
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/content/ThemeVersion.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/core/java/android/content/ThemeVersion.java b/core/java/android/content/ThemeVersion.java
new file mode 100644
index 0000000..05fbc41
--- /dev/null
+++ b/core/java/android/content/ThemeVersion.java
@@ -0,0 +1,75 @@
+/*
+ * 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 android.content;
+
+/**
+ * Warning: Careful moving/refactoring this class as our SDK references it.
+ * ThemeVersion 1 = CM11
+ * ThemeVersion 2 = CM12/CM12.1 First Release
+ * ThemeVersion 3 = CM12.1 W/ Wallpaper Packs
+ * @hide
+ */
+public class ThemeVersion {
+ /**
+ * Increment this anytime changes are made to:
+ * 1) Changes to ThemesContract
+ * 2) Changes to ThemeService API
+ * 3) Changes to ThemeManager API
+ */
+ public static int THEME_VERSION = 3;
+
+ /**
+ * Change this if a change to the contract or service would break compatibility.
+ * Example: A client app like chooser might be outdated from the framework.
+ * It could then query the FW for this value and determine whether its safe to proceed.
+ */
+ public static int MIN_SUPPORTED_THEME_VERSION = 2;
+
+ /**
+ * Do not change the order of this. See SDK.
+ * Increment the minSupportedVersion when the fw can no longer support a theme's apk structure
+ * Increment currentVersion when a change to the theme's apk structure is changed
+ * For example, CM11 to CM12 introduces new resources to overlay, so the overlays
+ * version should change. Because the changes are not compatible with CM11, the minVersion
+ * must change as well.
+ *
+ * If a new feature is added to a component (ex rotations in icon packs), the current version
+ * for the ICON component would be incremented. If a new component is created, then add it
+ * to the enum list.
+ *
+ * Wallpaper Version 2: Multi wallpaper ability
+ *
+ */
+ public static enum ComponentVersion {
+ OVERLAY(0, 2, 2),
+ BOOT_ANIM(1, 1, 1),
+ WALLPAPER(2, 1, 2),
+ LOCKSCREEN(3, 1, 1),
+ FONT(4, 1, 2),
+ ICON(5, 1, 1),
+ SOUNDS(6, 1, 1);
+
+ public int id;
+ public int minSupportedVersion;
+ public int currentVersion;
+
+ private ComponentVersion(int id, int minSupportedVersion, int currentVersion) {
+ this.id = id;
+ this.minSupportedVersion = minSupportedVersion;
+ this.currentVersion = currentVersion;
+ }
+ }
+}