diff options
author | 2014-06-06 01:41:42 +0900 | |
---|---|---|
committer | 2014-06-06 13:11:57 +0900 | |
commit | 3ca65c8fd56724a7b4b3440bccf613e5a1a17513 (patch) | |
tree | 291d203dd66334b55d5366e08ae14565deaa325e /java/src/com/android/inputmethod/latin/InputAttributes.java | |
parent | b7206b6bcaf73640dd25b00898f5edd1b3edb762 (diff) | |
download | latinime-3ca65c8fd56724a7b4b3440bccf613e5a1a17513.tar.gz latinime-3ca65c8fd56724a7b4b3440bccf613e5a1a17513.tar.xz latinime-3ca65c8fd56724a7b4b3440bccf613e5a1a17513.zip |
Remove unused supportsSwitchingToShortcutIme attribute
Change-Id: I51c5247ac925a158facb79057f704b763b903552
Diffstat (limited to 'java/src/com/android/inputmethod/latin/InputAttributes.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/InputAttributes.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index 378acb3fa..e1ae3dfe3 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -16,6 +16,9 @@ package com.android.inputmethod.latin; +import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE; +import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE_COMPAT; + import android.text.InputType; import android.util.Log; import android.view.inputmethod.EditorInfo; @@ -39,8 +42,13 @@ public final class InputAttributes { final public boolean mApplicationSpecifiedCompletionOn; final public boolean mShouldInsertSpacesAutomatically; final private int mInputType; + final private EditorInfo mEditorInfo; + final private String mPackageNameForPrivateImeOptions; - public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode) { + public InputAttributes(final EditorInfo editorInfo, final boolean isFullscreenMode, + final String packageNameForPrivateImeOptions) { + mEditorInfo = editorInfo; + mPackageNameForPrivateImeOptions = packageNameForPrivateImeOptions; mTargetApplicationPackageName = null != editorInfo ? editorInfo.packageName : null; final int inputType = null != editorInfo ? editorInfo.inputType : 0; final int inputClass = inputType & InputType.TYPE_MASK_CLASS; @@ -111,6 +119,15 @@ public final class InputAttributes { return editorInfo.inputType == mInputType; } + public boolean hasNoMicrophoneKeyOption() { + @SuppressWarnings("deprecation") + final boolean deprecatedNoMicrophone = InputAttributes.inPrivateImeOptions( + null, NO_MICROPHONE_COMPAT, mEditorInfo); + final boolean noMicrophone = InputAttributes.inPrivateImeOptions( + mPackageNameForPrivateImeOptions, NO_MICROPHONE, mEditorInfo); + return noMicrophone || deprecatedNoMicrophone; + } + @SuppressWarnings("unused") private void dumpFlags(final int inputType) { final int inputClass = inputType & InputType.TYPE_MASK_CLASS; |