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

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

Issue 21236002: Chromoting Android app mouse/keyboard bugfixes and enhancements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
index 55056180ffae5acdaeb40da7a0e96d137f6af9b0..b2f82f014c88f0c5a68bd4fd10efead3ed63afff 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
@@ -198,7 +198,7 @@ public class JniInterface {
*/
public static Bitmap retrieveVideoFrame() {
if (Looper.myLooper() == Looper.getMainLooper()) {
- Log.w("deskview", "Canvas being redrawn on UI thread");
+ Log.w("jniiface", "Canvas being redrawn on UI thread");
}
if (!sConnected) {
@@ -213,8 +213,12 @@ public class JniInterface {
return Bitmap.createBitmap(frame, 0, sWidth, sWidth, sHeight, Bitmap.Config.ARGB_8888);
}
- /** Moves the mouse cursor, possibly while clicking. */
+ /** Moves the mouse cursor, possibly while clicking the specified (nonnegative) button. */
public static void mouseAction(int x, int y, int whichButton, boolean buttonDown) {
+ if (whichButton < 0) {
+ Log.e("jniiface", "Attempted to press a negative mouse button");
garykac 2013/07/30 17:50:05 Why are there negative buttons? Isn't this constr
solb 2013/07/30 18:28:54 Yes, it is constrained thusly. However, I added th
+ return;
+ }
if (!sConnected) {
return;
}
@@ -222,8 +226,12 @@ public class JniInterface {
mouseActionNative(x, y, whichButton, buttonDown);
}
- /** Presses and releases the specified key. */
+ /** Presses and releases the specified (nonnegative) key. */
public static void keyboardAction(int keyCode, boolean keyDown) {
+ if (keyCode < 0) {
+ Log.e("jniiface", "Attempted to hit a negative key");
+ return;
+ }
if (!sConnected) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698