diff options
author | satok <satok@google.com> | 2010-12-20 17:59:19 +0900 |
---|---|---|
committer | satok <satok@google.com> | 2010-12-20 20:45:22 +0900 |
commit | b70c82dc45f62a1c257a80e7aa9e0ecfe063c1be (patch) | |
tree | 23e31d986d9a123fd37b2b54f2cd1e257514a324 /packages | |
parent | d57896a64c87f8c068bb19157f41b338be209089 (diff) | |
download | frameworks_base-b70c82dc45f62a1c257a80e7aa9e0ecfe063c1be.zip frameworks_base-b70c82dc45f62a1c257a80e7aa9e0ecfe063c1be.tar.gz frameworks_base-b70c82dc45f62a1c257a80e7aa9e0ecfe063c1be.tar.bz2 |
Hide IME Switch Button when a handset is locked.
Bug: 3247192
Change-Id: I61a327b480c5b3055a14219050cebb04cf0adf6e
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java | 22 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java index a09fe28..2d6ae0d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java @@ -61,14 +61,14 @@ public class InputMethodButton extends ImageView { new HashMap<String, InputMethodInfo>(); private ImageView mIcon; private IBinder mToken; - private boolean mKeyboardShown; + private boolean mKeyboardVisible = false; + private boolean mScreenLocked = false; private InputMethodInfo mShortcutInfo; private InputMethodSubtype mShortcutSubtype; public InputMethodButton(Context context, AttributeSet attrs) { super(context, attrs); - mKeyboardShown = false; // Resource Id of the input method button. This id is defined in status_bar.xml mId = getId(); // IME hookup @@ -99,7 +99,7 @@ public class InputMethodButton extends ImageView { protected void onAttachedToWindow() { mIcon = (ImageView) findViewById(mId); - refreshStatusIcon(mKeyboardShown); + refreshStatusIcon(); } private InputMethodInfo getCurrentInputMethodInfo() { @@ -167,6 +167,7 @@ public class InputMethodButton extends ImageView { // * There are no explicitly enabled (by the user) subtypes of the IME, or the IME doesn't have // its subtypes at all private boolean needsToShowIMEButton() { + if (!mKeyboardVisible || mScreenLocked) return false; List<InputMethodInfo> imis = mImm.getEnabledInputMethodList(); final int size = imis.size(); final int visibility = loadInputMethodSelectorVisibility(); @@ -182,8 +183,8 @@ public class InputMethodButton extends ImageView { return false; } - private void refreshStatusIcon(boolean keyboardShown) { - if (!keyboardShown) { + private void refreshStatusIcon() { + if (!needsToShowIMEButton()) { setVisibility(View.INVISIBLE); return; } else { @@ -215,9 +216,14 @@ public class InputMethodButton extends ImageView { Settings.Secure.INPUT_METHOD_SELECTOR_VISIBILITY, ID_IME_BUTTON_VISIBILITY_AUTO); } - public void setIMEButtonVisible(IBinder token, boolean visible) { + public void setIMEButtonVisible(IBinder token, boolean keyboardVisible) { mToken = token; - mKeyboardShown = visible ? needsToShowIMEButton() : false; - refreshStatusIcon(mKeyboardShown); + mKeyboardVisible = keyboardVisible; + refreshStatusIcon(); + } + + public void setScreenLocked(boolean locked) { + mScreenLocked = locked; + refreshStatusIcon(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 3201f8b..03e33fa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -692,9 +692,11 @@ public class TabletStatusBar extends StatusBar { if ((state & StatusBarManager.DISABLE_NAVIGATION) != 0) { Slog.d(TAG, "DISABLE_NAVIGATION: yes"); mNavigationArea.setVisibility(View.GONE); + mInputMethodSwitchButton.setScreenLocked(true); } else { Slog.d(TAG, "DISABLE_NAVIGATION: no"); mNavigationArea.setVisibility(View.VISIBLE); + mInputMethodSwitchButton.setScreenLocked(false); } } } |