From 4f17f3df461df13ecda64732e15f40ab9d534d1d Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 10 Oct 2014 17:02:55 +0900 Subject: [PATCH] Fixing keyboard theme selection Bug: 17937287 Change-Id: I476045980843c5897820cd544daea06fa991acb5 --- .../inputmethod/keyboard/KeyboardTheme.java | 18 +++++++------ .../keyboard/KeyboardThemeTests.java | 26 +++++++++++++++++++ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardTheme.java b/java/src/com/android/inputmethod/keyboard/KeyboardTheme.java index 6d8c8b76f..8a9688ac4 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardTheme.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardTheme.java @@ -22,7 +22,6 @@ import android.os.Build.VERSION_CODES; import android.preference.PreferenceManager; import android.util.Log; -import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.compat.BuildCompatUtils; import com.android.inputmethod.latin.R; @@ -45,7 +44,7 @@ public final class KeyboardTheme implements Comparable { private static KeyboardTheme[] AVAILABLE_KEYBOARD_THEMES; - @UsedForTesting + /* package private for testing */ static final KeyboardTheme[] KEYBOARD_THEMES = { new KeyboardTheme(THEME_ID_ICS, "ICS", R.style.KeyboardTheme_ICS, // This has never been selected because we support ICS or later. @@ -57,6 +56,7 @@ public final class KeyboardTheme implements Comparable { // Default theme for LXX. BuildCompatUtils.VERSION_CODES_LXX), new KeyboardTheme(THEME_ID_LXX_DARK, "LXXDark", R.style.KeyboardTheme_LXX_Dark, + // This has never been selected as default theme. VERSION_CODES.BASE), }; @@ -68,7 +68,7 @@ public final class KeyboardTheme implements Comparable { public final int mThemeId; public final int mStyleId; public final String mThemeName; - private final int mMinApiVersion; + public final int mMinApiVersion; // Note: The themeId should be aligned with "themeId" attribute of Keyboard style // in values/themes-