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

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

Issue 73193007: Reorder fields/methods in JniInterface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/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 d8ca6a75dcd643d2154a5834a9814d9189de07cc..59a536ba7048b0263e1b1ff4edc55d342d995bcd 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
@@ -38,15 +38,42 @@ public class JniInterface {
/** The status code indicating successful connection. */
private static final int SUCCESSFUL_CONNECTION = 3;
- /** The application context. */
- private static Activity sContext = null;
-
/*
* Library-loading state machine.
*/
/** Whether we've already loaded the library. */
private static boolean sLoaded = false;
+ /** The application context. */
+ private static Activity sContext = null;
+
+ /*
+ * Connection-initiating state machine.
+ */
+ /** Whether the native code is attempting a connection. */
+ private static boolean sConnected = false;
+
+ /** Callback to signal upon successful connection. */
+ private static Runnable sSuccessCallback = null;
+
+ /** Dialog for reporting connection progress. */
+ private static ProgressDialog sProgressIndicator = null;
+
+ /** Callback to signal whenever we need to redraw. */
+ private static Runnable sRedrawCallback = null;
+
+ /** Bitmap holding a copy of the latest video frame. */
+ private static Bitmap sFrameBitmap = null;
+
+ /** Lock to protect the frame bitmap reference. */
+ private static final Object sFrameLock = new Object();
+
+ /** Position of cursor hot-spot. */
+ private static Point sCursorHotspot = new Point();
+
+ /** Bitmap holding the cursor shape. */
+ private static Bitmap sCursorBitmap = null;
+
/**
* To be called once from the main Activity. Any subsequent calls will update the application
* context, but not reload the library. This is useful e.g. when the activity is closed and the
@@ -75,18 +102,6 @@ public class JniInterface {
public static native String nativeGetClientId();
public static native String nativeGetClientSecret();
- /*
- * Connection-initiating state machine.
- */
- /** Whether the native code is attempting a connection. */
- private static boolean sConnected = false;
-
- /** Callback to signal upon successful connection. */
- private static Runnable sSuccessCallback = null;
-
- /** Dialog for reporting connection progress. */
- private static ProgressDialog sProgressIndicator = null;
-
/** Attempts to form a connection to the user-selected host. */
public static void connectToHost(String username, String authToken,
String hostJid, String hostId, String hostPubkey, Runnable successCallback) {
@@ -105,6 +120,10 @@ public class JniInterface {
sConnected = true;
}
+ /** Performs the native portion of the connection. */
+ private static native void nativeConnect(String username, String authToken, String hostJid,
+ String hostId, String hostPubkey, String pairId, String pairSecret);
+
/** Severs the connection and cleans up. */
public static void disconnectFromHost() {
synchronized(JniInterface.class) {
@@ -126,37 +145,9 @@ public class JniInterface {
}
}
- /** Performs the native portion of the connection. */
- private static native void nativeConnect(String username, String authToken, String hostJid,
- String hostId, String hostPubkey, String pairId, String pairSecret);
-
/** Performs the native portion of the cleanup. */
private static native void nativeDisconnect();
- /** Position of cursor hotspot within cursor image. */
- public static Point getCursorHotspot() { return sCursorHotspot; }
-
- /** Returns the current cursor shape. */
- public static Bitmap getCursorBitmap() { return sCursorBitmap; }
-
- /*
- * Entry points *from* the native code.
- */
Lambros 2013/11/15 19:36:28 I removed this comment, which accounts for the mis
- /** Callback to signal whenever we need to redraw. */
- private static Runnable sRedrawCallback = null;
-
- /** Bitmap holding a copy of the latest video frame. */
- private static Bitmap sFrameBitmap = null;
-
- /** Lock to protect the frame bitmap reference. */
- private static final Object sFrameLock = new Object();
-
- /** Position of cursor hot-spot. */
- private static Point sCursorHotspot = new Point();
-
- /** Bitmap holding the cursor shape. */
- private static Bitmap sCursorBitmap = null;
-
/** Reports whenever the connection status changes. */
@CalledByNative
private static void reportConnectionStatus(int state, int error) {
@@ -271,6 +262,9 @@ public class JniInterface {
pinDialog.show();
}
+ /** Performs the native response to the user's PIN. */
+ private static native void nativeAuthenticationResponse(String pin, boolean createPair);
+
/** Saves newly-received pairing credentials to permanent storage. */
@CalledByNative
private static void commitPairingCredentials(String host, byte[] id, byte[] secret) {
@@ -282,6 +276,30 @@ public class JniInterface {
}
}
+ /** Moves the mouse cursor, possibly while clicking the specified (nonnegative) button. */
+ public static void mouseAction(int x, int y, int whichButton, boolean buttonDown) {
+ if (!sConnected) {
+ return;
+ }
+
+ nativeMouseAction(x, y, whichButton, buttonDown);
+ }
+
+ /** Passes mouse information to the native handling code. */
+ private static native void nativeMouseAction(int x, int y, int whichButton, boolean buttonDown);
+
+ /** Presses and releases the specified (nonnegative) key. */
+ public static void keyboardAction(int keyCode, boolean keyDown) {
+ if (!sConnected) {
+ return;
+ }
+
+ nativeKeyboardAction(keyCode, keyDown);
+ }
+
+ /** Passes key press information to the native handling code. */
+ private static native void nativeKeyboardAction(int keyCode, boolean keyDown);
+
/**
* Sets the redraw callback to the provided functor. Provide a value of null whenever the
* window is no longer visible so that we don't continue to draw onto it.
@@ -300,6 +318,9 @@ public class JniInterface {
return true;
}
+ /** Schedules a redraw on the native graphics thread. */
+ private static native void nativeScheduleRedraw();
+
/** Performs the redrawing callback. This is a no-op if the window isn't visible. */
@CalledByNative
private static void redrawGraphicsInternal() {
@@ -364,33 +385,9 @@ public class JniInterface {
sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.ARGB_8888);
}
- /** Moves the mouse cursor, possibly while clicking the specified (nonnegative) button. */
- public static void mouseAction(int x, int y, int whichButton, boolean buttonDown) {
- if (!sConnected) {
- return;
- }
-
- nativeMouseAction(x, y, whichButton, buttonDown);
- }
-
- /** Presses and releases the specified (nonnegative) key. */
- public static void keyboardAction(int keyCode, boolean keyDown) {
- if (!sConnected) {
- return;
- }
-
- nativeKeyboardAction(keyCode, keyDown);
- }
-
- /** Performs the native response to the user's PIN. */
- private static native void nativeAuthenticationResponse(String pin, boolean createPair);
-
- /** Schedules a redraw on the native graphics thread. */
- private static native void nativeScheduleRedraw();
-
- /** Passes mouse information to the native handling code. */
- private static native void nativeMouseAction(int x, int y, int whichButton, boolean buttonDown);
+ /** Position of cursor hotspot within cursor image. */
+ public static Point getCursorHotspot() { return sCursorHotspot; }
- /** Passes key press information to the native handling code. */
- private static native void nativeKeyboardAction(int keyCode, boolean keyDown);
+ /** Returns the current cursor shape. */
+ public static Bitmap getCursorBitmap() { return sCursorBitmap; }
}
« 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