aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-06-06 12:51:42 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-06-07 19:09:44 +0900
commit77f63c8ac64c46de36002fd62c71f1eeebcaf2ac (patch)
treeda8c09dd3e61b19ba169ba52121fb255eae33a79 /java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java
parentb0e0c5a8445afc814ed8865c4f4b9f61ada909a9 (diff)
downloadlatinime-77f63c8ac64c46de36002fd62c71f1eeebcaf2ac.tar.gz
latinime-77f63c8ac64c46de36002fd62c71f1eeebcaf2ac.tar.xz
latinime-77f63c8ac64c46de36002fd62c71f1eeebcaf2ac.zip
Don't use RichInputMethodManager in setup wizard
In setup wizard, InputMethodManager may not be able to be aware that this IME is installed, especially just after the IME is installed via GooglePlay app and hit the open button on the app to launch the setup wizard. Bug: 9299618 Change-Id: I00c8544178b41074253d49ae9481996ec56593d2
Diffstat (limited to 'java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java')
-rw-r--r--java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java b/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java
index 604ebeeb6..63d2fecd3 100644
--- a/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java
+++ b/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java
@@ -25,9 +25,9 @@ import android.content.pm.PackageManager;
import android.os.Process;
import android.preference.PreferenceManager;
import android.util.Log;
+import android.view.inputmethod.InputMethodManager;
import com.android.inputmethod.compat.IntentCompatUtils;
-import com.android.inputmethod.latin.RichInputMethodManager;
import com.android.inputmethod.latin.Settings;
/**
@@ -65,17 +65,16 @@ public final class LauncherIconVisibilityManager extends BroadcastReceiver {
}
// The process that hosts this broadcast receiver is invoked and remains alive even after
- // 1) the package has been re-installed, 2) the device has been booted,
- // 3) a multiuser has been created.
+ // 1) the package has been re-installed, 2) the device has just booted,
+ // 3) a new user has been created.
// There is no good reason to keep the process alive if this IME isn't a current IME.
- final boolean isCurrentImeOfCurrentUser;
- if (RichInputMethodManager.isInputMethodManagerValidForUserOfThisProcess(context)) {
- RichInputMethodManager.init(context);
- isCurrentImeOfCurrentUser = SetupActivity.isThisImeCurrent(context);
- } else {
- isCurrentImeOfCurrentUser = false;
- }
-
+ final InputMethodManager imm =
+ (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
+ // Called to check whether this IME has been triggered by the current user or not
+ final boolean isInputMethodManagerValidForUserOfThisProcess =
+ !imm.getInputMethodList().isEmpty();
+ final boolean isCurrentImeOfCurrentUser = isInputMethodManagerValidForUserOfThisProcess
+ && SetupActivity.isThisImeCurrent(context, imm);
if (!isCurrentImeOfCurrentUser) {
final int myPid = Process.myPid();
Log.i(TAG, "Killing my process: pid=" + myPid);