am 9ded8208: am 1a63d067: am ab1b372c: Merge "Change \'disable hardware keyboard\' to \'show input method\'" into lmp-dev

* commit '9ded8208c438eca14d3ed8ad16b819f6688f1267':
  Change 'disable hardware keyboard' to 'show input method'
This commit is contained in:
Michael Wright
2014-08-18 03:40:37 +00:00
committed by Android Git Automerger
11 changed files with 34 additions and 83 deletions

View File

@@ -32,7 +32,6 @@ oneway interface IStatusBar
void topAppWindowChanged(boolean menuVisible);
void setImeWindowStatus(in IBinder token, int vis, int backDisposition,
boolean showImeSwitcher);
void setHardKeyboardStatus(boolean available, boolean enabled);
void setWindowState(int window, int state);
void buzzBeepBlinked();
void notificationLightOff();

View File

@@ -51,7 +51,6 @@ interface IStatusBarService
in String[] newlyVisibleKeys, in String[] noLongerVisibleKeys);
void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded);
void setSystemUiVisibility(int vis, int mask);
void setHardKeyboardEnabled(boolean enabled);
void setWindowState(int window, int state);
void showRecentApps(boolean triggeredFromAltTab);

View File

@@ -80,7 +80,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/use_physical_keyboard"
android:text="@string/show_ime"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorAlertDialogListItem" />
</LinearLayout>

View File

@@ -3783,8 +3783,9 @@
<string name="select_input_method">Change keyboard</string>
<!-- Title of a button to open the settings to enable or disable keyboards, also known as input methods [CHAR LIMIT=30] -->
<string name="configure_input_methods">Choose keyboards</string>
<!-- Summary text of a toggle switch to enable/disable use of the physical keyboard in the input method selector [CHAR LIMIT=25] -->
<string name="use_physical_keyboard">Physical keyboard</string>
<!-- Summary text of a toggle switch to enable/disable use of the IME while a physical
keyboard is connected[CHAR LIMIT=25] -->
<string name="show_ime">Show input method</string>
<!-- Title of the physical keyboard category in the input method selector [CHAR LIMIT=10] -->
<string name="hardware">Hardware</string>

View File

@@ -457,8 +457,7 @@ public abstract class BaseStatusBar extends SystemUI implements
setSystemUiVisibility(switches[1], 0xffffffff);
topAppWindowChanged(switches[2] != 0);
// StatusBarManagerService has a back up of IME token and it's restored here.
setImeWindowStatus(binders.get(0), switches[3], switches[4], switches[7] != 0);
setHardKeyboardStatus(switches[5] != 0, switches[6] != 0);
setImeWindowStatus(binders.get(0), switches[3], switches[4], switches[5] != 0);
// Set up the initial icon state
int N = iconList.size();

View File

@@ -47,16 +47,15 @@ public class CommandQueue extends IStatusBar.Stub {
private static final int MSG_SET_SYSTEMUI_VISIBILITY = 6 << MSG_SHIFT;
private static final int MSG_TOP_APP_WINDOW_CHANGED = 7 << MSG_SHIFT;
private static final int MSG_SHOW_IME_BUTTON = 8 << MSG_SHIFT;
private static final int MSG_SET_HARD_KEYBOARD_STATUS = 9 << MSG_SHIFT;
private static final int MSG_TOGGLE_RECENT_APPS = 10 << MSG_SHIFT;
private static final int MSG_PRELOAD_RECENT_APPS = 11 << MSG_SHIFT;
private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 12 << MSG_SHIFT;
private static final int MSG_SET_WINDOW_STATE = 13 << MSG_SHIFT;
private static final int MSG_SHOW_RECENT_APPS = 14 << MSG_SHIFT;
private static final int MSG_HIDE_RECENT_APPS = 15 << MSG_SHIFT;
private static final int MSG_BUZZ_BEEP_BLINKED = 16 << MSG_SHIFT;
private static final int MSG_NOTIFICATION_LIGHT_OFF = 17 << MSG_SHIFT;
private static final int MSG_NOTIFICATION_LIGHT_PULSE = 18 << MSG_SHIFT;
private static final int MSG_TOGGLE_RECENT_APPS = 9 << MSG_SHIFT;
private static final int MSG_PRELOAD_RECENT_APPS = 10 << MSG_SHIFT;
private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 11 << MSG_SHIFT;
private static final int MSG_SET_WINDOW_STATE = 12 << MSG_SHIFT;
private static final int MSG_SHOW_RECENT_APPS = 13 << MSG_SHIFT;
private static final int MSG_HIDE_RECENT_APPS = 14 << MSG_SHIFT;
private static final int MSG_BUZZ_BEEP_BLINKED = 15 << MSG_SHIFT;
private static final int MSG_NOTIFICATION_LIGHT_OFF = 16 << MSG_SHIFT;
private static final int MSG_NOTIFICATION_LIGHT_PULSE = 17 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -87,7 +86,6 @@ public class CommandQueue extends IStatusBar.Stub {
public void topAppWindowChanged(boolean visible);
public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
boolean showImeSwitcher);
public void setHardKeyboardStatus(boolean available, boolean enabled);
public void showRecentApps(boolean triggeredFromAltTab);
public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
public void toggleRecentApps();
@@ -175,14 +173,6 @@ public class CommandQueue extends IStatusBar.Stub {
}
}
public void setHardKeyboardStatus(boolean available, boolean enabled) {
synchronized (mList) {
mHandler.removeMessages(MSG_SET_HARD_KEYBOARD_STATUS);
mHandler.obtainMessage(MSG_SET_HARD_KEYBOARD_STATUS,
available ? 1 : 0, enabled ? 1 : 0).sendToTarget();
}
}
public void showRecentApps(boolean triggeredFromAltTab) {
synchronized (mList) {
mHandler.removeMessages(MSG_SHOW_RECENT_APPS);
@@ -300,9 +290,6 @@ public class CommandQueue extends IStatusBar.Stub {
mCallbacks.setImeWindowStatus((IBinder) msg.obj, msg.arg1, msg.arg2,
msg.getData().getBoolean(SHOW_IME_SWITCHER_KEY, false));
break;
case MSG_SET_HARD_KEYBOARD_STATUS:
mCallbacks.setHardKeyboardStatus(msg.arg1 != 0, msg.arg2 != 0);
break;
case MSG_SHOW_RECENT_APPS:
mCallbacks.showRecentApps(msg.arg1 != 0);
break;

View File

@@ -2635,9 +2635,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
setNavigationIconHints(flags);
}
@Override
public void setHardKeyboardStatus(boolean available, boolean enabled) {}
@Override
protected void tick(StatusBarNotification n, boolean firstTime) {
if (!mTickerEnabled) return;

View File

@@ -83,10 +83,6 @@ public class TvStatusBar extends BaseStatusBar {
boolean showImeSwitcher) {
}
@Override
public void setHardKeyboardStatus(boolean available, boolean enabled) {
}
@Override
public void toggleRecentApps() {
}

View File

@@ -603,10 +603,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
MSG_HARD_KEYBOARD_SWITCH_CHANGED, available ? 1 : 0, enabled ? 1 : 0));
}
public void handleHardKeyboardStatusChange(boolean available, boolean enabled) {
public void handleHardKeyboardStatusChange(boolean available,
boolean showImeWithHardKeyboard) {
if (DEBUG) {
Slog.w(TAG, "HardKeyboardStatusChanged: available = " + available + ", enabled = "
+ enabled);
Slog.w(TAG, "HardKeyboardStatusChanged: available = " + available
+ ", showImeWithHardKeyboard= " + showImeWithHardKeyboard);
}
synchronized(mMethodMap) {
if (mSwitchingDialog != null && mSwitchingDialogTitleView != null
@@ -2810,11 +2811,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
? View.VISIBLE : View.GONE);
final Switch hardKeySwitch = (Switch)mSwitchingDialogTitleView.findViewById(
com.android.internal.R.id.hard_keyboard_switch);
hardKeySwitch.setChecked(mWindowManagerService.isHardKeyboardEnabled());
hardKeySwitch.setChecked(mWindowManagerService.isShowImeWithHardKeyboardEnabled());
hardKeySwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mWindowManagerService.setHardKeyboardEnabled(isChecked);
mWindowManagerService.setShowImeWithHardKeyboard(isChecked);
// Ensure that the input method dialog is dismissed when changing
// the hardware keyboard state.
hideInputMethodMenu();

View File

@@ -48,9 +48,7 @@ import java.util.Map;
* A note on locking: We rely on the fact that calls onto mBar are oneway or
* if they are local, that they just enqueue messages to not deadlock.
*/
public class StatusBarManagerService extends IStatusBarService.Stub
implements WindowManagerService.OnHardKeyboardStatusChangeListener
{
public class StatusBarManagerService extends IStatusBarService.Stub {
private static final String TAG = "StatusBarManagerService";
private static final boolean SPEW = false;
@@ -95,7 +93,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
public StatusBarManagerService(Context context, WindowManagerService windowManager) {
mContext = context;
mWindowManager = windowManager;
mWindowManager.setOnHardKeyboardStatusChangeListener(this);
final Resources res = context.getResources();
mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.config_statusBarIcons));
@@ -393,29 +390,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
}
}
@Override
public void setHardKeyboardEnabled(final boolean enabled) {
mHandler.post(new Runnable() {
public void run() {
mWindowManager.setHardKeyboardEnabled(enabled);
}
});
}
@Override
public void onHardKeyboardStatusChange(final boolean available, final boolean enabled) {
mHandler.post(new Runnable() {
public void run() {
if (mBar != null) {
try {
mBar.setHardKeyboardStatus(available, enabled);
} catch (RemoteException ex) {
}
}
}
});
}
@Override
public void toggleRecentApps() {
if (mBar != null) {
@@ -510,11 +484,9 @@ public class StatusBarManagerService extends IStatusBarService.Stub
switches[2] = mMenuVisible ? 1 : 0;
switches[3] = mImeWindowVis;
switches[4] = mImeBackDisposition;
switches[7] = mShowImeSwitcher ? 1 : 0;
switches[5] = mShowImeSwitcher ? 1 : 0;
binders.add(mImeToken);
}
switches[5] = mWindowManager.isHardKeyboardAvailable() ? 1 : 0;
switches[6] = mWindowManager.isHardKeyboardEnabled() ? 1 : 0;
}
/**

View File

@@ -537,7 +537,7 @@ public class WindowManagerService extends IWindowManager.Stub
final ArrayList<WindowState> mInputMethodDialogs = new ArrayList<WindowState>();
boolean mHardKeyboardAvailable;
boolean mHardKeyboardEnabled;
boolean mShowImeWithHardKeyboard;
OnHardKeyboardStatusChangeListener mHardKeyboardStatusChangeListener;
final ArrayList<WindowToken> mWallpaperTokens = new ArrayList<WindowToken>();
@@ -7015,11 +7015,11 @@ public class WindowManagerService extends IWindowManager.Stub
boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
if (hardKeyboardAvailable != mHardKeyboardAvailable) {
mHardKeyboardAvailable = hardKeyboardAvailable;
mHardKeyboardEnabled = hardKeyboardAvailable;
mShowImeWithHardKeyboard = !hardKeyboardAvailable;
mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);
mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE);
}
if (!mHardKeyboardEnabled) {
if (mShowImeWithHardKeyboard) {
config.keyboard = Configuration.KEYBOARD_NOKEYS;
}
@@ -7039,16 +7039,16 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
public boolean isHardKeyboardEnabled() {
public boolean isShowImeWithHardKeyboardEnabled() {
synchronized (mWindowMap) {
return mHardKeyboardEnabled;
return mShowImeWithHardKeyboard;
}
}
public void setHardKeyboardEnabled(boolean enabled) {
public void setShowImeWithHardKeyboard(boolean enabled) {
synchronized (mWindowMap) {
if (mHardKeyboardEnabled != enabled) {
mHardKeyboardEnabled = enabled;
if (mShowImeWithHardKeyboard != enabled) {
mShowImeWithHardKeyboard = enabled;
mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
}
}
@@ -7062,15 +7062,15 @@ public class WindowManagerService extends IWindowManager.Stub
}
void notifyHardKeyboardStatusChange() {
final boolean available, enabled;
final boolean available, showImeWithHardKeyboard;
final OnHardKeyboardStatusChangeListener listener;
synchronized (mWindowMap) {
listener = mHardKeyboardStatusChangeListener;
available = mHardKeyboardAvailable;
enabled = mHardKeyboardEnabled;
showImeWithHardKeyboard = mShowImeWithHardKeyboard;
}
if (listener != null) {
listener.onHardKeyboardStatusChange(available, enabled);
listener.onHardKeyboardStatusChange(available, showImeWithHardKeyboard);
}
}
@@ -11053,7 +11053,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
public interface OnHardKeyboardStatusChangeListener {
public void onHardKeyboardStatusChange(boolean available, boolean enabled);
public void onHardKeyboardStatusChange(boolean available, boolean showIme);
}
void debugLayoutRepeats(final String msg, int pendingLayoutChanges) {