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 |