From 9d71a6c968434a95b5a195846ef5276920da6203 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 7 May 2013 18:52:22 +0900 Subject: [PATCH] Remove unused device form factor values Change-Id: I1ed88b842a3d45e5460dd387bfad4276c844096a --- java/res/values-sw600dp/config.xml | 2 -- java/res/values-sw768dp/config.xml | 2 -- java/res/values/config.xml | 2 -- .../inputmethod/keyboard/KeyboardId.java | 23 +++---------------- .../keyboard/KeyboardLayoutSet.java | 5 +--- .../keyboard/KeyboardSwitcher.java | 3 +-- 6 files changed, 5 insertions(+), 32 deletions(-) diff --git a/java/res/values-sw600dp/config.xml b/java/res/values-sw600dp/config.xml index 9527fd62a..826565168 100644 --- a/java/res/values-sw600dp/config.xml +++ b/java/res/values-sw600dp/config.xml @@ -19,8 +19,6 @@ --> - - 1 false false false diff --git a/java/res/values-sw768dp/config.xml b/java/res/values-sw768dp/config.xml index 3c2c19855..97f11cb04 100644 --- a/java/res/values-sw768dp/config.xml +++ b/java/res/values-sw768dp/config.xml @@ -19,8 +19,6 @@ --> - - 2 false false false diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 33e6a868c..23b579400 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -19,8 +19,6 @@ --> - - 0 false true true diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index ee8ee9a4f..aa27067bc 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -56,13 +56,8 @@ public final class KeyboardId { public static final int ELEMENT_PHONE_SYMBOLS = 8; public static final int ELEMENT_NUMBER = 9; - public static final int FORM_FACTOR_PHONE = 0; - public static final int FORM_FACTOR_TABLET7 = 1; - public static final int FORM_FACTOR_TABLET10 = 2; - public final InputMethodSubtype mSubtype; public final Locale mLocale; - public final int mDeviceFormFactor; // TODO: Remove this member. It is used only for logging purpose. public final int mOrientation; public final int mWidth; @@ -82,7 +77,6 @@ public final class KeyboardId { public KeyboardId(final int elementId, final KeyboardLayoutSet.Params params) { mSubtype = params.mSubtype; mLocale = SubtypeLocale.getSubtypeLocale(mSubtype); - mDeviceFormFactor = params.mDeviceFormFactor; mOrientation = params.mOrientation; mWidth = params.mKeyboardWidth; mHeight = params.mKeyboardHeight; @@ -107,7 +101,6 @@ public final class KeyboardId { private static int computeHashCode(final KeyboardId id) { return Arrays.hashCode(new Object[] { - id.mDeviceFormFactor, id.mOrientation, id.mElementId, id.mMode, @@ -130,8 +123,7 @@ public final class KeyboardId { private boolean equals(final KeyboardId other) { if (other == this) return true; - return other.mDeviceFormFactor == mDeviceFormFactor - && other.mOrientation == mOrientation + return other.mOrientation == mOrientation && other.mElementId == mElementId && other.mMode == mMode && other.mWidth == mWidth @@ -195,11 +187,11 @@ public final class KeyboardId { public String toString() { final String orientation = (mOrientation == Configuration.ORIENTATION_PORTRAIT) ? "port" : "land"; - return String.format("[%s %s:%s %s-%s:%dx%d %s %s %s%s%s%s%s%s%s%s%s]", + return String.format("[%s %s:%s %s:%dx%d %s %s %s%s%s%s%s%s%s%s%s]", elementIdToName(mElementId), mLocale, mSubtype.getExtraValueOf(KEYBOARD_LAYOUT_SET), - deviceFormFactor(mDeviceFormFactor), orientation, mWidth, mHeight, + orientation, mWidth, mHeight, modeName(mMode), imeAction(), (navigateNext() ? "navigateNext" : ""), @@ -238,15 +230,6 @@ public final class KeyboardId { } } - public static String deviceFormFactor(final int deviceFormFactor) { - switch (deviceFormFactor) { - case FORM_FACTOR_PHONE: return "phone"; - case FORM_FACTOR_TABLET7: return "tablet7"; - case FORM_FACTOR_TABLET10: return "tablet10"; - default: return null; - } - } - public static String modeName(final int mode) { switch (mode) { case MODE_TEXT: return "text"; diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java index 5e68c7067..bc9e8cdd4 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java @@ -106,7 +106,6 @@ public final class KeyboardLayoutSet { boolean mNoSettingsKey; boolean mLanguageSwitchKeyEnabled; InputMethodSubtype mSubtype; - int mDeviceFormFactor; int mOrientation; int mKeyboardWidth; int mKeyboardHeight; @@ -217,10 +216,8 @@ public final class KeyboardLayoutSet { mPackageName, NO_SETTINGS_KEY, mEditorInfo); } - public Builder setScreenGeometry(final int deviceFormFactor, final int widthPixels, - final int heightPixels) { + public Builder setScreenGeometry(final int widthPixels, final int heightPixels) { final Params params = mParams; - params.mDeviceFormFactor = deviceFormFactor; params.mOrientation = (heightPixels > widthPixels) ? Configuration.ORIENTATION_PORTRAIT : Configuration.ORIENTATION_LANDSCAPE; setDefaultKeyboardSize(widthPixels, heightPixels); diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 4e41b77ce..39afe9072 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -142,8 +142,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { mThemeContext, editorInfo); final Resources res = mThemeContext.getResources(); final DisplayMetrics dm = res.getDisplayMetrics(); - builder.setScreenGeometry(res.getInteger(R.integer.config_device_form_factor), - dm.widthPixels, dm.heightPixels); + builder.setScreenGeometry(dm.widthPixels, dm.heightPixels); builder.setSubtype(mSubtypeSwitcher.getCurrentSubtype()); builder.setOptions( settingsValues.isVoiceKeyEnabled(editorInfo),