Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Desktop.java

Issue 390983008: Fix back button does not disconnect remoting session (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8868d5ad954951f20b9b85757b747c7f238299fd..d301c092e2e80229faa42473e1fd7b1018e0333c 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
@@ -183,6 +183,13 @@ public class Desktop extends Activity implements View.OnSystemUiVisibilityChange
*/
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
+ int keyCode = event.getKeyCode();
+
+ // Dispatch the back button to the system to handle navigation
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ return super.dispatchKeyEvent(event);
+ }
+
// Send TextEvent in two cases:
// 1. This is an ACTION_MULTIPLE event.
// 2. The event was generated by on-screen keyboard and Ctrl, Alt and
@@ -192,10 +199,9 @@ public class Desktop extends Activity implements View.OnSystemUiVisibilityChange
// acts as if it is connected to the remote host.
if (event.getAction() == KeyEvent.ACTION_MULTIPLE) {
JniInterface.sendTextEvent(event.getCharacters());
- return super.dispatchKeyEvent(event);
+ return true;
}
- int keyCode = event.getKeyCode();
boolean pressed = event.getAction() == KeyEvent.ACTION_DOWN;
// For Enter getUnicodeChar() returns 10 (line feed), but we still
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698