Bug 1191161 - p3 - Rename / Shorten WrapElementForJNI to WrapForJNI, r=jchen

--HG--
rename : mobile/android/base/mozglue/generatorannotations/WrapElementForJNI.java => mobile/android/base/annotation/WrapForJNI.java
This commit is contained in:
Mark Capella 2015-08-07 02:09:08 -04:00
Родитель 63591bbd24
Коммит f3a5fca399
25 изменённых файлов: 169 добавлений и 170 удалений

Просмотреть файл

@ -50,7 +50,7 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
// Check for "Wrap ALL the things" flag.
for (Annotation annotation : aClass.getDeclaredAnnotations()) {
final String annotationTypeName = annotation.annotationType().getName();
if (annotationTypeName.equals("org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI")) {
if (annotationTypeName.equals("org.mozilla.gecko.annotation.WrapForJNI")) {
mIterateEveryEntry = true;
break;
}
@ -71,7 +71,7 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
// WrappedJNIMethod has parameters. Use Reflection to obtain them.
Class<? extends Annotation> annotationType = annotation.annotationType();
final String annotationTypeName = annotationType.getName();
if (annotationTypeName.equals("org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI")) {
if (annotationTypeName.equals("org.mozilla.gecko.annotation.WrapForJNI")) {
String stubName = null;
boolean isMultithreadedStub = false;
boolean noThrow = false;
@ -104,15 +104,15 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
catchException = (Boolean) catchExceptionMethod.invoke(annotation);
} catch (NoSuchMethodException e) {
System.err.println("Unable to find expected field on WrapElementForJNI annotation. Did the signature change?");
System.err.println("Unable to find expected field on WrapForJNI annotation. Did the signature change?");
e.printStackTrace(System.err);
System.exit(3);
} catch (IllegalAccessException e) {
System.err.println("IllegalAccessException reading fields on WrapElementForJNI annotation. Seems the semantics of Reflection have changed...");
System.err.println("IllegalAccessException reading fields on WrapForJNI annotation. Seems the semantics of Reflection have changed...");
e.printStackTrace(System.err);
System.exit(4);
} catch (InvocationTargetException e) {
System.err.println("InvocationTargetException reading fields on WrapElementForJNI annotation. This really shouldn't happen.");
System.err.println("InvocationTargetException reading fields on WrapForJNI annotation. This really shouldn't happen.");
e.printStackTrace(System.err);
System.exit(5);
}

Просмотреть файл

@ -20,8 +20,8 @@ import java.util.UUID;
import java.util.regex.Pattern;
import org.json.JSONObject;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.util.ThreadUtils;
import android.content.BroadcastReceiver;
@ -54,11 +54,11 @@ public final class ANRReporter extends BroadcastReceiver
private Handler mHandler;
private volatile boolean mPendingANR;
@WrapElementForJNI
@WrapForJNI
private static native boolean requestNativeStack(boolean unwind);
@WrapElementForJNI
@WrapForJNI
private static native String getNativeStack();
@WrapElementForJNI
@WrapForJNI
private static native void releaseNativeStack();
public static void register(Context context) {

Просмотреть файл

@ -5,11 +5,11 @@
package org.mozilla.gecko;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.util.NativeEventListener;
import org.mozilla.gecko.util.NativeJSObject;
import org.mozilla.gecko.util.EventCallback;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import java.io.File;
import java.lang.IllegalArgumentException;
@ -108,7 +108,7 @@ public class DownloadsIntegration implements NativeEventListener
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT == state);
}
@WrapElementForJNI
@WrapForJNI
public static void scanMedia(final String aFile, String aMimeType) {
String mimeType = aMimeType;
if (UNKNOWN_MIME_TYPES.contains(mimeType)) {

Просмотреть файл

@ -30,6 +30,7 @@ import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.favicons.Favicons;
@ -41,7 +42,6 @@ import org.mozilla.gecko.mozglue.ContextUtils;
import org.mozilla.gecko.mozglue.GeckoLoader;
import org.mozilla.gecko.mozglue.JNITarget;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.overlays.ui.ShareDialog;
import org.mozilla.gecko.prompts.PromptService;
import org.mozilla.gecko.util.EventCallback;
@ -461,19 +461,19 @@ public class GeckoAppShell
* The Gecko-side API: API methods that Gecko calls
*/
@WrapElementForJNI(allowMultithread = true, noThrow = true)
@WrapForJNI(allowMultithread = true, noThrow = true)
public static void handleUncaughtException(Thread thread, Throwable e) {
CRASH_HANDLER.uncaughtException(thread, e);
}
@WrapElementForJNI
@WrapForJNI
public static void notifyIME(int type) {
if (editableListener != null) {
editableListener.notifyIME(type);
}
}
@WrapElementForJNI
@WrapForJNI
public static void notifyIMEContext(int state, String typeHint,
String modeHint, String actionHint) {
if (editableListener != null) {
@ -482,7 +482,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void notifyIMEChange(String text, int start, int end, int newEnd) {
if (newEnd < 0) { // Selection change
editableListener.onSelectionChange(start, end);
@ -534,7 +534,7 @@ public class GeckoAppShell
}
// Signal the Java thread that it's time to wake up
@WrapElementForJNI
@WrapForJNI
public static void acknowledgeEvent() {
synchronized (sEventAckLock) {
sWaitingForEventAck = false;
@ -555,7 +555,7 @@ public class GeckoAppShell
private static native long runUiThreadCallback();
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
private static void requestUiThreadCallback(long delay) {
ThreadUtils.getUiHandler().postDelayed(sCallbackRunnable, delay);
}
@ -591,7 +591,7 @@ public class GeckoAppShell
return lastKnownLocation;
}
@WrapElementForJNI
@WrapForJNI
public static void enableLocation(final boolean enable) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -647,12 +647,12 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void enableLocationHighAccuracy(final boolean enable) {
locationHighAccuracyEnabled = enable;
}
@WrapElementForJNI
@WrapForJNI
public static void enableSensor(int aSensortype) {
GeckoInterface gi = getGeckoInterface();
if (gi == null)
@ -722,7 +722,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void disableSensor(int aSensortype) {
GeckoInterface gi = getGeckoInterface();
if (gi == null)
@ -776,7 +776,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void startMonitoringGamepad() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -786,7 +786,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void stopMonitoringGamepad() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -796,7 +796,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void gamepadAdded(final int device_id, final int service_id) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -806,20 +806,20 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void moveTaskToBack() {
if (getGeckoInterface() != null)
getGeckoInterface().getActivity().moveTaskToBack(true);
}
@WrapElementForJNI
@WrapForJNI
static void scheduleRestart() {
getGeckoInterface().doRestart();
}
// Creates a homescreen shortcut for a web page.
// This is the entry point from nsIShellService.
@WrapElementForJNI
@WrapForJNI
static void createShortcut(final String aTitle, final String aURI, final String aIconData) {
// We have the favicon data (base64) decoded on the background thread, callback here, then
// call the other createShortcut method with the decoded favicon.
@ -943,7 +943,7 @@ public class GeckoAppShell
return bitmap;
}
@WrapElementForJNI(stubName = "GetHandlersForMimeTypeWrapper")
@WrapForJNI(stubName = "GetHandlersForMimeTypeWrapper")
static String[] getHandlersForMimeType(String aMimeType, String aAction) {
Intent intent = getIntentForActionString(aAction);
if (aMimeType != null && aMimeType.length() > 0)
@ -951,7 +951,7 @@ public class GeckoAppShell
return getHandlersForIntent(intent);
}
@WrapElementForJNI(stubName = "GetHandlersForURLWrapper")
@WrapForJNI(stubName = "GetHandlersForURLWrapper")
static String[] getHandlersForURL(String aURL, String aAction) {
// aURL may contain the whole URL or just the protocol
Uri uri = aURL.indexOf(':') >= 0 ? Uri.parse(aURL) : new Uri.Builder().scheme(aURL).build();
@ -962,12 +962,12 @@ public class GeckoAppShell
return getHandlersForIntent(intent);
}
@WrapElementForJNI(stubName = "GetHWEncoderCapability")
@WrapForJNI(stubName = "GetHWEncoderCapability")
static boolean getHWEncoderCapability() {
return HardwareCodecCapabilityUtils.getHWEncoderCapability();
}
@WrapElementForJNI(stubName = "GetHWDecoderCapability")
@WrapForJNI(stubName = "GetHWDecoderCapability")
static boolean getHWDecoderCapability() {
return HardwareCodecCapabilityUtils.getHWDecoderCapability();
}
@ -1028,12 +1028,12 @@ public class GeckoAppShell
return new Intent(aAction);
}
@WrapElementForJNI(stubName = "GetExtensionFromMimeTypeWrapper")
@WrapForJNI(stubName = "GetExtensionFromMimeTypeWrapper")
static String getExtensionFromMimeType(String aMimeType) {
return MimeTypeMap.getSingleton().getExtensionFromMimeType(aMimeType);
}
@WrapElementForJNI(stubName = "GetMimeTypeFromExtensionsWrapper")
@WrapForJNI(stubName = "GetMimeTypeFromExtensionsWrapper")
static String getMimeTypeFromExtensions(String aFileExt) {
StringTokenizer st = new StringTokenizer(aFileExt, ".,; ");
String type = null;
@ -1094,7 +1094,7 @@ public class GeckoAppShell
* @param title the title to use in <code>ACTION_SEND</code> intents.
* @return true if the activity started successfully; false otherwise.
*/
@WrapElementForJNI
@WrapForJNI
public static boolean openUriExternal(String targetURI,
String mimeType,
String packageName,
@ -1382,7 +1382,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "ShowAlertNotificationWrapper")
@WrapForJNI(stubName = "ShowAlertNotificationWrapper")
public static void showAlertNotification(String aImageUrl, String aAlertTitle, String aAlertText,
String aAlertCookie, String aAlertName) {
// The intent to launch when the user clicks the expanded notification
@ -1409,13 +1409,13 @@ public class GeckoAppShell
notificationClient.add(notificationID, aImageUrl, aAlertTitle, aAlertText, contentIntent);
}
@WrapElementForJNI
@WrapForJNI
public static void alertsProgressListener_OnProgress(String aAlertName, long aProgress, long aProgressMax, String aAlertText) {
int notificationID = aAlertName.hashCode();
notificationClient.update(notificationID, aProgress, aProgressMax, aAlertText);
}
@WrapElementForJNI
@WrapForJNI
public static void closeNotification(String aAlertName) {
String alertCookie = ALERT_COOKIES.get(aAlertName);
if (alertCookie != null) {
@ -1443,7 +1443,7 @@ public class GeckoAppShell
closeNotification(aAlertName);
}
@WrapElementForJNI(stubName = "GetDpiWrapper")
@WrapForJNI(stubName = "GetDpiWrapper")
public static int getDpi() {
if (sDensityDpi == 0) {
sDensityDpi = getContext().getResources().getDisplayMetrics().densityDpi;
@ -1452,7 +1452,7 @@ public class GeckoAppShell
return sDensityDpi;
}
@WrapElementForJNI
@WrapForJNI
public static float getDensity() {
return getContext().getResources().getDisplayMetrics().density;
}
@ -1465,7 +1465,7 @@ public class GeckoAppShell
* Returns the colour depth of the default screen. This will either be
* 24 or 16.
*/
@WrapElementForJNI(stubName = "GetScreenDepthWrapper")
@WrapForJNI(stubName = "GetScreenDepthWrapper")
public static synchronized int getScreenDepth() {
if (sScreenDepth == 0) {
sScreenDepth = 16;
@ -1488,13 +1488,13 @@ public class GeckoAppShell
sScreenDepth = aScreenDepth;
}
@WrapElementForJNI
@WrapForJNI
public static void setFullScreen(boolean fullscreen) {
if (getGeckoInterface() != null)
getGeckoInterface().setFullScreen(fullscreen);
}
@WrapElementForJNI
@WrapForJNI
public static void performHapticFeedback(boolean aIsLongPress) {
// Don't perform haptic feedback if a vibration is currently playing,
// because the haptic feedback will nuke the vibration.
@ -1527,14 +1527,14 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "Vibrate1")
@WrapForJNI(stubName = "Vibrate1")
public static void vibrate(long milliseconds) {
sVibrationEndTime = System.nanoTime() + milliseconds * 1000000;
sVibrationMaybePlaying = true;
vibrator().vibrate(milliseconds);
}
@WrapElementForJNI(stubName = "VibrateA")
@WrapForJNI(stubName = "VibrateA")
public static void vibrate(long[] pattern, int repeat) {
// If pattern.length is even, the last element in the pattern is a
// meaningless delay, so don't include it in vibrationDuration.
@ -1549,21 +1549,21 @@ public class GeckoAppShell
vibrator().vibrate(pattern, repeat);
}
@WrapElementForJNI
@WrapForJNI
public static void cancelVibrate() {
sVibrationMaybePlaying = false;
sVibrationEndTime = 0;
vibrator().cancel();
}
@WrapElementForJNI
@WrapForJNI
public static void showInputMethodPicker() {
InputMethodManager imm = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
}
@WrapElementForJNI
@WrapForJNI
public static void setKeepScreenOn(final boolean on) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -1573,7 +1573,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void notifyDefaultPrevented(final boolean defaultPrevented) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -1587,7 +1587,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static boolean isNetworkLinkUp() {
ConnectivityManager cm = (ConnectivityManager)
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
@ -1601,7 +1601,7 @@ public class GeckoAppShell
return true;
}
@WrapElementForJNI
@WrapForJNI
public static boolean isNetworkLinkKnown() {
ConnectivityManager cm = (ConnectivityManager)
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
@ -1614,7 +1614,7 @@ public class GeckoAppShell
return true;
}
@WrapElementForJNI
@WrapForJNI
public static int networkLinkType() {
ConnectivityManager cm = (ConnectivityManager)
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
@ -1673,7 +1673,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "GetSystemColoursWrapper")
@WrapForJNI(stubName = "GetSystemColoursWrapper")
public static int[] getSystemColors() {
// attrsAppearance[] must correspond to AndroidSystemColors structure in android/AndroidBridge.h
final int[] attrsAppearance = {
@ -1710,7 +1710,7 @@ public class GeckoAppShell
return result;
}
@WrapElementForJNI
@WrapForJNI
public static void killAnyZombies() {
GeckoProcessesVisitor visitor = new GeckoProcessesVisitor() {
@Override
@ -1840,7 +1840,7 @@ public class GeckoAppShell
} catch (Exception e) { }
}
@WrapElementForJNI(stubName = "GetIconForExtensionWrapper")
@WrapForJNI(stubName = "GetIconForExtensionWrapper")
public static byte[] getIconForExtension(String aExt, int iconSize) {
try {
if (iconSize <= 0)
@ -1898,7 +1898,7 @@ public class GeckoAppShell
return activityInfo.loadIcon(pm);
}
@WrapElementForJNI
@WrapForJNI
public static boolean getShowPasswordSetting() {
try {
int showPassword =
@ -1911,7 +1911,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "AddPluginViewWrapper")
@WrapForJNI(stubName = "AddPluginViewWrapper")
public static void addPluginView(View view,
float x, float y,
float w, float h,
@ -1920,7 +1920,7 @@ public class GeckoAppShell
getGeckoInterface().addPluginView(view, new RectF(x, y, x + w, y + h), isFullScreen);
}
@WrapElementForJNI
@WrapForJNI
public static void removePluginView(View view, boolean isFullScreen) {
if (getGeckoInterface() != null)
getGeckoInterface().removePluginView(view, isFullScreen);
@ -2126,7 +2126,7 @@ public class GeckoAppShell
return pluginCL.loadClass(className);
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static Class<?> loadPluginClass(String className, String libName) {
if (getGeckoInterface() == null)
return null;
@ -2146,7 +2146,7 @@ public class GeckoAppShell
private static ContextGetter sContextGetter;
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static Context getContext() {
return sContextGetter.getContext();
}
@ -2210,7 +2210,7 @@ public class GeckoAppShell
static byte[] sCameraBuffer;
@WrapElementForJNI(stubName = "InitCameraWrapper")
@WrapForJNI(stubName = "InitCameraWrapper")
static int[] initCamera(String aContentType, int aCamera, int aWidth, int aHeight) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2304,7 +2304,7 @@ public class GeckoAppShell
return result;
}
@WrapElementForJNI
@WrapForJNI
static synchronized void closeCamera() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2326,33 +2326,33 @@ public class GeckoAppShell
/*
* Battery API related methods.
*/
@WrapElementForJNI
@WrapForJNI
public static void enableBatteryNotifications() {
GeckoBatteryManager.enableNotifications();
}
@WrapElementForJNI(stubName = "HandleGeckoMessageWrapper")
@WrapForJNI(stubName = "HandleGeckoMessageWrapper")
public static void handleGeckoMessage(final NativeJSContainer message) {
EventDispatcher.getInstance().dispatchEvent(message);
message.disposeNative();
}
@WrapElementForJNI
@WrapForJNI
public static void disableBatteryNotifications() {
GeckoBatteryManager.disableNotifications();
}
@WrapElementForJNI(stubName = "GetCurrentBatteryInformationWrapper")
@WrapForJNI(stubName = "GetCurrentBatteryInformationWrapper")
public static double[] getCurrentBatteryInformation() {
return GeckoBatteryManager.getCurrentInformation();
}
@WrapElementForJNI(stubName = "CheckURIVisited")
@WrapForJNI(stubName = "CheckURIVisited")
static void checkUriVisited(String uri) {
GlobalHistory.getInstance().checkUriVisited(uri);
}
@WrapElementForJNI(stubName = "MarkURIVisited")
@WrapForJNI(stubName = "MarkURIVisited")
static void markUriVisited(final String uri) {
final Context context = getContext();
final BrowserDB db = GeckoProfile.get(context).getDB();
@ -2364,7 +2364,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI(stubName = "SetURITitle")
@WrapForJNI(stubName = "SetURITitle")
static void setUriTitle(final String uri, final String title) {
final Context context = getContext();
final BrowserDB db = GeckoProfile.get(context).getDB();
@ -2376,7 +2376,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
static void hideProgressDialog() {
// unused stub
}
@ -2384,7 +2384,7 @@ public class GeckoAppShell
/*
* WebSMS related methods.
*/
@WrapElementForJNI(stubName = "SendMessageWrapper")
@WrapForJNI(stubName = "SendMessageWrapper")
public static void sendMessage(String aNumber, String aMessage, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2393,7 +2393,7 @@ public class GeckoAppShell
SmsManager.getInstance().send(aNumber, aMessage, aRequestId);
}
@WrapElementForJNI(stubName = "GetMessageWrapper")
@WrapForJNI(stubName = "GetMessageWrapper")
public static void getMessage(int aMessageId, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2402,7 +2402,7 @@ public class GeckoAppShell
SmsManager.getInstance().getMessage(aMessageId, aRequestId);
}
@WrapElementForJNI(stubName = "DeleteMessageWrapper")
@WrapForJNI(stubName = "DeleteMessageWrapper")
public static void deleteMessage(int aMessageId, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2411,7 +2411,7 @@ public class GeckoAppShell
SmsManager.getInstance().deleteMessage(aMessageId, aRequestId);
}
@WrapElementForJNI(stubName = "CreateMessageListWrapper")
@WrapForJNI(stubName = "CreateMessageListWrapper")
public static void createMessageList(long aStartDate, long aEndDate, String[] aNumbers, int aNumbersCount, String aDelivery, boolean aHasRead, boolean aRead, long aThreadId, boolean aReverse, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2420,7 +2420,7 @@ public class GeckoAppShell
SmsManager.getInstance().createMessageList(aStartDate, aEndDate, aNumbers, aNumbersCount, aDelivery, aHasRead, aRead, aThreadId, aReverse, aRequestId);
}
@WrapElementForJNI(stubName = "GetNextMessageInListWrapper")
@WrapForJNI(stubName = "GetNextMessageInListWrapper")
public static void getNextMessageInList(int aListId, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2429,7 +2429,7 @@ public class GeckoAppShell
SmsManager.getInstance().getNextMessageInList(aListId, aRequestId);
}
@WrapElementForJNI
@WrapForJNI
public static void clearMessageList(int aListId) {
if (!SmsManager.isEnabled()) {
return;
@ -2439,7 +2439,7 @@ public class GeckoAppShell
}
/* Called by JNI from AndroidBridge, and by reflection from tests/BaseTest.java.in */
@WrapElementForJNI
@WrapForJNI
@RobocopTarget
public static boolean isTablet() {
return HardwareUtils.isTablet();
@ -2453,12 +2453,12 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "GetCurrentNetworkInformationWrapper")
@WrapForJNI(stubName = "GetCurrentNetworkInformationWrapper")
public static double[] getCurrentNetworkInformation() {
return GeckoNetworkManager.getInstance().getCurrentInformation();
}
@WrapElementForJNI
@WrapForJNI
public static void enableNetworkNotifications() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2468,7 +2468,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void disableNetworkNotifications() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2478,32 +2478,32 @@ public class GeckoAppShell
});
}
@WrapElementForJNI(stubName = "GetScreenOrientationWrapper")
@WrapForJNI(stubName = "GetScreenOrientationWrapper")
public static short getScreenOrientation() {
return GeckoScreenOrientation.getInstance().getScreenOrientation().value;
}
@WrapElementForJNI
@WrapForJNI
public static void enableScreenOrientationNotifications() {
GeckoScreenOrientation.getInstance().enableNotifications();
}
@WrapElementForJNI
@WrapForJNI
public static void disableScreenOrientationNotifications() {
GeckoScreenOrientation.getInstance().disableNotifications();
}
@WrapElementForJNI
@WrapForJNI
public static void lockScreenOrientation(int aOrientation) {
GeckoScreenOrientation.getInstance().lock(aOrientation);
}
@WrapElementForJNI
@WrapForJNI
public static void unlockScreenOrientation() {
GeckoScreenOrientation.getInstance().unlock();
}
@WrapElementForJNI
@WrapForJNI
public static boolean pumpMessageLoop(final Message msg) {
final Handler geckoHandler = ThreadUtils.sGeckoHandler;
@ -2521,13 +2521,13 @@ public class GeckoAppShell
return true;
}
@WrapElementForJNI
@WrapForJNI
public static void notifyWakeLockChanged(String topic, String state) {
if (getGeckoInterface() != null)
getGeckoInterface().notifyWakeLockChanged(topic, state);
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static void registerSurfaceTextureFrameListener(Object surfaceTexture, final int id) {
((SurfaceTexture)surfaceTexture).setOnFrameAvailableListener(new SurfaceTexture.OnFrameAvailableListener() {
@Override
@ -2537,12 +2537,12 @@ public class GeckoAppShell
});
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static void unregisterSurfaceTextureFrameListener(Object surfaceTexture) {
((SurfaceTexture)surfaceTexture).setOnFrameAvailableListener(null);
}
@WrapElementForJNI
@WrapForJNI
public static boolean unlockProfile() {
// Try to kill any zombie Fennec's that might be running
GeckoAppShell.killAnyZombies();
@ -2556,7 +2556,7 @@ public class GeckoAppShell
return false;
}
@WrapElementForJNI(stubName = "GetProxyForURIWrapper")
@WrapForJNI(stubName = "GetProxyForURIWrapper")
public static String getProxyForURI(String spec, String scheme, String host, int port) {
final ProxySelector ps = new ProxySelector();
@ -2653,12 +2653,12 @@ public class GeckoAppShell
toast.show();
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
static InputStream createInputStream(URLConnection connection) throws IOException {
return connection.getInputStream();
}
@WrapElementForJNI(allowMultithread = true, narrowChars = true)
@WrapForJNI(allowMultithread = true, narrowChars = true)
static URLConnection getConnection(String url) {
try {
String spec;
@ -2679,7 +2679,7 @@ public class GeckoAppShell
return null;
}
@WrapElementForJNI(allowMultithread = true, narrowChars = true)
@WrapForJNI(allowMultithread = true, narrowChars = true)
static String connectionGetMimeType(URLConnection connection) {
return connection.getContentType();
}
@ -2690,7 +2690,7 @@ public class GeckoAppShell
* @param type The type of directory to return
* @return Absolute path of the specified directory or null on failure
*/
@WrapElementForJNI
@WrapForJNI
static String getExternalPublicDirectory(final String type) {
final String state = Environment.getExternalStorageState();
if (!Environment.MEDIA_MOUNTED.equals(state) &&
@ -2719,7 +2719,7 @@ public class GeckoAppShell
return Environment.getExternalStoragePublicDirectory(systemType).getAbsolutePath();
}
@WrapElementForJNI
@WrapForJNI
static int getMaxTouchPoints() {
PackageManager pm = getContext().getPackageManager();
if (pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND)) {

Просмотреть файл

@ -9,7 +9,7 @@ import android.os.SystemClock;
import android.util.Log;
import android.util.SparseArray;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import java.lang.Thread;
import java.util.Set;
@ -126,7 +126,7 @@ public class GeckoJavaSampler {
}
@WrapElementForJNI(allowMultithread = true, stubName = "GetThreadNameJavaProfilingWrapper")
@WrapForJNI(allowMultithread = true, stubName = "GetThreadNameJavaProfilingWrapper")
public synchronized static String getThreadName(int aThreadId) {
if (aThreadId == 0 && sMainThread != null) {
return sMainThread.getName();
@ -138,7 +138,7 @@ public class GeckoJavaSampler {
return sSamplingRunnable.getSample(aThreadId, aSampleId);
}
@WrapElementForJNI(allowMultithread = true, stubName = "GetSampleTimeJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "GetSampleTimeJavaProfiling")
public synchronized static double getSampleTime(int aThreadId, int aSampleId) {
Sample sample = getSample(aThreadId, aSampleId);
if (sample != null) {
@ -152,7 +152,7 @@ public class GeckoJavaSampler {
return 0;
}
@WrapElementForJNI(allowMultithread = true, stubName = "GetFrameNameJavaProfilingWrapper")
@WrapForJNI(allowMultithread = true, stubName = "GetFrameNameJavaProfilingWrapper")
public synchronized static String getFrameName(int aThreadId, int aSampleId, int aFrameId) {
Sample sample = getSample(aThreadId, aSampleId);
if (sample != null && aFrameId < sample.mFrames.length) {
@ -165,7 +165,7 @@ public class GeckoJavaSampler {
return null;
}
@WrapElementForJNI(allowMultithread = true, stubName = "StartJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "StartJavaProfiling")
public static void start(int aInterval, int aSamples) {
synchronized (GeckoJavaSampler.class) {
if (sSamplingRunnable != null) {
@ -177,21 +177,21 @@ public class GeckoJavaSampler {
}
}
@WrapElementForJNI(allowMultithread = true, stubName = "PauseJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "PauseJavaProfiling")
public static void pause() {
synchronized (GeckoJavaSampler.class) {
sSamplingRunnable.mPauseSampler = true;
}
}
@WrapElementForJNI(allowMultithread = true, stubName = "UnpauseJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "UnpauseJavaProfiling")
public static void unpause() {
synchronized (GeckoJavaSampler.class) {
sSamplingRunnable.mPauseSampler = false;
}
}
@WrapElementForJNI(allowMultithread = true, stubName = "StopJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "StopJavaProfiling")
public static void stop() {
synchronized (GeckoJavaSampler.class) {
if (sSamplingThread == null) {

Просмотреть файл

@ -5,9 +5,9 @@
package org.mozilla.gecko;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.restrictions.DefaultConfiguration;
import org.mozilla.gecko.restrictions.GuestProfileConfiguration;
import org.mozilla.gecko.restrictions.RestrictedProfileConfiguration;
@ -90,7 +90,7 @@ public class RestrictedProfiles {
return getConfiguration(context).canLoadUrl(url);
}
@WrapElementForJNI
@WrapForJNI
public static boolean isUserRestricted() {
return isUserRestricted(GeckoAppShell.getContext());
}
@ -103,7 +103,7 @@ public class RestrictedProfiles {
return getConfiguration(context).isAllowed(restriction);
}
@WrapElementForJNI
@WrapForJNI
public static boolean isAllowed(int action, String url) {
final Restriction restriction;
try {

Просмотреть файл

@ -4,11 +4,11 @@
package org.mozilla.gecko;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import java.nio.ByteBuffer;
@WrapElementForJNI
@WrapForJNI
public class SurfaceBits {
public int width;
public int height;

Просмотреть файл

@ -5,9 +5,9 @@
package org.mozilla.gecko;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.gfx.BitmapUtils;
import org.mozilla.gecko.mozglue.DirectBufferAllocator;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.content.res.Resources;
import android.graphics.Bitmap;
@ -153,7 +153,7 @@ public final class ThumbnailHelper {
}
/* This method is invoked by JNI once the thumbnail data is ready. */
@WrapElementForJNI(stubName = "SendThumbnail")
@WrapForJNI(stubName = "SendThumbnail")
public static void notifyThumbnail(ByteBuffer data, int tabId, boolean success, boolean shouldStore) {
Tab tab = Tabs.getInstance().getTab(tabId);
ThumbnailHelper helper = ThumbnailHelper.getInstance();

Просмотреть файл

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.mozglue.generatorannotations;
package org.mozilla.gecko.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@ -24,7 +24,7 @@ import java.lang.annotation.Target;
*/
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface WrapElementForJNI {
public @interface WrapForJNI {
// Optional parameter specifying the name of the generated method stub. If omitted, the name
// of the Java method will be used.
String stubName() default "";

Просмотреть файл

@ -5,7 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.util.FloatUtils;
import android.graphics.RectF;
@ -19,16 +19,16 @@ import android.graphics.RectF;
* subsection of that with compositor scaling.
*/
public final class DisplayPortMetrics {
@WrapElementForJNI
@WrapForJNI
public final float resolution;
@WrapElementForJNI
@WrapForJNI
private final RectF mPosition;
public DisplayPortMetrics() {
this(0, 0, 0, 0, 1);
}
@WrapElementForJNI
@WrapForJNI
public DisplayPortMetrics(float left, float top, float right, float bottom, float resolution) {
this.resolution = resolution;
mPosition = new RectF(left, top, right, bottom);

Просмотреть файл

@ -5,11 +5,11 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoThread;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.util.ThreadUtils;
import android.util.Log;
@ -250,7 +250,7 @@ public class GLController {
return mEGLSurfaceForCompositor != null;
}
@WrapElementForJNI(allowMultithread = true, stubName = "CreateEGLSurfaceForCompositorWrapper")
@WrapForJNI(allowMultithread = true, stubName = "CreateEGLSurfaceForCompositorWrapper")
private synchronized EGLSurface createEGLSurfaceForCompositor() {
AttemptPreallocateEGLSurfaceForCompositor();
EGLSurface result = mEGLSurfaceForCompositor;

Просмотреть файл

@ -5,6 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.gfx.LayerView.DrawListener;
@ -12,7 +13,6 @@ import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.ZoomConstraints;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.util.FloatUtils;
import org.mozilla.gecko.AppConstants;
@ -436,7 +436,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
return mDisplayPort;
}
@WrapElementForJNI
@WrapForJNI
DisplayPortMetrics getDisplayPort(boolean pageSizeUpdate, boolean isBrowserContentDisplayed, int tabId, ImmutableViewportMetrics metrics) {
Tabs tabs = Tabs.getInstance();
if (isBrowserContentDisplayed && tabs.isSelectedTabId(tabId)) {
@ -453,12 +453,12 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
}
}
@WrapElementForJNI
@WrapForJNI
void contentDocumentChanged() {
mContentDocumentIsDisplayed = false;
}
@WrapElementForJNI
@WrapForJNI
boolean isContentDocumentDisplayed() {
return mContentDocumentIsDisplayed;
}
@ -468,7 +468,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
// to abort the current update and continue with any subsequent ones. This
// is useful for slow-to-render pages when the display-port starts lagging
// behind enough that continuing to draw it is wasted effort.
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ProgressiveUpdateData progressiveUpdateCallback(boolean aHasPendingNewThebesContent,
float x, float y, float width, float height,
float resolution, boolean lowPrecision) {
@ -582,7 +582,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
* viewport information provided. setPageRect will never be invoked on the same frame that
* this function is invoked on; and this function will always be called prior to syncViewportInfo.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void setFirstPaintViewport(float offsetX, float offsetY, float zoom,
float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
synchronized (getLock()) {
@ -642,7 +642,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
* is invoked on a frame, then this function will not be. For any given frame, this
* function will be invoked before syncViewportInfo.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void setPageRect(float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
synchronized (getLock()) {
RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
@ -663,7 +663,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
* every time we're called. NOTE: we might be able to return a ImmutableViewportMetrics
* which would avoid the copy into mCurrentViewTransform.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ViewTransform syncViewportInfo(int x, int y, int width, int height, float resolution, boolean layersUpdated) {
// getViewportMetrics is thread safe so we don't need to synchronize.
// We save the viewport metrics here, so we later use it later in
@ -720,7 +720,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
return mCurrentViewTransform;
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ViewTransform syncFrameMetrics(float offsetX, float offsetY, float zoom,
float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom,
boolean layersUpdated, int x, int y, int width, int height, float resolution,
@ -734,7 +734,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
return syncViewportInfo(x, y, width, height, resolution, layersUpdated);
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public LayerRenderer.Frame createFrame() {
// Create the shaders and textures if necessary.
if (!mLayerRendererInitialized) {
@ -754,12 +754,12 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
}
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void activateProgram() {
mLayerRenderer.activateDefaultProgram();
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void deactivateProgramAndRestoreState(boolean enableScissor,
int scissorX, int scissorY, int scissorW, int scissorH)
{

Просмотреть файл

@ -5,7 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.util.FloatUtils;
import android.graphics.PointF;
@ -53,7 +53,7 @@ public class ImmutableViewportMetrics {
/** This constructor is used by native code in AndroidJavaWrappers.cpp, be
* careful when modifying the signature.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ImmutableViewportMetrics(float aPageRectLeft, float aPageRectTop,
float aPageRectRight, float aPageRectBottom, float aCssPageRectLeft,
float aCssPageRectTop, float aCssPageRectRight, float aCssPageRectBottom,

Просмотреть файл

@ -10,6 +10,7 @@ import java.nio.IntBuffer;
import java.util.ArrayList;
import org.mozilla.gecko.AndroidGamepadManager;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.GeckoAccessibility;
@ -20,7 +21,6 @@ import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.ZoomConstraints;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.content.Context;
import android.graphics.Bitmap;
@ -515,7 +515,7 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
return mTextureView.getSurfaceTexture();
}
@WrapElementForJNI(allowMultithread = true, stubName = "RegisterCompositorWrapper")
@WrapForJNI(allowMultithread = true, stubName = "RegisterCompositorWrapper")
public static GLController registerCxxCompositor() {
try {
LayerView layerView = GeckoAppShell.getLayerView();
@ -529,7 +529,7 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
}
//This method is called on the Gecko main thread.
@WrapElementForJNI(allowMultithread = true, stubName = "updateZoomedView")
@WrapForJNI(allowMultithread = true, stubName = "updateZoomedView")
public static void updateZoomedView(ByteBuffer data) {
LayerView layerView = GeckoAppShell.getLayerView();
if (layerView != null) {

Просмотреть файл

@ -5,9 +5,9 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoThread;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.util.GeckoEventListener;
@ -97,7 +97,7 @@ class NativePanZoomController implements PanZoomController, GeckoEventListener {
@Override
public native int getOverScrollMode();
@WrapElementForJNI(allowMultithread = true, stubName = "RequestContentRepaintWrapper")
@WrapForJNI(allowMultithread = true, stubName = "RequestContentRepaintWrapper")
private void requestContentRepaint(float x, float y, float width, float height, float resolution) {
mTarget.forceRedraw(new DisplayPortMetrics(x, y, x + width, y + height, resolution));
}

Просмотреть файл

@ -5,7 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
/**
* This is the data structure that's returned by the progressive tile update
@ -13,7 +13,7 @@ import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
* representing whether the front-end is interested in the current progressive
* update continuing.
*/
@WrapElementForJNI
@WrapForJNI
public class ProgressiveUpdateData {
public float x;
public float y;

Просмотреть файл

@ -5,9 +5,9 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
@WrapElementForJNI
@WrapForJNI
public class ViewTransform {
public float x;
public float y;

Просмотреть файл

@ -14,6 +14,7 @@ thirdparty_source_dir = TOPSRCDIR + '/mobile/android/thirdparty/'
constants_jar = add_java_jar('constants')
constants_jar.sources = [
'adjust/AdjustHelperInterface.java',
'annotation/WrapForJNI.java',
'SysInfo.java',
]
constants_jar.generated_sources = [
@ -54,7 +55,6 @@ mgjar.sources += [
'mozglue/ContextUtils.java',
'mozglue/DirectBufferAllocator.java',
'mozglue/GeckoLoader.java',
'mozglue/generatorannotations/WrapElementForJNI.java',
'mozglue/JNIObject.java',
'mozglue/JNITarget.java',
'mozglue/NativeReference.java',
@ -133,6 +133,7 @@ if CONFIG['MOZ_WEBRTC']:
audio_root + 'WebRtcAudioTrack.java',
]
wrjar.extra_jars = [
'constants.jar',
'gecko-R.jar',
'gecko-browser.jar',
'gecko-util.jar',

Просмотреть файл

@ -5,7 +5,7 @@
package org.mozilla.gecko.mozglue;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.mozglue.JNITarget;
import java.io.InputStream;
import java.nio.ByteBuffer;
@ -69,7 +69,7 @@ public class NativeZip implements NativeReference {
private static native void _release(long obj);
private native InputStream _getInputStream(long obj, String path);
@WrapElementForJNI
@JNITarget
private InputStream createInputStream(ByteBuffer buffer, int compression) {
if (compression != STORE && compression != DEFLATE) {
throw new IllegalArgumentException("Unexpected compression: " + compression);

Просмотреть файл

@ -20,8 +20,8 @@ package org.mozilla.gecko.sqlite;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.database.AbstractCursor;
import android.database.CursorIndexOutOfBoundsException;
@ -56,7 +56,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* determines column ordering elsewhere in this cursor
* @param initialCapacity in rows
*/
@WrapElementForJNI
@WrapForJNI
public MatrixBlobCursor(String[] columnNames, int initialCapacity) {
this.columnNames = columnNames;
this.columnCount = columnNames.length;
@ -77,7 +77,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* @param columnNames names of the columns, the ordering of which
* determines column ordering elsewhere in this cursor
*/
@WrapElementForJNI
@WrapForJNI
public MatrixBlobCursor(String[] columnNames) {
this(columnNames, 16);
}
@ -132,7 +132,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* @param columnValues in the same order as the the column names specified
* at cursor construction time
*/
@WrapElementForJNI
@WrapForJNI
public void addRow(Object[] columnValues) {
if (columnValues.length != columnCount) {
throw new IllegalArgumentException("columnNames.length = "
@ -154,7 +154,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* @param columnValues in the same order as the the column names specified
* at cursor construction time
*/
@WrapElementForJNI
@WrapForJNI
public void addRow(Iterable<?> columnValues) {
final int start = rowCount * columnCount;
@ -188,7 +188,7 @@ public class MatrixBlobCursor extends AbstractCursor {
}
/** Optimization for {@link ArrayList}. */
@WrapElementForJNI
@WrapForJNI
private void addRow(ArrayList<?> columnValues, int start) {
final int size = columnValues.size();
if (size != columnCount) {

Просмотреть файл

@ -5,9 +5,9 @@
package org.mozilla.gecko.sqlite;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
@WrapElementForJNI
@WrapForJNI
public class SQLiteBridgeException extends RuntimeException {
static final long serialVersionUID = 1L;

Просмотреть файл

@ -6,8 +6,8 @@ package org.mozilla.gecko.util;
import java.util.concurrent.SynchronousQueue;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.content.ClipData;
import android.content.Context;
@ -32,7 +32,7 @@ public final class Clipboard {
mContext = c.getApplicationContext();
}
@WrapElementForJNI(stubName = "GetClipboardTextWrapper")
@WrapForJNI(stubName = "GetClipboardTextWrapper")
public static String getText() {
// If we're on the UI thread or the background thread, we have a looper on the thread
// and can just call this directly. For any other threads, post the call to the
@ -59,7 +59,7 @@ public final class Clipboard {
}
}
@WrapElementForJNI(stubName = "SetClipboardText")
@WrapForJNI(stubName = "SetClipboardText")
public static void setText(final CharSequence text) {
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
@ -90,7 +90,7 @@ public final class Clipboard {
/**
* @return true if the clipboard is nonempty, false otherwise.
*/
@WrapElementForJNI
@WrapForJNI
public static boolean hasText() {
if (Versions.feature11Plus) {
android.content.ClipboardManager cm = (android.content.ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
@ -105,7 +105,7 @@ public final class Clipboard {
/**
* Deletes all text from the clipboard.
*/
@WrapElementForJNI
@WrapForJNI
public static void clearText() {
setText(null);
}

Просмотреть файл

@ -5,7 +5,7 @@
package org.mozilla.gecko.util;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.mozglue.JNITarget;
/**
@ -16,8 +16,7 @@ import org.mozilla.gecko.mozglue.JNITarget;
* thread, call {@link #clone()} to make a copy, and use the copy on the other thread.
* When a copy is first used, it becomes attached to the thread using it.
*/
@JNITarget
@WrapElementForJNI
@WrapForJNI
public final class NativeJSContainer extends NativeJSObject
{
private NativeJSContainer() {

Просмотреть файл

@ -5,7 +5,7 @@
package org.mozilla.gecko.util;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.mozglue.JNIObject;
import org.mozilla.gecko.mozglue.JNITarget;
@ -15,8 +15,7 @@ import android.os.Bundle;
* NativeJSObject is a wrapper around the SpiderMonkey JSAPI to make it possible to
* access Javascript objects in Java.
*/
@JNITarget
@WrapElementForJNI
@WrapForJNI
public class NativeJSObject extends JNIObject
{
@SuppressWarnings("serial")

Просмотреть файл

@ -179,20 +179,20 @@
}
# Keep generator-targeted entry points.
-keep @interface org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI
-keep @org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI class *
-keep @interface org.mozilla.gecko.annotation.WrapForJNI
-keep @org.mozilla.gecko.annotation.WrapForJNI class *
-keepclassmembers class * {
@org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI *;
@org.mozilla.gecko.annotation.WrapForJNI *;
}
-keepclasseswithmembers class * {
@org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI <methods>;
@org.mozilla.gecko.annotation.WrapForJNI <methods>;
}
-keepclasseswithmembers class * {
@org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI <fields>;
@org.mozilla.gecko.annotation.WrapForJNI <fields>;
}
# Keep all members of an annotated class.
-keepclassmembers @org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI class * {
-keepclassmembers @org.mozilla.gecko.annotation.WrapForJNI class * {
*;
}