summaryrefslogtreecommitdiffstats
path: root/remoting/android
diff options
context:
space:
mode:
authorjoedow <joedow@chromium.org>2016-01-29 12:27:24 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-29 20:28:26 +0000
commit1771a0d1b813877eebefca92a0f8c5077de6dd80 (patch)
tree01c1e0ec039bbd971f8da33112e5253100173790 /remoting/android
parentaec0a139d1c2e3754b7a764ed0b002cad12a5124 (diff)
downloadchromium_src-1771a0d1b813877eebefca92a0f8c5077de6dd80.zip
chromium_src-1771a0d1b813877eebefca92a0f8c5077de6dd80.tar.gz
chromium_src-1771a0d1b813877eebefca92a0f8c5077de6dd80.tar.bz2
Fix status bar visibility issue on pre-Marshmallow devices
When the OSK is dismissed on Marshmallow, the OS will call onSystemUiVisibilityChange which will hide any remaining system UI such as the status or navigation bar. On pre-marshallow OSes this method is not called if the user has interacted with the system UI (such as pulling the notification UI down). When this occurs, the user is left in a state where the system UI acts 'sticky', that is all user interactions are directed to the system UI instead of our app. This change will manually hide the system UI on older OSes to prevent this issue from occurring. BUG=581931 Review URL: https://codereview.chromium.org/1643273002 Cr-Commit-Position: refs/heads/master@{#372404}
Diffstat (limited to 'remoting/android')
-rw-r--r--remoting/android/java/src/org/chromium/chromoting/Desktop.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
index 887d16b..93e54b1 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. */
+ private boolean mHideSystemUIOnSoftKeyboardDismiss = 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() {
+ mHideSystemUIOnSoftKeyboardDismiss = 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.
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
+ mHideSystemUIOnSoftKeyboardDismiss = true;
+ }
}
}
@@ -534,6 +545,20 @@ public class Desktop
mSoftInputVisible = (bottom < mMaxBottomValue);
mRemoteHostDesktop.onSoftInputMethodVisibilityChanged(
mSoftInputVisible, new Rect(left, top, right, bottom));
+
+ if (!mSoftInputVisible && mHideSystemUIOnSoftKeyboardDismiss) {
+ // 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 (mHideSystemUIOnSoftKeyboardDismiss) {
+ mHideSystemUIOnSoftKeyboardDismiss = false;
+ hideActionBar();
+ }
+ }
+ });
+ }
}
});
}