summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/CryptKeeper.java
diff options
context:
space:
mode:
authorJason parks <jparks@google.com>2011-02-10 14:03:47 -0600
committerJason parks <jparks@google.com>2011-02-10 14:37:45 -0600
commit75c085ee890744cdd4b90c72f8b50e6aeeb31e88 (patch)
treead351fdcabaa62ff4f24544377b1ac6a7444d402 /src/com/android/settings/CryptKeeper.java
parenta01538b0ae0f561ed850f49a8dec7bb01b7687d2 (diff)
downloadpackages_apps_settings-75c085ee890744cdd4b90c72f8b50e6aeeb31e88.zip
packages_apps_settings-75c085ee890744cdd4b90c72f8b50e6aeeb31e88.tar.gz
packages_apps_settings-75c085ee890744cdd4b90c72f8b50e6aeeb31e88.tar.bz2
There can only be one.............................
KEYBOARD! Bug: 3413847 Change-Id: I3d427f449c6cdbad0770f087d1139dc94be50e80
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r--src/com/android/settings/CryptKeeper.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 3d752a3..0374ba6 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -25,6 +25,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.graphics.Rect;
import android.inputmethodservice.KeyboardView;
import android.os.Bundle;
import android.os.Handler;
@@ -35,11 +36,14 @@ import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.storage.IMountService;
import android.text.TextUtils;
+import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
+import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
@@ -80,6 +84,38 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
}
}
+ // Use a custom EditText to prevent the input method from showing.
+ public static class CryptEditText extends EditText {
+ InputMethodManager imm;
+
+ public CryptEditText(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ imm = ((InputMethodManager) getContext().
+ getSystemService(Context.INPUT_METHOD_SERVICE));
+ }
+
+ @Override
+ protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
+ super.onFocusChanged(focused, direction, previouslyFocusedRect);
+
+ if (focused && imm != null && imm.isActive(this)) {
+ imm.hideSoftInputFromWindow(getApplicationWindowToken(), 0);
+ }
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ boolean handled = super.onTouchEvent(event);
+
+ if (imm != null && imm.isActive(this)) {
+ imm.hideSoftInputFromWindow(getApplicationWindowToken(), 0);
+ }
+
+ return handled;
+ }
+ }
+
+
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {