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 fb9110d4830776ae0143aeb86f07e6f521f8daf9..c99b499795b61902d6635827f654a1a454994565 100644 |
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
@@ -22,6 +22,8 @@ import android.widget.CheckBox; |
import android.widget.TextView; |
import android.widget.Toast; |
+import org.chromium.base.CalledByNative; |
+import org.chromium.base.JNINamespace; |
import org.chromium.chromoting.R; |
import java.nio.ByteBuffer; |
@@ -31,6 +33,7 @@ import java.nio.ByteOrder; |
* Initializes the Chromium remoting library, and provides JNI calls into it. |
* All interaction with the native code is centralized in this class. |
*/ |
+@JNINamespace("remoting") |
public class JniInterface { |
/** The status code indicating successful connection. */ |
private static final int SUCCESSFUL_CONNECTION = 3; |
@@ -57,6 +60,9 @@ public class JniInterface { |
} |
System.loadLibrary("remoting_client_jni"); |
+ |
+ Log.e("jni", "*** 1"); |
+ |
loadNative(context); |
sLoaded = true; |
} |
@@ -154,6 +160,7 @@ public class JniInterface { |
private static Bitmap sCursorBitmap = null; |
/** Reports whenever the connection status changes. */ |
+ @CalledByNative |
private static void reportConnectionStatus(int state, int error) { |
if (state < SUCCESSFUL_CONNECTION && error == 0) { |
// The connection is still being established, so we'll report the current progress. |
@@ -201,6 +208,7 @@ public class JniInterface { |
} |
/** Prompts the user to enter a PIN. */ |
+ @CalledByNative |
private static void displayAuthenticationPrompt(boolean pairingSupported) { |
AlertDialog.Builder pinPrompt = new AlertDialog.Builder(sContext); |
pinPrompt.setTitle(sContext.getString(R.string.pin_entry_title)); |
@@ -266,6 +274,7 @@ public class JniInterface { |
} |
/** Saves newly-received pairing credentials to permanent storage. */ |
+ @CalledByNative |
private static void commitPairingCredentials(String host, byte[] id, byte[] secret) { |
synchronized (sContext) { |
sContext.getPreferences(Activity.MODE_PRIVATE).edit(). |
@@ -294,9 +303,11 @@ public class JniInterface { |
} |
/** Performs the redrawing callback. This is a no-op if the window isn't visible. */ |
+ @CalledByNative |
private static void redrawGraphicsInternal() { |
- if (sRedrawCallback != null) |
+ if (sRedrawCallback != null) { |
sRedrawCallback.run(); |
+ } |
} |
/** |
@@ -318,9 +329,9 @@ public class JniInterface { |
} |
/** |
- * Sets a new video frame. Called from native code on the native graphics thread when a new |
- * frame is allocated. |
+ * Sets a new video frame. Called on the native graphics thread when a new frame is allocated. |
*/ |
+ @CalledByNative |
private static void setVideoFrame(Bitmap bitmap) { |
if (Looper.myLooper() == Looper.getMainLooper()) { |
Log.w("jniiface", "Video frame updated on UI thread"); |
@@ -335,14 +346,16 @@ public class JniInterface { |
* Creates a new Bitmap to hold video frame pixels. Called by native code which stores a global |
* reference to the Bitmap and writes the decoded frame pixels to it. |
*/ |
+ @CalledByNative |
private static Bitmap newBitmap(int width, int height) { |
return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); |
} |
/** |
- * Updates the cursor shape. This is called from native code on the graphics thread when |
- * receiving a new cursor shape from the host. |
+ * Updates the cursor shape. This is called on the graphics thread when receiving a new cursor |
+ * shape from the host. |
*/ |
+ @CalledByNative |
public static void updateCursorShape(int width, int height, int hotspotX, int hotspotY, |
ByteBuffer buffer) { |
sCursorHotspot = new Point(hotspotX, hotspotY); |