summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/inputmethod
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-08-15 15:36:44 +0900
committersatok <satok@google.com>2013-08-15 16:11:41 +0900
commit69da2690e5a990987adba8f68dcf3d8a17d1a0fc (patch)
tree85107d02a303074d5bcf1fdaf14ede0f7b7ab51c /core/java/android/view/inputmethod
parent70e907f51f75bf8d481e11e0d6411e2974b83b06 (diff)
downloadframeworks_base-69da2690e5a990987adba8f68dcf3d8a17d1a0fc.zip
frameworks_base-69da2690e5a990987adba8f68dcf3d8a17d1a0fc.tar.gz
frameworks_base-69da2690e5a990987adba8f68dcf3d8a17d1a0fc.tar.bz2
Add an API supportsSwitchingToNextInput
To let the system know an IME supports switching to a next input method Bug: 8364845 Change-Id: Iabf4f106893ee6a262ad0cd44dbec0c661bf0ff2
Diffstat (limited to 'core/java/android/view/inputmethod')
-rw-r--r--core/java/android/view/inputmethod/InputMethodInfo.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java
index feaab3e..c440c7b 100644
--- a/core/java/android/view/inputmethod/InputMethodInfo.java
+++ b/core/java/android/view/inputmethod/InputMethodInfo.java
@@ -82,11 +82,16 @@ public final class InputMethodInfo implements Parcelable {
private final boolean mIsAuxIme;
/**
- * Cavert: mForceDefault must be false for production. This flag is only for test.
+ * Caveat: mForceDefault must be false for production. This flag is only for test.
*/
private final boolean mForceDefault;
/**
+ * The flag whether this IME supports ways to switch to a next input method (e.g. globe key.)
+ */
+ private final boolean mSupportsSwitchingToNextInputMethod;
+
+ /**
* Constructor.
*
* @param context The Context in which we are parsing the input method.
@@ -114,6 +119,7 @@ public final class InputMethodInfo implements Parcelable {
ServiceInfo si = service.serviceInfo;
mId = new ComponentName(si.packageName, si.name).flattenToShortString();
boolean isAuxIme = true;
+ boolean supportsSwitchingToNextInputMethod = false; // false as default
mForceDefault = false;
PackageManager pm = context.getPackageManager();
@@ -149,6 +155,9 @@ public final class InputMethodInfo implements Parcelable {
com.android.internal.R.styleable.InputMethod_settingsActivity);
isDefaultResId = sa.getResourceId(
com.android.internal.R.styleable.InputMethod_isDefault, 0);
+ supportsSwitchingToNextInputMethod = sa.getBoolean(
+ com.android.internal.R.styleable.InputMethod_supportsSwitchingToNextInputMethod,
+ false);
sa.recycle();
final int depth = parser.getDepth();
@@ -216,6 +225,7 @@ public final class InputMethodInfo implements Parcelable {
mSettingsActivityName = settingsActivityComponent;
mIsDefaultResId = isDefaultResId;
mIsAuxIme = isAuxIme;
+ mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod;
}
InputMethodInfo(Parcel source) {
@@ -223,6 +233,7 @@ public final class InputMethodInfo implements Parcelable {
mSettingsActivityName = source.readString();
mIsDefaultResId = source.readInt();
mIsAuxIme = source.readInt() == 1;
+ mSupportsSwitchingToNextInputMethod = source.readInt() == 1;
mService = ResolveInfo.CREATOR.createFromParcel(source);
source.readTypedList(mSubtypes, InputMethodSubtype.CREATOR);
mForceDefault = false;
@@ -254,6 +265,7 @@ public final class InputMethodInfo implements Parcelable {
mSubtypes.addAll(subtypes);
}
mForceDefault = forceDefault;
+ mSupportsSwitchingToNextInputMethod = true;
}
private static ResolveInfo buildDummyResolveInfo(String packageName, String className,
@@ -435,6 +447,14 @@ public final class InputMethodInfo implements Parcelable {
}
/**
+ * @return true if this input method supports ways to switch to a next input method.
+ * @hide
+ */
+ public boolean supportsSwitchingToNextInputMethod() {
+ return mSupportsSwitchingToNextInputMethod;
+ }
+
+ /**
* Used to package this object into a {@link Parcel}.
*
* @param dest The {@link Parcel} to be written.
@@ -446,6 +466,7 @@ public final class InputMethodInfo implements Parcelable {
dest.writeString(mSettingsActivityName);
dest.writeInt(mIsDefaultResId);
dest.writeInt(mIsAuxIme ? 1 : 0);
+ dest.writeInt(mSupportsSwitchingToNextInputMethod ? 1 : 0);
mService.writeToParcel(dest, flags);
dest.writeTypedList(mSubtypes);
}