Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| index 887d16b9c9de48c2bec201aa7d6c6d6b2c264c88..11915c9e10bef2fc49f1150eb6280781c0d31a5e 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| @@ -77,6 +77,9 @@ public class Desktop |
| /** Flag to indicate whether the current activity is switching to Cardboard desktop activity. */ |
| private boolean mSwitchToCardboardDesktopActivity; |
| + /** Flag to indicate whether to manually hide the system UI when the OSK is dismissed. */ |
|
Lambros
2016/01/29 19:09:57
Avoid OSK abbreviation, maybe just "keyboard" or "
joedow
2016/01/29 19:31:17
Done.
|
| + private boolean mHideSystemUIOnOskDismiss = false; |
| + |
| /** Indicates whether a Soft Input UI (such as a keyboard) is visible. */ |
| private boolean mSoftInputVisible = false; |
| @@ -387,6 +390,8 @@ public class Desktop |
| } |
| public void showActionBar() { |
| + mHideSystemUIOnOskDismiss = false; |
| + |
| // Request exit from any fullscreen mode. The action-bar controls will be shown in response |
| // to the SystemUiVisibility notification. The visibility of the action-bar should be tied |
| // to the fullscreen state of the system, so there's no need to explicitly show it here. |
| @@ -439,6 +444,12 @@ public class Desktop |
| // and still allow the system to hide the ActionBar normally when no keyboard is present. |
| if (mSoftInputVisible) { |
| hideActionBarWithoutSystemUi(); |
| + |
| + // Android OSes prior to Marshmallow do not call onSystemUiVisibilityChange after the |
| + // OSK is dismissed if the user has interacted with the status bar. |
|
Lambros
2016/01/29 19:09:57
This comment seems to contradict the first sentenc
joedow
2016/01/29 19:31:17
It doesn't contradict the sentence, it is document
|
| + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { |
| + mHideSystemUIOnOskDismiss = true; |
| + } |
| } |
| } |
| @@ -534,6 +545,20 @@ public class Desktop |
| mSoftInputVisible = (bottom < mMaxBottomValue); |
| mRemoteHostDesktop.onSoftInputMethodVisibilityChanged( |
| mSoftInputVisible, new Rect(left, top, right, bottom)); |
| + |
| + if (!mSoftInputVisible && mHideSystemUIOnOskDismiss) { |
| + // Queue a task which will run after the current action (OSK dismiss) has |
| + // completed, otherwise the hide request will not take effect. |
| + new Handler().post(new Runnable() { |
| + @Override |
| + public void run() { |
| + if (mHideSystemUIOnOskDismiss) { |
|
Lambros
2016/01/29 19:09:57
Why do you need to check this flag again? You alre
joedow
2016/01/29 19:31:17
I am checking it here because this task is appende
|
| + mHideSystemUIOnOskDismiss = false; |
| + hideActionBar(); |
| + } |
| + } |
| + }); |
| + } |
| } |
| }); |
| } |