2011-12-12 07:11:37 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 The Android Open Source 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 com.android.inputmethod.keyboard;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2012-01-13 07:14:02 +00:00
|
|
|
import android.content.res.Configuration;
|
2011-12-12 07:11:37 +00:00
|
|
|
import android.content.res.Resources;
|
2011-12-13 08:30:51 +00:00
|
|
|
import android.content.res.TypedArray;
|
|
|
|
import android.content.res.XmlResourceParser;
|
2011-12-15 05:45:14 +00:00
|
|
|
import android.util.Log;
|
2011-12-13 08:30:51 +00:00
|
|
|
import android.util.Xml;
|
2011-12-12 07:11:37 +00:00
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
|
|
2012-01-17 05:38:00 +00:00
|
|
|
import com.android.inputmethod.compat.EditorInfoCompatUtils;
|
2011-12-12 07:11:37 +00:00
|
|
|
import com.android.inputmethod.latin.LatinIME;
|
2011-12-15 05:45:14 +00:00
|
|
|
import com.android.inputmethod.latin.LatinImeLogger;
|
2011-12-13 08:30:51 +00:00
|
|
|
import com.android.inputmethod.latin.LocaleUtils;
|
2011-12-12 07:11:37 +00:00
|
|
|
import com.android.inputmethod.latin.R;
|
|
|
|
import com.android.inputmethod.latin.Utils;
|
2011-12-18 10:54:08 +00:00
|
|
|
import com.android.inputmethod.latin.XmlParseUtils;
|
2011-12-12 07:11:37 +00:00
|
|
|
|
2011-12-13 08:30:51 +00:00
|
|
|
import org.xmlpull.v1.XmlPullParser;
|
|
|
|
import org.xmlpull.v1.XmlPullParserException;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
2011-12-15 05:45:14 +00:00
|
|
|
import java.lang.ref.SoftReference;
|
2011-12-13 08:30:51 +00:00
|
|
|
import java.util.HashMap;
|
2011-12-12 07:11:37 +00:00
|
|
|
import java.util.Locale;
|
2012-01-24 09:03:50 +00:00
|
|
|
import java.util.Map;
|
2011-12-12 07:11:37 +00:00
|
|
|
|
|
|
|
/**
|
2011-12-15 05:45:14 +00:00
|
|
|
* This class represents a set of keyboards. Each of them represents a different keyboard
|
|
|
|
* specific to a keyboard state, such as alphabet, symbols, and so on. Layouts in the same
|
|
|
|
* {@link KeyboardSet} are related to each other.
|
|
|
|
* A {@link KeyboardSet} needs to be created for each {@link android.view.inputmethod.EditorInfo}.
|
2011-12-12 07:11:37 +00:00
|
|
|
*/
|
|
|
|
public class KeyboardSet {
|
2011-12-15 05:45:14 +00:00
|
|
|
private static final String TAG = KeyboardSet.class.getSimpleName();
|
|
|
|
private static final boolean DEBUG_CACHE = LatinImeLogger.sDBG;
|
2011-12-13 08:30:51 +00:00
|
|
|
|
2011-12-15 05:45:14 +00:00
|
|
|
private static final String TAG_KEYBOARD_SET = TAG;
|
|
|
|
private static final String TAG_ELEMENT = "Element";
|
2011-12-12 07:11:37 +00:00
|
|
|
|
2011-12-15 05:45:14 +00:00
|
|
|
private final Context mContext;
|
|
|
|
private final Params mParams;
|
2012-01-25 10:43:13 +00:00
|
|
|
private final KeysCache mKeysCache = new KeysCache();
|
|
|
|
|
2012-01-31 08:15:24 +00:00
|
|
|
public static class KeyboardSetException extends RuntimeException {
|
|
|
|
public final KeyboardId mKeyboardId;
|
|
|
|
public KeyboardSetException(Throwable cause, KeyboardId keyboardId) {
|
|
|
|
super(cause);
|
|
|
|
mKeyboardId = keyboardId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-25 10:43:13 +00:00
|
|
|
public static class KeysCache {
|
|
|
|
private final Map<Key, Key> mMap;
|
|
|
|
|
|
|
|
public KeysCache() {
|
|
|
|
mMap = new HashMap<Key, Key>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Key get(Key key) {
|
|
|
|
final Key existingKey = mMap.get(key);
|
|
|
|
if (existingKey != null) {
|
|
|
|
// Reuse the existing element that equals to "key" without adding "key" to the map.
|
|
|
|
return existingKey;
|
|
|
|
}
|
|
|
|
mMap.put(key, key);
|
|
|
|
return key;
|
|
|
|
}
|
|
|
|
}
|
2011-12-16 07:22:20 +00:00
|
|
|
|
2012-01-24 09:03:50 +00:00
|
|
|
static class Params {
|
2011-12-16 07:22:20 +00:00
|
|
|
int mMode;
|
2011-12-15 05:45:14 +00:00
|
|
|
int mInputType;
|
2011-12-16 07:22:20 +00:00
|
|
|
int mImeOptions;
|
2012-01-13 07:14:02 +00:00
|
|
|
boolean mTouchPositionCorrectionEnabled;
|
2011-12-16 07:22:20 +00:00
|
|
|
boolean mSettingsKeyEnabled;
|
|
|
|
boolean mVoiceKeyEnabled;
|
|
|
|
boolean mVoiceKeyOnMain;
|
|
|
|
boolean mNoSettingsKey;
|
|
|
|
Locale mLocale;
|
|
|
|
int mOrientation;
|
|
|
|
int mWidth;
|
2012-01-26 09:03:30 +00:00
|
|
|
// KeyboardSet element id to keyboard layout XML id map.
|
|
|
|
final Map<Integer, Integer> mKeyboardSetElementIdToXmlIdMap =
|
|
|
|
new HashMap<Integer, Integer>();
|
2011-12-16 07:22:20 +00:00
|
|
|
Params() {}
|
2011-12-12 07:11:37 +00:00
|
|
|
}
|
|
|
|
|
2011-12-17 23:36:16 +00:00
|
|
|
private static final HashMap<KeyboardId, SoftReference<Keyboard>> sKeyboardCache =
|
|
|
|
new HashMap<KeyboardId, SoftReference<Keyboard>>();
|
2011-12-15 05:45:14 +00:00
|
|
|
|
|
|
|
public static void clearKeyboardCache() {
|
|
|
|
sKeyboardCache.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
private KeyboardSet(Context context, Params params) {
|
|
|
|
mContext = context;
|
|
|
|
mParams = params;
|
|
|
|
}
|
|
|
|
|
2012-01-26 09:03:30 +00:00
|
|
|
public Keyboard getKeyboard(int baseKeyboardSetElementId) {
|
|
|
|
final int keyboardSetElementId;
|
|
|
|
switch (mParams.mMode) {
|
|
|
|
case KeyboardId.MODE_PHONE:
|
|
|
|
keyboardSetElementId =
|
|
|
|
(baseKeyboardSetElementId == KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED)
|
|
|
|
? KeyboardId.ELEMENT_PHONE_SHIFTED : KeyboardId.ELEMENT_PHONE;
|
|
|
|
break;
|
|
|
|
case KeyboardId.MODE_NUMBER:
|
|
|
|
keyboardSetElementId = KeyboardId.ELEMENT_NUMBER;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
keyboardSetElementId = baseKeyboardSetElementId;
|
|
|
|
break;
|
|
|
|
}
|
2011-12-15 05:45:14 +00:00
|
|
|
|
2012-01-26 09:03:30 +00:00
|
|
|
Integer keyboardXmlId = mParams.mKeyboardSetElementIdToXmlIdMap.get(keyboardSetElementId);
|
|
|
|
if (keyboardXmlId == null) {
|
|
|
|
keyboardXmlId = mParams.mKeyboardSetElementIdToXmlIdMap.get(
|
|
|
|
KeyboardId.ELEMENT_ALPHABET);
|
|
|
|
}
|
|
|
|
final KeyboardId id = getKeyboardId(keyboardSetElementId);
|
2012-01-31 08:15:24 +00:00
|
|
|
try {
|
|
|
|
return getKeyboard(mContext, keyboardXmlId, id);
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
throw new KeyboardSetException(e, id);
|
|
|
|
}
|
2011-12-15 05:45:14 +00:00
|
|
|
}
|
|
|
|
|
2012-01-26 09:03:30 +00:00
|
|
|
private Keyboard getKeyboard(Context context, int keyboardXmlId, KeyboardId id) {
|
2011-12-15 05:45:14 +00:00
|
|
|
final Resources res = context.getResources();
|
2011-12-17 23:36:16 +00:00
|
|
|
final SoftReference<Keyboard> ref = sKeyboardCache.get(id);
|
|
|
|
Keyboard keyboard = (ref == null) ? null : ref.get();
|
2011-12-15 05:45:14 +00:00
|
|
|
if (keyboard == null) {
|
|
|
|
final Locale savedLocale = LocaleUtils.setSystemLocale(res, id.mLocale);
|
|
|
|
try {
|
2011-12-18 10:54:08 +00:00
|
|
|
final Keyboard.Builder<Keyboard.Params> builder =
|
|
|
|
new Keyboard.Builder<Keyboard.Params>(context, new Keyboard.Params());
|
2012-01-26 09:03:30 +00:00
|
|
|
if (id.isAlphabetKeyboard()) {
|
2012-01-25 10:43:13 +00:00
|
|
|
builder.setAutoGenerate(mKeysCache);
|
|
|
|
}
|
2012-01-26 09:03:30 +00:00
|
|
|
builder.load(keyboardXmlId, id);
|
2012-01-13 07:14:02 +00:00
|
|
|
builder.setTouchPositionCorrectionEnabled(mParams.mTouchPositionCorrectionEnabled);
|
2011-12-15 05:45:14 +00:00
|
|
|
keyboard = builder.build();
|
|
|
|
} finally {
|
|
|
|
LocaleUtils.setSystemLocale(res, savedLocale);
|
|
|
|
}
|
2011-12-17 23:36:16 +00:00
|
|
|
sKeyboardCache.put(id, new SoftReference<Keyboard>(keyboard));
|
2011-12-15 05:45:14 +00:00
|
|
|
|
|
|
|
if (DEBUG_CACHE) {
|
|
|
|
Log.d(TAG, "keyboard cache size=" + sKeyboardCache.size() + ": "
|
|
|
|
+ ((ref == null) ? "LOAD" : "GCed") + " id=" + id);
|
|
|
|
}
|
|
|
|
} else if (DEBUG_CACHE) {
|
|
|
|
Log.d(TAG, "keyboard cache size=" + sKeyboardCache.size() + ": HIT id=" + id);
|
|
|
|
}
|
|
|
|
|
|
|
|
return keyboard;
|
|
|
|
}
|
|
|
|
|
2012-01-26 09:03:30 +00:00
|
|
|
// Note: The keyboard for each locale, shift state, and mode are represented as KeyboardSet
|
|
|
|
// element id that is a key in keyboard_set.xml. Also that file specifies which XML layout
|
|
|
|
// should be used for each keyboard. The KeyboardId is an internal key for Keyboard object.
|
2012-01-31 08:15:24 +00:00
|
|
|
private KeyboardId getKeyboardId(int keyboardSetElementId) {
|
2012-01-26 09:03:30 +00:00
|
|
|
final Params params = mParams;
|
|
|
|
final boolean isSymbols = (keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS
|
|
|
|
|| keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED);
|
2012-01-24 09:03:50 +00:00
|
|
|
final boolean hasShortcutKey = params.mVoiceKeyEnabled
|
|
|
|
&& (isSymbols != params.mVoiceKeyOnMain);
|
2012-01-26 09:03:30 +00:00
|
|
|
return new KeyboardId(keyboardSetElementId, params.mLocale, params.mOrientation,
|
|
|
|
params.mWidth, params.mMode, params.mInputType, params.mImeOptions,
|
|
|
|
params.mSettingsKeyEnabled, params.mNoSettingsKey, params.mVoiceKeyEnabled,
|
|
|
|
hasShortcutKey);
|
2012-01-24 09:03:50 +00:00
|
|
|
}
|
|
|
|
|
2011-12-12 07:11:37 +00:00
|
|
|
public static class Builder {
|
2011-12-15 05:45:14 +00:00
|
|
|
private final Context mContext;
|
2012-01-13 07:14:02 +00:00
|
|
|
private final String mPackageName;
|
2011-12-12 07:11:37 +00:00
|
|
|
private final Resources mResources;
|
2012-01-13 07:14:02 +00:00
|
|
|
private final EditorInfo mEditorInfo;
|
2011-12-12 07:11:37 +00:00
|
|
|
|
2011-12-16 07:22:20 +00:00
|
|
|
private final Params mParams = new Params();
|
2011-12-12 07:11:37 +00:00
|
|
|
|
2012-01-13 07:14:02 +00:00
|
|
|
public Builder(Context context, EditorInfo editorInfo) {
|
2011-12-15 05:45:14 +00:00
|
|
|
mContext = context;
|
2012-01-13 07:14:02 +00:00
|
|
|
mPackageName = context.getPackageName();
|
2011-12-12 07:11:37 +00:00
|
|
|
mResources = context.getResources();
|
2012-01-13 07:14:02 +00:00
|
|
|
mEditorInfo = editorInfo;
|
2011-12-16 07:22:20 +00:00
|
|
|
final Params params = mParams;
|
2011-12-12 07:11:37 +00:00
|
|
|
|
2011-12-16 07:22:20 +00:00
|
|
|
params.mMode = Utils.getKeyboardMode(editorInfo);
|
|
|
|
if (editorInfo != null) {
|
2011-12-15 05:45:14 +00:00
|
|
|
params.mInputType = editorInfo.inputType;
|
2011-12-16 07:22:20 +00:00
|
|
|
params.mImeOptions = editorInfo.imeOptions;
|
|
|
|
}
|
2012-01-13 07:14:02 +00:00
|
|
|
params.mNoSettingsKey = Utils.inPrivateImeOptions(
|
|
|
|
mPackageName, LatinIME.IME_OPTION_NO_SETTINGS_KEY, mEditorInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Builder setScreenGeometry(int orientation, int widthPixels) {
|
|
|
|
mParams.mOrientation = orientation;
|
|
|
|
mParams.mWidth = widthPixels;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Use InputMethodSubtype object as argument.
|
|
|
|
public Builder setSubtype(Locale inputLocale, boolean asciiCapable,
|
|
|
|
boolean touchPositionCorrectionEnabled) {
|
2012-01-25 11:54:00 +00:00
|
|
|
final boolean deprecatedForceAscii = Utils.inPrivateImeOptions(
|
|
|
|
mPackageName, LatinIME.IME_OPTION_FORCE_ASCII, mEditorInfo);
|
2012-01-17 05:38:00 +00:00
|
|
|
final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii(mParams.mImeOptions)
|
2012-01-25 11:54:00 +00:00
|
|
|
|| deprecatedForceAscii;
|
2012-01-13 07:14:02 +00:00
|
|
|
mParams.mLocale = (forceAscii && !asciiCapable) ? Locale.US : inputLocale;
|
|
|
|
mParams.mTouchPositionCorrectionEnabled = touchPositionCorrectionEnabled;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Builder setOptions(boolean settingsKeyEnabled, boolean voiceKeyEnabled,
|
|
|
|
boolean voiceKeyOnMain) {
|
|
|
|
mParams.mSettingsKeyEnabled = settingsKeyEnabled;
|
2011-12-12 07:11:37 +00:00
|
|
|
@SuppressWarnings("deprecation")
|
2012-01-25 11:54:00 +00:00
|
|
|
final boolean deprecatedNoMicrophone = Utils.inPrivateImeOptions(
|
|
|
|
null, LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, mEditorInfo);
|
2011-12-12 07:11:37 +00:00
|
|
|
final boolean noMicrophone = Utils.inPrivateImeOptions(
|
2012-01-13 07:14:02 +00:00
|
|
|
mPackageName, LatinIME.IME_OPTION_NO_MICROPHONE, mEditorInfo)
|
2012-01-25 11:54:00 +00:00
|
|
|
|| deprecatedNoMicrophone;
|
2012-01-13 07:14:02 +00:00
|
|
|
mParams.mVoiceKeyEnabled = voiceKeyEnabled && !noMicrophone;
|
|
|
|
mParams.mVoiceKeyOnMain = voiceKeyOnMain;
|
|
|
|
return this;
|
2011-12-12 07:11:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public KeyboardSet build() {
|
2012-01-13 07:14:02 +00:00
|
|
|
if (mParams.mOrientation == Configuration.ORIENTATION_UNDEFINED)
|
|
|
|
throw new RuntimeException("Screen geometry is not specified");
|
|
|
|
if (mParams.mLocale == null)
|
|
|
|
throw new RuntimeException("KeyboardSet subtype is not specified");
|
|
|
|
|
2011-12-16 07:22:20 +00:00
|
|
|
final Locale savedLocale = LocaleUtils.setSystemLocale(mResources, mParams.mLocale);
|
2011-12-13 08:30:51 +00:00
|
|
|
try {
|
|
|
|
parseKeyboardSet(mResources, R.xml.keyboard_set);
|
|
|
|
} catch (Exception e) {
|
2012-01-24 09:03:50 +00:00
|
|
|
throw new RuntimeException(e.getMessage() + " in "
|
|
|
|
+ mResources.getResourceName(R.xml.keyboard_set)
|
|
|
|
+ " of locale " + mParams.mLocale);
|
2011-12-13 08:30:51 +00:00
|
|
|
} finally {
|
|
|
|
LocaleUtils.setSystemLocale(mResources, savedLocale);
|
|
|
|
}
|
2011-12-15 05:45:14 +00:00
|
|
|
return new KeyboardSet(mContext, mParams);
|
2011-12-12 07:11:37 +00:00
|
|
|
}
|
|
|
|
|
2011-12-13 08:30:51 +00:00
|
|
|
private void parseKeyboardSet(Resources res, int resId) throws XmlPullParserException,
|
|
|
|
IOException {
|
|
|
|
final XmlResourceParser parser = res.getXml(resId);
|
|
|
|
try {
|
|
|
|
int event;
|
|
|
|
while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) {
|
|
|
|
if (event == XmlPullParser.START_TAG) {
|
|
|
|
final String tag = parser.getName();
|
|
|
|
if (TAG_KEYBOARD_SET.equals(tag)) {
|
|
|
|
parseKeyboardSetContent(parser);
|
|
|
|
} else {
|
2011-12-14 09:11:27 +00:00
|
|
|
throw new XmlParseUtils.IllegalStartTag(parser, TAG_KEYBOARD_SET);
|
2011-12-13 08:30:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
parser.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void parseKeyboardSetContent(XmlPullParser parser) throws XmlPullParserException,
|
|
|
|
IOException {
|
|
|
|
int event;
|
|
|
|
while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) {
|
|
|
|
if (event == XmlPullParser.START_TAG) {
|
|
|
|
final String tag = parser.getName();
|
|
|
|
if (TAG_ELEMENT.equals(tag)) {
|
|
|
|
parseKeyboardSetElement(parser);
|
|
|
|
} else {
|
2011-12-14 09:11:27 +00:00
|
|
|
throw new XmlParseUtils.IllegalStartTag(parser, TAG_KEYBOARD_SET);
|
2011-12-13 08:30:51 +00:00
|
|
|
}
|
|
|
|
} else if (event == XmlPullParser.END_TAG) {
|
|
|
|
final String tag = parser.getName();
|
|
|
|
if (TAG_KEYBOARD_SET.equals(tag)) {
|
|
|
|
break;
|
|
|
|
} else {
|
2011-12-14 09:11:27 +00:00
|
|
|
throw new XmlParseUtils.IllegalEndTag(parser, TAG_KEYBOARD_SET);
|
2011-12-13 08:30:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void parseKeyboardSetElement(XmlPullParser parser) throws XmlPullParserException,
|
|
|
|
IOException {
|
|
|
|
final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
|
|
|
|
R.styleable.KeyboardSet_Element);
|
|
|
|
try {
|
2011-12-14 09:11:27 +00:00
|
|
|
XmlParseUtils.checkAttributeExists(a,
|
|
|
|
R.styleable.KeyboardSet_Element_elementName, "elementName",
|
|
|
|
TAG_ELEMENT, parser);
|
|
|
|
XmlParseUtils.checkAttributeExists(a,
|
|
|
|
R.styleable.KeyboardSet_Element_elementKeyboard, "elementKeyboard",
|
|
|
|
TAG_ELEMENT, parser);
|
|
|
|
XmlParseUtils.checkEndTag(TAG_ELEMENT, parser);
|
2011-12-13 08:30:51 +00:00
|
|
|
|
|
|
|
final int elementName = a.getInt(
|
|
|
|
R.styleable.KeyboardSet_Element_elementName, 0);
|
2012-01-24 23:20:05 +00:00
|
|
|
final int elementKeyboard = a.getResourceId(
|
|
|
|
R.styleable.KeyboardSet_Element_elementKeyboard, 0);
|
2012-01-26 09:03:30 +00:00
|
|
|
mParams.mKeyboardSetElementIdToXmlIdMap.put(elementName, elementKeyboard);
|
2011-12-13 08:30:51 +00:00
|
|
|
} finally {
|
|
|
|
a.recycle();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String parseKeyboardLocale(Resources res, int resId)
|
|
|
|
throws XmlPullParserException, IOException {
|
|
|
|
final XmlPullParser parser = res.getXml(resId);
|
2011-12-16 07:22:20 +00:00
|
|
|
if (parser == null)
|
|
|
|
return "";
|
2011-12-13 08:30:51 +00:00
|
|
|
int event;
|
|
|
|
while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) {
|
|
|
|
if (event == XmlPullParser.START_TAG) {
|
|
|
|
final String tag = parser.getName();
|
|
|
|
if (TAG_KEYBOARD_SET.equals(tag)) {
|
|
|
|
final TypedArray keyboardSetAttr = res.obtainAttributes(
|
|
|
|
Xml.asAttributeSet(parser), R.styleable.KeyboardSet);
|
|
|
|
final String locale = keyboardSetAttr.getString(
|
|
|
|
R.styleable.KeyboardSet_keyboardLocale);
|
|
|
|
keyboardSetAttr.recycle();
|
|
|
|
return locale;
|
|
|
|
} else {
|
2011-12-14 09:11:27 +00:00
|
|
|
throw new XmlParseUtils.IllegalStartTag(parser, TAG_KEYBOARD_SET);
|
2011-12-13 08:30:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "";
|
2011-12-12 07:11:37 +00:00
|
|
|
}
|
|
|
|
}
|