diff options
Diffstat (limited to 'base/android')
53 files changed, 0 insertions, 14726 deletions
diff --git a/base/android/build_info.cc b/base/android/build_info.cc deleted file mode 100644 index 869c703..0000000 --- a/base/android/build_info.cc +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/build_info.h" - -#include <string> - -#include "base/android/jni_android.h" -#include "base/android/jni_string.h" -#include "base/android/scoped_java_ref.h" -#include "base/logging.h" -#include "base/memory/singleton.h" -#include "jni/BuildInfo_jni.h" - -namespace { - -// We are leaking these strings. -const char* StrDupJString(const base::android::JavaRef<jstring>& java_string) { - std::string str = ConvertJavaStringToUTF8(java_string); - return strdup(str.c_str()); -} - -} // namespace - -namespace base { -namespace android { - -struct BuildInfoSingletonTraits { - static BuildInfo* New() { - return new BuildInfo(AttachCurrentThread()); - } - - static void Delete(BuildInfo* x) { - // We're leaking this type, see kRegisterAtExit. - NOTREACHED(); - } - - static const bool kRegisterAtExit = false; -#if DCHECK_IS_ON() - static const bool kAllowedToAccessOnNonjoinableThread = true; -#endif -}; - -BuildInfo::BuildInfo(JNIEnv* env) - : device_(StrDupJString(Java_BuildInfo_getDevice(env))), - manufacturer_(StrDupJString(Java_BuildInfo_getDeviceManufacturer(env))), - model_(StrDupJString(Java_BuildInfo_getDeviceModel(env))), - brand_(StrDupJString(Java_BuildInfo_getBrand(env))), - android_build_id_(StrDupJString(Java_BuildInfo_getAndroidBuildId(env))), - android_build_fp_( - StrDupJString(Java_BuildInfo_getAndroidBuildFingerprint(env))), - gms_version_code_(StrDupJString(Java_BuildInfo_getGMSVersionCode(env))), - package_version_code_( - StrDupJString(Java_BuildInfo_getPackageVersionCode(env))), - package_version_name_( - StrDupJString(Java_BuildInfo_getPackageVersionName(env))), - package_label_(StrDupJString(Java_BuildInfo_getPackageLabel(env))), - package_name_(StrDupJString(Java_BuildInfo_getPackageName(env))), - build_type_(StrDupJString(Java_BuildInfo_getBuildType(env))), - sdk_int_(Java_BuildInfo_getSdkInt(env)), - java_exception_info_(NULL) {} - -// static -BuildInfo* BuildInfo::GetInstance() { - return Singleton<BuildInfo, BuildInfoSingletonTraits >::get(); -} - -void BuildInfo::SetJavaExceptionInfo(const std::string& info) { - DCHECK(!java_exception_info_) << "info should be set only once."; - java_exception_info_ = strndup(info.c_str(), 4096); -} - -void BuildInfo::ClearJavaExceptionInfo() { - delete java_exception_info_; - java_exception_info_ = nullptr; -} - -} // namespace android -} // namespace base diff --git a/base/android/build_info.h b/base/android/build_info.h deleted file mode 100644 index cce74f4..0000000 --- a/base/android/build_info.h +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_BUILD_INFO_H_ -#define BASE_ANDROID_BUILD_INFO_H_ - -#include <jni.h> - -#include <string> - -#include "base/base_export.h" -#include "base/macros.h" -#include "base/memory/singleton.h" - -namespace base { -namespace android { - -// This enumeration maps to the values returned by BuildInfo::sdk_int(), -// indicating the Android release associated with a given SDK version. -enum SdkVersion { - SDK_VERSION_JELLY_BEAN = 16, - SDK_VERSION_JELLY_BEAN_MR1 = 17, - SDK_VERSION_JELLY_BEAN_MR2 = 18, - SDK_VERSION_KITKAT = 19, - SDK_VERSION_KITKAT_WEAR = 20, - SDK_VERSION_LOLLIPOP = 21, - SDK_VERSION_LOLLIPOP_MR1 = 22, - SDK_VERSION_MARSHMALLOW = 23, - SDK_VERSION_NOUGAT = 24 -}; - -// BuildInfo is a singleton class that stores android build and device -// information. It will be called from Android specific code and gets used -// primarily in crash reporting. - -// It is also used to store the last java exception seen during JNI. -// TODO(nileshagrawal): Find a better place to store this info. -class BASE_EXPORT BuildInfo { - public: - - ~BuildInfo() {} - - // Static factory method for getting the singleton BuildInfo instance. - // Note that ownership is not conferred on the caller and the BuildInfo in - // question isn't actually freed until shutdown. This is ok because there - // should only be one instance of BuildInfo ever created. - static BuildInfo* GetInstance(); - - // Const char* is used instead of std::strings because these values must be - // available even if the process is in a crash state. Sadly - // std::string.c_str() doesn't guarantee that memory won't be allocated when - // it is called. - const char* device() const { - return device_; - } - - const char* manufacturer() const { - return manufacturer_; - } - - const char* model() const { - return model_; - } - - const char* brand() const { - return brand_; - } - - const char* android_build_id() const { - return android_build_id_; - } - - const char* android_build_fp() const { - return android_build_fp_; - } - - const char* gms_version_code() const { - return gms_version_code_; - } - - const char* package_version_code() const { - return package_version_code_; - } - - const char* package_version_name() const { - return package_version_name_; - } - - const char* package_label() const { - return package_label_; - } - - const char* package_name() const { - return package_name_; - } - - const char* build_type() const { - return build_type_; - } - - int sdk_int() const { - return sdk_int_; - } - - const char* java_exception_info() const { - return java_exception_info_; - } - - void SetJavaExceptionInfo(const std::string& info); - - void ClearJavaExceptionInfo(); - - private: - friend struct BuildInfoSingletonTraits; - - explicit BuildInfo(JNIEnv* env); - - // Const char* is used instead of std::strings because these values must be - // available even if the process is in a crash state. Sadly - // std::string.c_str() doesn't guarantee that memory won't be allocated when - // it is called. - const char* const device_; - const char* const manufacturer_; - const char* const model_; - const char* const brand_; - const char* const android_build_id_; - const char* const android_build_fp_; - const char* const gms_version_code_; - const char* const package_version_code_; - const char* const package_version_name_; - const char* const package_label_; - const char* const package_name_; - const char* const build_type_; - const int sdk_int_; - // This is set via set_java_exception_info, not at constructor time. - const char* java_exception_info_; - - DISALLOW_COPY_AND_ASSIGN(BuildInfo); -}; - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_BUILD_INFO_H_ diff --git a/base/android/context_utils.cc b/base/android/context_utils.cc deleted file mode 100644 index e2c4ed0..0000000 --- a/base/android/context_utils.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/context_utils.h" - -#include <jni.h> - -#include "base/android/scoped_java_ref.h" -#include "base/lazy_instance.h" -#include "jni/ContextUtils_jni.h" - -using base::android::JavaRef; - -namespace base { -namespace android { - -namespace { - -// Leak the global app context, as it is used from a non-joinable worker thread -// that may still be running at shutdown. There is no harm in doing this. -base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject>>::Leaky - g_application_context = LAZY_INSTANCE_INITIALIZER; - -void SetNativeApplicationContext(JNIEnv* env, const JavaRef<jobject>& context) { - if (env->IsSameObject(g_application_context.Get().obj(), context.obj())) { - // It's safe to set the context more than once if it's the same context. - return; - } - DCHECK(g_application_context.Get().is_null()); - g_application_context.Get().Reset(context); -} - -} // namespace - -const JavaRef<jobject>& GetApplicationContext() { - DCHECK(!g_application_context.Get().is_null()); - return g_application_context.Get(); -} - -static void InitNativeSideApplicationContext( - JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jobject>& context) { - SetNativeApplicationContext(env, context); -} - -bool RegisterContextUtils(JNIEnv* env) { - return RegisterNativesImpl(env); -} - -} // namespace android -} // namespace base diff --git a/base/android/context_utils.h b/base/android/context_utils.h deleted file mode 100644 index c5289f1..0000000 --- a/base/android/context_utils.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_CONTEXT_UTILS_H_ -#define BASE_ANDROID_CONTEXT_UTILS_H_ - -#include <jni.h> - -#include "base/android/scoped_java_ref.h" -#include "base/base_export.h" - -namespace base { -namespace android { - -// Gets a global ref to the application context set with -// InitApplicationContext(). Ownership is retained by the function - the caller -// must NOT release it. -BASE_EXPORT const JavaRef<jobject>& GetApplicationContext(); - -bool RegisterContextUtils(JNIEnv* env); - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_CONTEXT_UTILS_H_ diff --git a/base/android/java/src/org/chromium/base/BuildInfo.java b/base/android/java/src/org/chromium/base/BuildInfo.java deleted file mode 100644 index de4ad08..0000000 --- a/base/android/java/src/org/chromium/base/BuildInfo.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base; - -import android.content.Context; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.PackageManager.NameNotFoundException; -import android.os.Build; -import android.os.StrictMode; - -import org.chromium.base.annotations.CalledByNative; - -/** - * BuildInfo is a utility class providing easy access to {@link PackageInfo} information. This is - * primarily of use for accessing package information from native code. - */ -public class BuildInfo { - private static final String TAG = "BuildInfo"; - private static final int MAX_FINGERPRINT_LENGTH = 128; - - /** - * BuildInfo is a static utility class and therefore shouldn't be instantiated. - */ - private BuildInfo() {} - - @CalledByNative - public static String getDevice() { - return Build.DEVICE; - } - - @CalledByNative - public static String getBrand() { - return Build.BRAND; - } - - @CalledByNative - public static String getAndroidBuildId() { - return Build.ID; - } - - /** - * @return The build fingerprint for the current Android install. The value is truncated to a - * 128 characters as this is used for crash and UMA reporting, which should avoid huge - * strings. - */ - @CalledByNative - public static String getAndroidBuildFingerprint() { - return Build.FINGERPRINT.substring( - 0, Math.min(Build.FINGERPRINT.length(), MAX_FINGERPRINT_LENGTH)); - } - - @CalledByNative - public static String getDeviceManufacturer() { - return Build.MANUFACTURER; - } - - @CalledByNative - public static String getDeviceModel() { - return Build.MODEL; - } - - @CalledByNative - public static String getGMSVersionCode() { - String msg = "gms versionCode not available."; - try { - PackageManager packageManager = - ContextUtils.getApplicationContext().getPackageManager(); - PackageInfo packageInfo = packageManager.getPackageInfo("com.google.android.gms", 0); - msg = Integer.toString(packageInfo.versionCode); - } catch (NameNotFoundException e) { - Log.d(TAG, "GMS package is not found.", e); - } - return msg; - } - - @CalledByNative - public static String getPackageVersionCode() { - String msg = "versionCode not available."; - try { - PackageManager pm = ContextUtils.getApplicationContext().getPackageManager(); - PackageInfo pi = pm.getPackageInfo(getPackageName(), 0); - msg = ""; - if (pi.versionCode > 0) { - msg = Integer.toString(pi.versionCode); - } - } catch (NameNotFoundException e) { - Log.d(TAG, msg); - } - return msg; - } - - @CalledByNative - public static String getPackageVersionName() { - String msg = "versionName not available"; - try { - PackageManager pm = ContextUtils.getApplicationContext().getPackageManager(); - PackageInfo pi = pm.getPackageInfo(getPackageName(), 0); - msg = ""; - if (pi.versionName != null) { - msg = pi.versionName; - } - } catch (NameNotFoundException e) { - Log.d(TAG, msg); - } - return msg; - } - - @CalledByNative - public static String getPackageLabel() { - // Third-party code does disk read on the getApplicationInfo call. http://crbug.com/614343 - StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); - try { - PackageManager packageManager = - ContextUtils.getApplicationContext().getPackageManager(); - ApplicationInfo appInfo = packageManager.getApplicationInfo( - getPackageName(), PackageManager.GET_META_DATA); - CharSequence label = packageManager.getApplicationLabel(appInfo); - return label != null ? label.toString() : ""; - } catch (NameNotFoundException e) { - return ""; - } finally { - StrictMode.setThreadPolicy(oldPolicy); - } - } - - @CalledByNative - public static String getPackageName() { - if (ContextUtils.getApplicationContext() == null) { - return ""; - } - return ContextUtils.getApplicationContext().getPackageName(); - } - - @CalledByNative - public static String getBuildType() { - return Build.TYPE; - } - - /** - * Check if this is a debuggable build of Android. Use this to enable developer-only features. - */ - public static boolean isDebugAndroid() { - return "eng".equals(Build.TYPE) || "userdebug".equals(Build.TYPE); - } - - @CalledByNative - public static int getSdkInt() { - return Build.VERSION.SDK_INT; - } - - /** - * @return Whether the current device is running Android O release or newer. - */ - public static boolean isAtLeastO() { - return !"REL".equals(Build.VERSION.CODENAME) - && ("O".equals(Build.VERSION.CODENAME) || Build.VERSION.CODENAME.startsWith("OMR")); - } - - /** - * @return Whether the current app targets the SDK for at least O - */ - public static boolean targetsAtLeastO(Context appContext) { - return isAtLeastO() - && appContext.getApplicationInfo().targetSdkVersion - == Build.VERSION_CODES.CUR_DEVELOPMENT; - } -} diff --git a/base/android/java/src/org/chromium/base/ContextUtils.java b/base/android/java/src/org/chromium/base/ContextUtils.java deleted file mode 100644 index 448eff9..0000000 --- a/base/android/java/src/org/chromium/base/ContextUtils.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base; - -import android.content.Context; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; - -import org.chromium.base.annotations.JNINamespace; -import org.chromium.base.annotations.MainDex; - -/** - * This class provides Android application context related utility methods. - */ -@JNINamespace("base::android") -@MainDex -public class ContextUtils { - private static final String TAG = "ContextUtils"; - private static Context sApplicationContext; - - /** - * Initialization-on-demand holder. This exists for thread-safe lazy initialization. - */ - private static class Holder { - // Not final for tests. - private static SharedPreferences sSharedPreferences = fetchAppSharedPreferences(); - } - - /** - * Get the Android application context. - * - * Under normal circumstances there is only one application context in a process, so it's safe - * to treat this as a global. In WebView it's possible for more than one app using WebView to be - * running in a single process, but this mechanism is rarely used and this is not the only - * problem in that scenario, so we don't currently forbid using it as a global. - * - * Do not downcast the context returned by this method to Application (or any subclass). It may - * not be an Application object; it may be wrapped in a ContextWrapper. The only assumption you - * may make is that it is a Context whose lifetime is the same as the lifetime of the process. - */ - public static Context getApplicationContext() { - return sApplicationContext; - } - - /** - * Initializes the java application context. - * - * This should be called exactly once early on during startup, before native is loaded and - * before any other clients make use of the application context through this class. - * - * @param appContext The application context. - */ - public static void initApplicationContext(Context appContext) { - // Conceding that occasionally in tests, native is loaded before the browser process is - // started, in which case the browser process re-sets the application context. - if (sApplicationContext != null && sApplicationContext != appContext) { - throw new RuntimeException("Attempting to set multiple global application contexts."); - } - initJavaSideApplicationContext(appContext); - } - - /** - * Initialize the native Android application context to be the same as the java counter-part. - */ - public static void initApplicationContextForNative() { - if (sApplicationContext == null) { - throw new RuntimeException("Cannot have native global application context be null."); - } - nativeInitNativeSideApplicationContext(sApplicationContext); - } - - /** - * Only called by the static holder class and tests. - * - * @return The application-wide shared preferences. - */ - private static SharedPreferences fetchAppSharedPreferences() { - return PreferenceManager.getDefaultSharedPreferences(sApplicationContext); - } - - /** - * This is used to ensure that we always use the application context to fetch the default shared - * preferences. This avoids needless I/O for android N and above. It also makes it clear that - * the app-wide shared preference is desired, rather than the potentially context-specific one. - * - * @return application-wide shared preferences. - */ - public static SharedPreferences getAppSharedPreferences() { - return Holder.sSharedPreferences; - } - - /** - * Occasionally tests cannot ensure the application context doesn't change between tests (junit) - * and sometimes specific tests has its own special needs, initApplicationContext should be used - * as much as possible, but this method can be used to override it. - * - * @param appContext The new application context. - */ - @VisibleForTesting - public static void initApplicationContextForTests(Context appContext) { - initJavaSideApplicationContext(appContext); - Holder.sSharedPreferences = fetchAppSharedPreferences(); - } - - private static void initJavaSideApplicationContext(Context appContext) { - if (appContext == null) { - throw new RuntimeException("Global application context cannot be set to null."); - } - sApplicationContext = appContext; - } - - private static native void nativeInitNativeSideApplicationContext(Context appContext); -} diff --git a/base/android/java/src/org/chromium/base/Log.java b/base/android/java/src/org/chromium/base/Log.java deleted file mode 100644 index 399f16d..0000000 --- a/base/android/java/src/org/chromium/base/Log.java +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base; - -import org.chromium.base.annotations.RemovableInRelease; - -import java.util.Locale; - -/** - * Utility class for Logging. - * - * <p> - * Defines logging access points for each feature. They format and forward the logs to - * {@link android.util.Log}, allowing to standardize the output, to make it easy to identify - * the origin of logs, and enable or disable logging in different parts of the code. - * </p> - * <p> - * Usage documentation: {@code //docs/android_logging.md}. - * </p> - */ -public class Log { - /** Convenience property, same as {@link android.util.Log#ASSERT}. */ - public static final int ASSERT = android.util.Log.ASSERT; - - /** Convenience property, same as {@link android.util.Log#DEBUG}. */ - public static final int DEBUG = android.util.Log.DEBUG; - - /** Convenience property, same as {@link android.util.Log#ERROR}. */ - public static final int ERROR = android.util.Log.ERROR; - - /** Convenience property, same as {@link android.util.Log#INFO}. */ - public static final int INFO = android.util.Log.INFO; - - /** Convenience property, same as {@link android.util.Log#VERBOSE}. */ - public static final int VERBOSE = android.util.Log.VERBOSE; - - /** Convenience property, same as {@link android.util.Log#WARN}. */ - public static final int WARN = android.util.Log.WARN; - - private static final String sTagPrefix = "cr_"; - private static final String sDeprecatedTagPrefix = "cr."; - - private Log() { - // Static only access - } - - /** Returns a formatted log message, using the supplied format and arguments.*/ - private static String formatLog(String messageTemplate, Object... params) { - if (params != null && params.length != 0) { - messageTemplate = String.format(Locale.US, messageTemplate, params); - } - - return messageTemplate; - } - - /** - * Returns a normalized tag that will be in the form: "cr_foo". This function is called by the - * various Log overrides. If using {@link #isLoggable(String, int)}, you might want to call it - * to get the tag that will actually be used. - * @see #sTagPrefix - */ - public static String normalizeTag(String tag) { - if (tag.startsWith(sTagPrefix)) return tag; - - // TODO(dgn) simplify this once 'cr.' is out of the repo (http://crbug.com/533072) - int unprefixedTagStart = 0; - if (tag.startsWith(sDeprecatedTagPrefix)) { - unprefixedTagStart = sDeprecatedTagPrefix.length(); - } - - return sTagPrefix + tag.substring(unprefixedTagStart, tag.length()); - } - - /** - * Returns a formatted log message, using the supplied format and arguments. - * The message will be prepended with the filename and line number of the call. - */ - private static String formatLogWithStack(String messageTemplate, Object... params) { - return "[" + getCallOrigin() + "] " + formatLog(messageTemplate, params); - } - - /** - * Convenience function, forwards to {@link android.util.Log#isLoggable(String, int)}. - * - * Note: Has no effect on whether logs are sent or not. Use a method with - * {@link RemovableInRelease} to log something in Debug builds only. - */ - public static boolean isLoggable(String tag, int level) { - return android.util.Log.isLoggable(tag, level); - } - - /** - * Sends a {@link android.util.Log#VERBOSE} log message. - * - * For optimization purposes, only the fixed parameters versions are visible. If you need more - * than 7 parameters, consider building your log message using a function annotated with - * {@link RemovableInRelease}. - * - * @param tag Used to identify the source of a log message. Might be modified in the output - * (see {@link #normalizeTag(String)}) - * @param messageTemplate The message you would like logged. It is to be specified as a format - * string. - * @param args Arguments referenced by the format specifiers in the format string. If the last - * one is a {@link Throwable}, its trace will be printed. - */ - private static void verbose(String tag, String messageTemplate, Object... args) { - String message = formatLogWithStack(messageTemplate, args); - Throwable tr = getThrowableToLog(args); - if (tr != null) { - android.util.Log.v(normalizeTag(tag), message, tr); - } else { - android.util.Log.v(normalizeTag(tag), message); - } - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 0 args version. */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String message) { - verbose(tag, message); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 1 arg version. */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String messageTemplate, Object arg1) { - verbose(tag, messageTemplate, arg1); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 2 args version */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String messageTemplate, Object arg1, Object arg2) { - verbose(tag, messageTemplate, arg1, arg2); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 3 args version */ - @RemovableInRelease - @VisibleForTesting - public static void v( - String tag, String messageTemplate, Object arg1, Object arg2, Object arg3) { - verbose(tag, messageTemplate, arg1, arg2, arg3); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 4 args version */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4) { - verbose(tag, messageTemplate, arg1, arg2, arg3, arg4); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 5 args version */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4, Object arg5) { - verbose(tag, messageTemplate, arg1, arg2, arg3, arg4, arg5); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 6 args version */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4, Object arg5, Object arg6) { - verbose(tag, messageTemplate, arg1, arg2, arg3, arg4, arg5, arg6); - } - - /** Sends a {@link android.util.Log#VERBOSE} log message. 7 args version */ - @RemovableInRelease - @VisibleForTesting - public static void v(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4, Object arg5, Object arg6, Object arg7) { - verbose(tag, messageTemplate, arg1, arg2, arg3, arg4, arg5, arg6, arg7); - } - - /** - * Sends a {@link android.util.Log#DEBUG} log message. - * - * For optimization purposes, only the fixed parameters versions are visible. If you need more - * than 7 parameters, consider building your log message using a function annotated with - * {@link RemovableInRelease}. - * - * @param tag Used to identify the source of a log message. Might be modified in the output - * (see {@link #normalizeTag(String)}) - * @param messageTemplate The message you would like logged. It is to be specified as a format - * string. - * @param args Arguments referenced by the format specifiers in the format string. If the last - * one is a {@link Throwable}, its trace will be printed. - */ - private static void debug(String tag, String messageTemplate, Object... args) { - String message = formatLogWithStack(messageTemplate, args); - Throwable tr = getThrowableToLog(args); - if (tr != null) { - android.util.Log.d(normalizeTag(tag), message, tr); - } else { - android.util.Log.d(normalizeTag(tag), message); - } - } - - /** Sends a {@link android.util.Log#DEBUG} log message. 0 args version. */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String message) { - debug(tag, message); - } - - /** Sends a {@link android.util.Log#DEBUG} log message. 1 arg version. */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String messageTemplate, Object arg1) { - debug(tag, messageTemplate, arg1); - } - /** Sends a {@link android.util.Log#DEBUG} log message. 2 args version */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String messageTemplate, Object arg1, Object arg2) { - debug(tag, messageTemplate, arg1, arg2); - } - /** Sends a {@link android.util.Log#DEBUG} log message. 3 args version */ - @RemovableInRelease - @VisibleForTesting - public static void d( - String tag, String messageTemplate, Object arg1, Object arg2, Object arg3) { - debug(tag, messageTemplate, arg1, arg2, arg3); - } - - /** Sends a {@link android.util.Log#DEBUG} log message. 4 args version */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4) { - debug(tag, messageTemplate, arg1, arg2, arg3, arg4); - } - - /** Sends a {@link android.util.Log#DEBUG} log message. 5 args version */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4, Object arg5) { - debug(tag, messageTemplate, arg1, arg2, arg3, arg4, arg5); - } - - /** Sends a {@link android.util.Log#DEBUG} log message. 6 args version */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4, Object arg5, Object arg6) { - debug(tag, messageTemplate, arg1, arg2, arg3, arg4, arg5, arg6); - } - - /** Sends a {@link android.util.Log#DEBUG} log message. 7 args version */ - @RemovableInRelease - @VisibleForTesting - public static void d(String tag, String messageTemplate, Object arg1, Object arg2, Object arg3, - Object arg4, Object arg5, Object arg6, Object arg7) { - debug(tag, messageTemplate, arg1, arg2, arg3, arg4, arg5, arg6, arg7); - } - - /** - * Sends an {@link android.util.Log#INFO} log message. - * - * @param tag Used to identify the source of a log message. Might be modified in the output - * (see {@link #normalizeTag(String)}) - * @param messageTemplate The message you would like logged. It is to be specified as a format - * string. - * @param args Arguments referenced by the format specifiers in the format string. If the last - * one is a {@link Throwable}, its trace will be printed. - */ - @VisibleForTesting - public static void i(String tag, String messageTemplate, Object... args) { - String message = formatLog(messageTemplate, args); - Throwable tr = getThrowableToLog(args); - if (tr != null) { - android.util.Log.i(normalizeTag(tag), message, tr); - } else { - android.util.Log.i(normalizeTag(tag), message); - } - } - - /** - * Sends a {@link android.util.Log#WARN} log message. - * - * @param tag Used to identify the source of a log message. Might be modified in the output - * (see {@link #normalizeTag(String)}) - * @param messageTemplate The message you would like logged. It is to be specified as a format - * string. - * @param args Arguments referenced by the format specifiers in the format string. If the last - * one is a {@link Throwable}, its trace will be printed. - */ - @VisibleForTesting - public static void w(String tag, String messageTemplate, Object... args) { - String message = formatLog(messageTemplate, args); - Throwable tr = getThrowableToLog(args); - if (tr != null) { - android.util.Log.w(normalizeTag(tag), message, tr); - } else { - android.util.Log.w(normalizeTag(tag), message); - } - } - - /** - * Sends an {@link android.util.Log#ERROR} log message. - * - * @param tag Used to identify the source of a log message. Might be modified in the output - * (see {@link #normalizeTag(String)}) - * @param messageTemplate The message you would like logged. It is to be specified as a format - * string. - * @param args Arguments referenced by the format specifiers in the format string. If the last - * one is a {@link Throwable}, its trace will be printed. - */ - @VisibleForTesting - public static void e(String tag, String messageTemplate, Object... args) { - String message = formatLog(messageTemplate, args); - Throwable tr = getThrowableToLog(args); - if (tr != null) { - android.util.Log.e(normalizeTag(tag), message, tr); - } else { - android.util.Log.e(normalizeTag(tag), message); - } - } - - /** - * What a Terrible Failure: Used for conditions that should never happen, and logged at - * the {@link android.util.Log#ASSERT} level. Depending on the configuration, it might - * terminate the process. - * - * @see android.util.Log#wtf(String, String, Throwable) - * - * @param tag Used to identify the source of a log message. Might be modified in the output - * (see {@link #normalizeTag(String)}) - * @param messageTemplate The message you would like logged. It is to be specified as a format - * string. - * @param args Arguments referenced by the format specifiers in the format string. If the last - * one is a {@link Throwable}, its trace will be printed. - */ - @VisibleForTesting - public static void wtf(String tag, String messageTemplate, Object... args) { - String message = formatLog(messageTemplate, args); - Throwable tr = getThrowableToLog(args); - if (tr != null) { - android.util.Log.wtf(normalizeTag(tag), message, tr); - } else { - android.util.Log.wtf(normalizeTag(tag), message); - } - } - - /** Handy function to get a loggable stack trace from a Throwable. */ - public static String getStackTraceString(Throwable tr) { - return android.util.Log.getStackTraceString(tr); - } - - private static Throwable getThrowableToLog(Object[] args) { - if (args == null || args.length == 0) return null; - - Object lastArg = args[args.length - 1]; - - if (!(lastArg instanceof Throwable)) return null; - return (Throwable) lastArg; - } - - /** Returns a string form of the origin of the log call, to be used as secondary tag.*/ - private static String getCallOrigin() { - StackTraceElement[] st = Thread.currentThread().getStackTrace(); - - // The call stack should look like: - // n [a variable number of calls depending on the vm used] - // +0 getCallOrigin() - // +1 privateLogFunction: verbose or debug - // +2 formatLogWithStack() - // +3 logFunction: v or d - // +4 caller - - int callerStackIndex; - String logClassName = Log.class.getName(); - for (callerStackIndex = 0; callerStackIndex < st.length; callerStackIndex++) { - if (st[callerStackIndex].getClassName().equals(logClassName)) { - callerStackIndex += 4; - break; - } - } - - return st[callerStackIndex].getFileName() + ":" + st[callerStackIndex].getLineNumber(); - } -} diff --git a/base/android/java/src/org/chromium/base/PackageUtils.java b/base/android/java/src/org/chromium/base/PackageUtils.java deleted file mode 100644 index ab554cd..0000000 --- a/base/android/java/src/org/chromium/base/PackageUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base; - -import android.content.Context; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; - -/** - * This class provides package checking related methods. - */ -public class PackageUtils { - /** - * Retrieves the version of the given package installed on the device. - * - * @param context Any context. - * @param packageName Name of the package to find. - * @return The package's version code if found, -1 otherwise. - */ - public static int getPackageVersion(Context context, String packageName) { - int versionCode = -1; - PackageManager pm = context.getPackageManager(); - try { - PackageInfo packageInfo = pm.getPackageInfo(packageName, 0); - if (packageInfo != null) versionCode = packageInfo.versionCode; - } catch (PackageManager.NameNotFoundException e) { - // Do nothing, versionCode stays -1 - } - return versionCode; - } - - private PackageUtils() { - // Hide constructor - } -} diff --git a/base/android/java/src/org/chromium/base/VisibleForTesting.java b/base/android/java/src/org/chromium/base/VisibleForTesting.java deleted file mode 100644 index 24cbfad..0000000 --- a/base/android/java/src/org/chromium/base/VisibleForTesting.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base; - -/** - * Annotation used to mark code that has wider visibility or present for testing code. - */ -public @interface VisibleForTesting { - -} diff --git a/base/android/java/src/org/chromium/base/annotations/AccessedByNative.java b/base/android/java/src/org/chromium/base/annotations/AccessedByNative.java deleted file mode 100644 index 6df7c11..0000000 --- a/base/android/java/src/org/chromium/base/annotations/AccessedByNative.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @AccessedByNative is used to ensure proguard will keep this field, since it's - * only accessed by native. - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.CLASS) -public @interface AccessedByNative { - public String value() default ""; -} diff --git a/base/android/java/src/org/chromium/base/annotations/CalledByNative.java b/base/android/java/src/org/chromium/base/annotations/CalledByNative.java deleted file mode 100644 index 94ef3fa..0000000 --- a/base/android/java/src/org/chromium/base/annotations/CalledByNative.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @CalledByNative is used by the JNI generator to create the necessary JNI - * bindings and expose this method to native code. - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.CLASS) -public @interface CalledByNative { - /* - * If present, tells which inner class the method belongs to. - */ - public String value() default ""; -} diff --git a/base/android/java/src/org/chromium/base/annotations/CalledByNativeUnchecked.java b/base/android/java/src/org/chromium/base/annotations/CalledByNativeUnchecked.java deleted file mode 100644 index c0abcbe..0000000 --- a/base/android/java/src/org/chromium/base/annotations/CalledByNativeUnchecked.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @CalledByNativeUnchecked is used to generate JNI bindings that do not check for exceptions. - * It only makes sense to use this annotation on methods that declare a throws... spec. - * However, note that the exception received native side maybe an 'unchecked' (RuntimeExpception) - * such as NullPointerException, so the native code should differentiate these cases. - * Usage of this should be very rare; where possible handle exceptions in the Java side and use a - * return value to indicate success / failure. - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.CLASS) -public @interface CalledByNativeUnchecked { - /* - * If present, tells which inner class the method belongs to. - */ - public String value() default ""; -} diff --git a/base/android/java/src/org/chromium/base/annotations/JNIAdditionalImport.java b/base/android/java/src/org/chromium/base/annotations/JNIAdditionalImport.java deleted file mode 100644 index f1bf85e..0000000 --- a/base/android/java/src/org/chromium/base/annotations/JNIAdditionalImport.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * JNIAdditionalImport is used by the JNI generator to qualify inner types used on JNI methods. Must - * be used when an inner class is used from a class within the same package. Example: - * - * <pre> - * @JNIAdditionImport(Foo.class) - * public class Bar { - * @CalledByNative static void doSomethingWithInner(Foo.Inner inner) { - * ... - * } - * } - * <pre> - * <p> - * Notes: - * 1) Foo must be in the same package as Bar - * 2) For classes in different packages, they should be imported as: - * import other.package.Foo; - * and this annotation should not be used. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.CLASS) -public @interface JNIAdditionalImport { - Class<?>[] value(); -} diff --git a/base/android/java/src/org/chromium/base/annotations/JNINamespace.java b/base/android/java/src/org/chromium/base/annotations/JNINamespace.java deleted file mode 100644 index 4cd5531..0000000 --- a/base/android/java/src/org/chromium/base/annotations/JNINamespace.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @JNINamespace is used by the JNI generator to create the necessary JNI - * bindings and expose this method to native code using the specified namespace. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface JNINamespace { - public String value(); -} diff --git a/base/android/java/src/org/chromium/base/annotations/MainDex.java b/base/android/java/src/org/chromium/base/annotations/MainDex.java deleted file mode 100644 index 0b35ade..0000000 --- a/base/android/java/src/org/chromium/base/annotations/MainDex.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * An annotation that signals that a class should be kept in the main dex file. - * - * This generally means it's used by renderer processes, which can't load secondary dexes - * on K and below. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.CLASS) -public @interface MainDex { -} diff --git a/base/android/java/src/org/chromium/base/annotations/NativeCall.java b/base/android/java/src/org/chromium/base/annotations/NativeCall.java deleted file mode 100644 index b69cd17..0000000 --- a/base/android/java/src/org/chromium/base/annotations/NativeCall.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @NativeCall is used by the JNI generator to create the necessary JNI bindings - * so a native function can be bound to a Java inner class. The native class for - * which the JNI method will be generated is specified by the first parameter. - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.CLASS) -public @interface NativeCall { - /* - * Value determines which native class the method should map to. - */ - public String value() default ""; -} diff --git a/base/android/java/src/org/chromium/base/annotations/NativeClassQualifiedName.java b/base/android/java/src/org/chromium/base/annotations/NativeClassQualifiedName.java deleted file mode 100644 index afbc368..0000000 --- a/base/android/java/src/org/chromium/base/annotations/NativeClassQualifiedName.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @NativeClassQualifiedName is used by the JNI generator to create the necessary JNI - * bindings to call into the specified native class name. - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface NativeClassQualifiedName { - /* - * Tells which native class the method is going to be bound to. - * The first parameter of the annotated method must be an int nativePtr pointing to - * an instance of this class. - */ - public String value(); -} diff --git a/base/android/java/src/org/chromium/base/annotations/RemovableInRelease.java b/base/android/java/src/org/chromium/base/annotations/RemovableInRelease.java deleted file mode 100644 index 2191334..0000000 --- a/base/android/java/src/org/chromium/base/annotations/RemovableInRelease.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Target; - -/** - * The annotated function can be removed in release builds. - * - * Calls to this function will be removed if its return value is not used. If all calls are removed, - * the function definition itself will be candidate for removal. - * It works by indicating to Proguard that the function has no side effects. - */ -@Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) -public @interface RemovableInRelease {} diff --git a/base/android/java/src/org/chromium/base/annotations/SuppressFBWarnings.java b/base/android/java/src/org/chromium/base/annotations/SuppressFBWarnings.java deleted file mode 100644 index 89068ac..0000000 --- a/base/android/java/src/org/chromium/base/annotations/SuppressFBWarnings.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * @SuppressFBWarnings is used to suppress FindBugs warnings. - * - * The long name of FindBugs warnings can be found at - * http://findbugs.sourceforge.net/bugDescriptions.html - */ -@Retention(RetentionPolicy.CLASS) -public @interface SuppressFBWarnings { - String[] value() default {}; - String justification() default ""; -} diff --git a/base/android/java/src/org/chromium/base/annotations/UsedByReflection.java b/base/android/java/src/org/chromium/base/annotations/UsedByReflection.java deleted file mode 100644 index a2af704..0000000 --- a/base/android/java/src/org/chromium/base/annotations/UsedByReflection.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.base.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Target; - -/** - * Annotation used for marking methods and fields that are called by reflection. - * Useful for keeping components that would otherwise be removed by Proguard. - * Use the value parameter to mention a file that calls this method. - * - * Note that adding this annotation to a method is not enough to guarantee that - * it is kept - either its class must be referenced elsewhere in the program, or - * the class must be annotated with this as well. - */ -@Target({ - ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, - ElementType.CONSTRUCTOR }) -public @interface UsedByReflection { - String value(); -} diff --git a/base/android/java_runtime.cc b/base/android/java_runtime.cc deleted file mode 100644 index 5fae49a..0000000 --- a/base/android/java_runtime.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/java_runtime.h" - -#include "jni/Runtime_jni.h" - -namespace base { -namespace android { - -void JavaRuntime::GetMemoryUsage(long* total_memory, long* free_memory) { - JNIEnv* env = base::android::AttachCurrentThread(); - base::android::ScopedJavaLocalRef<jobject> runtime = - JNI_Runtime::Java_Runtime_getRuntime(env); - *total_memory = JNI_Runtime::Java_Runtime_totalMemory(env, runtime); - *free_memory = JNI_Runtime::Java_Runtime_freeMemory(env, runtime); -} - -} // namespace android -} // namespace base diff --git a/base/android/java_runtime.h b/base/android/java_runtime.h deleted file mode 100644 index 2034fb9..0000000 --- a/base/android/java_runtime.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_JAVA_RUNTIME_H_ -#define BASE_ANDROID_JAVA_RUNTIME_H_ - -#include "base/android/scoped_java_ref.h" -#include "base/base_export.h" - -namespace base { -namespace android { - -// Wrapper class for using the java.lang.Runtime object from jni. -class BASE_EXPORT JavaRuntime { - public: - // Fills the total memory used and memory allocated for objects by the java - // heap in the current process. Returns true on success. - static void GetMemoryUsage(long* total_memory, long* free_memory); -}; - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_JAVA_RUNTIME_H_ diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc deleted file mode 100644 index 2b5869f..0000000 --- a/base/android/jni_android.cc +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/jni_android.h" - -#include <stddef.h> - -#include <map> - -#include "base/android/build_info.h" -#include "base/android/jni_string.h" -// Removed unused headers. TODO(hidehiko): Upstream. -// #include "base/android/jni_utils.h" -#include "base/debug/debugging_flags.h" -#include "base/lazy_instance.h" -#include "base/logging.h" -#include "base/threading/thread_local.h" - -namespace { -using base::android::GetClass; -using base::android::MethodID; -using base::android::ScopedJavaLocalRef; - -base::android::JniRegistrationType g_jni_registration_type = - base::android::ALL_JNI_REGISTRATION; - -JavaVM* g_jvm = NULL; -base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject>>::Leaky - g_class_loader = LAZY_INSTANCE_INITIALIZER; -jmethodID g_class_loader_load_class_method_id = 0; - -#if BUILDFLAG(ENABLE_PROFILING) && HAVE_TRACE_STACK_FRAME_POINTERS -base::LazyInstance<base::ThreadLocalPointer<void>>::Leaky - g_stack_frame_pointer = LAZY_INSTANCE_INITIALIZER; -#endif - -} // namespace - -namespace base { -namespace android { - -JniRegistrationType GetJniRegistrationType() { - return g_jni_registration_type; -} - -void SetJniRegistrationType(JniRegistrationType jni_registration_type) { - g_jni_registration_type = jni_registration_type; -} - -JNIEnv* AttachCurrentThread() { - DCHECK(g_jvm); - JNIEnv* env = NULL; - jint ret = g_jvm->AttachCurrentThread(&env, NULL); - DCHECK_EQ(JNI_OK, ret); - return env; -} - -JNIEnv* AttachCurrentThreadWithName(const std::string& thread_name) { - DCHECK(g_jvm); - JavaVMAttachArgs args; - args.version = JNI_VERSION_1_2; - args.name = thread_name.c_str(); - args.group = NULL; - JNIEnv* env = NULL; - jint ret = g_jvm->AttachCurrentThread(&env, &args); - DCHECK_EQ(JNI_OK, ret); - return env; -} - -void DetachFromVM() { - // Ignore the return value, if the thread is not attached, DetachCurrentThread - // will fail. But it is ok as the native thread may never be attached. - if (g_jvm) - g_jvm->DetachCurrentThread(); -} - -void InitVM(JavaVM* vm) { - DCHECK(!g_jvm || g_jvm == vm); - g_jvm = vm; -} - -bool IsVMInitialized() { - return g_jvm != NULL; -} - -void InitReplacementClassLoader(JNIEnv* env, - const JavaRef<jobject>& class_loader) { - DCHECK(g_class_loader.Get().is_null()); - DCHECK(!class_loader.is_null()); - - ScopedJavaLocalRef<jclass> class_loader_clazz = - GetClass(env, "java/lang/ClassLoader"); - CHECK(!ClearException(env)); - g_class_loader_load_class_method_id = - env->GetMethodID(class_loader_clazz.obj(), - "loadClass", - "(Ljava/lang/String;)Ljava/lang/Class;"); - CHECK(!ClearException(env)); - - DCHECK(env->IsInstanceOf(class_loader.obj(), class_loader_clazz.obj())); - g_class_loader.Get().Reset(class_loader); -} - -ScopedJavaLocalRef<jclass> GetClass(JNIEnv* env, const char* class_name) { - jclass clazz; - if (!g_class_loader.Get().is_null()) { - // ClassLoader.loadClass expects a classname with components separated by - // dots instead of the slashes that JNIEnv::FindClass expects. The JNI - // generator generates names with slashes, so we have to replace them here. - // TODO(torne): move to an approach where we always use ClassLoader except - // for the special case of base::android::GetClassLoader(), and change the - // JNI generator to generate dot-separated names. http://crbug.com/461773 - size_t bufsize = strlen(class_name) + 1; - char dotted_name[bufsize]; - memmove(dotted_name, class_name, bufsize); - for (size_t i = 0; i < bufsize; ++i) { - if (dotted_name[i] == '/') { - dotted_name[i] = '.'; - } - } - - clazz = static_cast<jclass>( - env->CallObjectMethod(g_class_loader.Get().obj(), - g_class_loader_load_class_method_id, - ConvertUTF8ToJavaString(env, dotted_name).obj())); - } else { - clazz = env->FindClass(class_name); - } - if (ClearException(env) || !clazz) { - LOG(FATAL) << "Failed to find class " << class_name; - } - return ScopedJavaLocalRef<jclass>(env, clazz); -} - -jclass LazyGetClass( - JNIEnv* env, - const char* class_name, - base::subtle::AtomicWord* atomic_class_id) { - static_assert(sizeof(subtle::AtomicWord) >= sizeof(jclass), - "AtomicWord can't be smaller than jclass"); - subtle::AtomicWord value = base::subtle::Acquire_Load(atomic_class_id); - if (value) - return reinterpret_cast<jclass>(value); - ScopedJavaGlobalRef<jclass> clazz; - clazz.Reset(GetClass(env, class_name)); - subtle::AtomicWord null_aw = reinterpret_cast<subtle::AtomicWord>(NULL); - subtle::AtomicWord cas_result = base::subtle::Release_CompareAndSwap( - atomic_class_id, - null_aw, - reinterpret_cast<subtle::AtomicWord>(clazz.obj())); - if (cas_result == null_aw) { - // We intentionally leak the global ref since we now storing it as a raw - // pointer in |atomic_class_id|. - return clazz.Release(); - } else { - return reinterpret_cast<jclass>(cas_result); - } -} - -template<MethodID::Type type> -jmethodID MethodID::Get(JNIEnv* env, - jclass clazz, - const char* method_name, - const char* jni_signature) { - jmethodID id = type == TYPE_STATIC ? - env->GetStaticMethodID(clazz, method_name, jni_signature) : - env->GetMethodID(clazz, method_name, jni_signature); - if (base::android::ClearException(env) || !id) { - LOG(FATAL) << "Failed to find " << - (type == TYPE_STATIC ? "static " : "") << - "method " << method_name << " " << jni_signature; - } - return id; -} - -// If |atomic_method_id| set, it'll return immediately. Otherwise, it'll call -// into ::Get() above. If there's a race, it's ok since the values are the same -// (and the duplicated effort will happen only once). -template<MethodID::Type type> -jmethodID MethodID::LazyGet(JNIEnv* env, - jclass clazz, - const char* method_name, - const char* jni_signature, - base::subtle::AtomicWord* atomic_method_id) { - static_assert(sizeof(subtle::AtomicWord) >= sizeof(jmethodID), - "AtomicWord can't be smaller than jMethodID"); - subtle::AtomicWord value = base::subtle::Acquire_Load(atomic_method_id); - if (value) - return reinterpret_cast<jmethodID>(value); - jmethodID id = MethodID::Get<type>(env, clazz, method_name, jni_signature); - base::subtle::Release_Store( - atomic_method_id, reinterpret_cast<subtle::AtomicWord>(id)); - return id; -} - -// Various template instantiations. -template jmethodID MethodID::Get<MethodID::TYPE_STATIC>( - JNIEnv* env, jclass clazz, const char* method_name, - const char* jni_signature); - -template jmethodID MethodID::Get<MethodID::TYPE_INSTANCE>( - JNIEnv* env, jclass clazz, const char* method_name, - const char* jni_signature); - -template jmethodID MethodID::LazyGet<MethodID::TYPE_STATIC>( - JNIEnv* env, jclass clazz, const char* method_name, - const char* jni_signature, base::subtle::AtomicWord* atomic_method_id); - -template jmethodID MethodID::LazyGet<MethodID::TYPE_INSTANCE>( - JNIEnv* env, jclass clazz, const char* method_name, - const char* jni_signature, base::subtle::AtomicWord* atomic_method_id); - -bool HasException(JNIEnv* env) { - return env->ExceptionCheck() != JNI_FALSE; -} - -bool ClearException(JNIEnv* env) { - if (!HasException(env)) - return false; - env->ExceptionDescribe(); - env->ExceptionClear(); - return true; -} - -void CheckException(JNIEnv* env) { - if (!HasException(env)) - return; - - // Exception has been found, might as well tell breakpad about it. - jthrowable java_throwable = env->ExceptionOccurred(); - if (java_throwable) { - // Clear the pending exception, since a local reference is now held. - env->ExceptionDescribe(); - env->ExceptionClear(); - - // Set the exception_string in BuildInfo so that breakpad can read it. - // RVO should avoid any extra copies of the exception string. - base::android::BuildInfo::GetInstance()->SetJavaExceptionInfo( - GetJavaExceptionInfo(env, java_throwable)); - } - - // Now, feel good about it and die. - // TODO(lhchavez): Remove this hack. See b/28814913 for details. - // We're using BuildInfo's java_exception_info() instead of storing the - // exception info a few lines above to avoid extra copies. It will be - // truncated to 1024 bytes anyways. - const char* exception_string = - base::android::BuildInfo::GetInstance()->java_exception_info(); - if (exception_string) - LOG(FATAL) << exception_string; - else - LOG(FATAL) << "Unhandled exception"; -} - -std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) { - ScopedJavaLocalRef<jclass> throwable_clazz = - GetClass(env, "java/lang/Throwable"); - jmethodID throwable_printstacktrace = - MethodID::Get<MethodID::TYPE_INSTANCE>( - env, throwable_clazz.obj(), "printStackTrace", - "(Ljava/io/PrintStream;)V"); - - // Create an instance of ByteArrayOutputStream. - ScopedJavaLocalRef<jclass> bytearray_output_stream_clazz = - GetClass(env, "java/io/ByteArrayOutputStream"); - jmethodID bytearray_output_stream_constructor = - MethodID::Get<MethodID::TYPE_INSTANCE>( - env, bytearray_output_stream_clazz.obj(), "<init>", "()V"); - jmethodID bytearray_output_stream_tostring = - MethodID::Get<MethodID::TYPE_INSTANCE>( - env, bytearray_output_stream_clazz.obj(), "toString", - "()Ljava/lang/String;"); - ScopedJavaLocalRef<jobject> bytearray_output_stream(env, - env->NewObject(bytearray_output_stream_clazz.obj(), - bytearray_output_stream_constructor)); - - // Create an instance of PrintStream. - ScopedJavaLocalRef<jclass> printstream_clazz = - GetClass(env, "java/io/PrintStream"); - jmethodID printstream_constructor = - MethodID::Get<MethodID::TYPE_INSTANCE>( - env, printstream_clazz.obj(), "<init>", - "(Ljava/io/OutputStream;)V"); - ScopedJavaLocalRef<jobject> printstream(env, - env->NewObject(printstream_clazz.obj(), printstream_constructor, - bytearray_output_stream.obj())); - - // Call Throwable.printStackTrace(PrintStream) - env->CallVoidMethod(java_throwable, throwable_printstacktrace, - printstream.obj()); - - // Call ByteArrayOutputStream.toString() - ScopedJavaLocalRef<jstring> exception_string( - env, static_cast<jstring>( - env->CallObjectMethod(bytearray_output_stream.obj(), - bytearray_output_stream_tostring))); - - return ConvertJavaStringToUTF8(exception_string); -} - -#if BUILDFLAG(ENABLE_PROFILING) && HAVE_TRACE_STACK_FRAME_POINTERS - -JNIStackFrameSaver::JNIStackFrameSaver(void* current_fp) { - previous_fp_ = g_stack_frame_pointer.Pointer()->Get(); - g_stack_frame_pointer.Pointer()->Set(current_fp); -} - -JNIStackFrameSaver::~JNIStackFrameSaver() { - g_stack_frame_pointer.Pointer()->Set(previous_fp_); -} - -void* JNIStackFrameSaver::SavedFrame() { - return g_stack_frame_pointer.Pointer()->Get(); -} - -#endif // ENABLE_PROFILING && HAVE_TRACE_STACK_FRAME_POINTERS - -} // namespace android -} // namespace base diff --git a/base/android/jni_android.h b/base/android/jni_android.h deleted file mode 100644 index de53c10..0000000 --- a/base/android/jni_android.h +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_JNI_ANDROID_H_ -#define BASE_ANDROID_JNI_ANDROID_H_ - -#include <jni.h> -#include <sys/types.h> - -#include <string> - -#include "base/android/scoped_java_ref.h" -#include "base/atomicops.h" -#include "base/base_export.h" -#include "base/compiler_specific.h" -#include "base/debug/stack_trace.h" -#include "base/macros.h" - -#if HAVE_TRACE_STACK_FRAME_POINTERS - -// When profiling is enabled (enable_profiling=true) this macro is added to -// all generated JNI stubs so that it becomes the last thing that runs before -// control goes into Java. -// -// This macro saves stack frame pointer of the current function. Saved value -// used later by JNI_LINK_SAVED_FRAME_POINTER. -#define JNI_SAVE_FRAME_POINTER \ - base::android::JNIStackFrameSaver jni_frame_saver(__builtin_frame_address(0)) - -// When profiling is enabled (enable_profiling=true) this macro is added to -// all generated JNI callbacks so that it becomes the first thing that runs -// after control returns from Java. -// -// This macro links stack frame of the current function to the stack frame -// saved by JNI_SAVE_FRAME_POINTER, allowing frame-based unwinding -// (used by the heap profiler) to produce complete traces. -#define JNI_LINK_SAVED_FRAME_POINTER \ - base::debug::ScopedStackFrameLinker jni_frame_linker( \ - __builtin_frame_address(0), \ - base::android::JNIStackFrameSaver::SavedFrame()) - -#else - -// Frame-based stack unwinding is not supported, do nothing. -#define JNI_SAVE_FRAME_POINTER -#define JNI_LINK_SAVED_FRAME_POINTER - -#endif // HAVE_TRACE_STACK_FRAME_POINTERS - -namespace base { -namespace android { - -// Used to mark symbols to be exported in a shared library's symbol table. -#define JNI_EXPORT __attribute__ ((visibility("default"))) - -// The level of JNI registration required for the current process. -enum JniRegistrationType { - // Register all native methods. - ALL_JNI_REGISTRATION, - // Register some native methods, as controlled by the jni_generator. - SELECTIVE_JNI_REGISTRATION, - // Do not register any native methods. - NO_JNI_REGISTRATION, -}; - -BASE_EXPORT JniRegistrationType GetJniRegistrationType(); - -// Set the JniRegistrationType for this process (defaults to -// ALL_JNI_REGISTRATION). This should be called in the JNI_OnLoad function -// which is called when the native library is first loaded. -BASE_EXPORT void SetJniRegistrationType( - JniRegistrationType jni_registration_type); - -// Contains the registration method information for initializing JNI bindings. -struct RegistrationMethod { - const char* name; - bool (*func)(JNIEnv* env); -}; - -// Attaches the current thread to the VM (if necessary) and return the JNIEnv*. -BASE_EXPORT JNIEnv* AttachCurrentThread(); - -// Same to AttachCurrentThread except that thread name will be set to -// |thread_name| if it is the first call. Otherwise, thread_name won't be -// changed. AttachCurrentThread() doesn't regard underlying platform thread -// name, but just resets it to "Thread-???". This function should be called -// right after new thread is created if it is important to keep thread name. -BASE_EXPORT JNIEnv* AttachCurrentThreadWithName(const std::string& thread_name); - -// Detaches the current thread from VM if it is attached. -BASE_EXPORT void DetachFromVM(); - -// Initializes the global JVM. -BASE_EXPORT void InitVM(JavaVM* vm); - -// Returns true if the global JVM has been initialized. -BASE_EXPORT bool IsVMInitialized(); - -// Initializes the global ClassLoader used by the GetClass and LazyGetClass -// methods. This is needed because JNI will use the base ClassLoader when there -// is no Java code on the stack. The base ClassLoader doesn't know about any of -// the application classes and will fail to lookup anything other than system -// classes. -BASE_EXPORT void InitReplacementClassLoader( - JNIEnv* env, - const JavaRef<jobject>& class_loader); - -// Finds the class named |class_name| and returns it. -// Use this method instead of invoking directly the JNI FindClass method (to -// prevent leaking local references). -// This method triggers a fatal assertion if the class could not be found. -// Use HasClass if you need to check whether the class exists. -BASE_EXPORT ScopedJavaLocalRef<jclass> GetClass(JNIEnv* env, - const char* class_name); - -// The method will initialize |atomic_class_id| to contain a global ref to the -// class. And will return that ref on subsequent calls. It's the caller's -// responsibility to release the ref when it is no longer needed. -// The caller is responsible to zero-initialize |atomic_method_id|. -// It's fine to simultaneously call this on multiple threads referencing the -// same |atomic_method_id|. -BASE_EXPORT jclass LazyGetClass( - JNIEnv* env, - const char* class_name, - base::subtle::AtomicWord* atomic_class_id); - -// This class is a wrapper for JNIEnv Get(Static)MethodID. -class BASE_EXPORT MethodID { - public: - enum Type { - TYPE_STATIC, - TYPE_INSTANCE, - }; - - // Returns the method ID for the method with the specified name and signature. - // This method triggers a fatal assertion if the method could not be found. - template<Type type> - static jmethodID Get(JNIEnv* env, - jclass clazz, - const char* method_name, - const char* jni_signature); - - // The caller is responsible to zero-initialize |atomic_method_id|. - // It's fine to simultaneously call this on multiple threads referencing the - // same |atomic_method_id|. - template<Type type> - static jmethodID LazyGet(JNIEnv* env, - jclass clazz, - const char* method_name, - const char* jni_signature, - base::subtle::AtomicWord* atomic_method_id); -}; - -// Returns true if an exception is pending in the provided JNIEnv*. -BASE_EXPORT bool HasException(JNIEnv* env); - -// If an exception is pending in the provided JNIEnv*, this function clears it -// and returns true. -BASE_EXPORT bool ClearException(JNIEnv* env); - -// This function will call CHECK() macro if there's any pending exception. -BASE_EXPORT void CheckException(JNIEnv* env); - -// This returns a string representation of the java stack trace. -BASE_EXPORT std::string GetJavaExceptionInfo(JNIEnv* env, - jthrowable java_throwable); - -#if HAVE_TRACE_STACK_FRAME_POINTERS - -// Saves caller's PC and stack frame in a thread-local variable. -// Implemented only when profiling is enabled (enable_profiling=true). -class BASE_EXPORT JNIStackFrameSaver { - public: - JNIStackFrameSaver(void* current_fp); - ~JNIStackFrameSaver(); - static void* SavedFrame(); - - private: - void* previous_fp_; - - DISALLOW_COPY_AND_ASSIGN(JNIStackFrameSaver); -}; - -#endif // HAVE_TRACE_STACK_FRAME_POINTERS - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_JNI_ANDROID_H_ diff --git a/base/android/jni_android_unittest.cc b/base/android/jni_android_unittest.cc deleted file mode 100644 index dabd480..0000000 --- a/base/android/jni_android_unittest.cc +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/jni_android.h" - -#include "base/at_exit.h" -#include "base/logging.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace base { -namespace android { - -namespace { - -base::subtle::AtomicWord g_atomic_id = 0; -int LazyMethodIDCall(JNIEnv* env, jclass clazz, int p) { - jmethodID id = base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, clazz, - "abs", - "(I)I", - &g_atomic_id); - - return env->CallStaticIntMethod(clazz, id, p); -} - -int MethodIDCall(JNIEnv* env, jclass clazz, jmethodID id, int p) { - return env->CallStaticIntMethod(clazz, id, p); -} - -} // namespace - -TEST(JNIAndroidMicrobenchmark, MethodId) { - JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jclass> clazz(GetClass(env, "java/lang/Math")); - base::Time start_lazy = base::Time::Now(); - int o = 0; - for (int i = 0; i < 1024; ++i) - o += LazyMethodIDCall(env, clazz.obj(), i); - base::Time end_lazy = base::Time::Now(); - - jmethodID id = reinterpret_cast<jmethodID>(g_atomic_id); - base::Time start = base::Time::Now(); - for (int i = 0; i < 1024; ++i) - o += MethodIDCall(env, clazz.obj(), id, i); - base::Time end = base::Time::Now(); - - // On a Galaxy Nexus, results were in the range of: - // JNI LazyMethodIDCall (us) 1984 - // JNI MethodIDCall (us) 1861 - LOG(ERROR) << "JNI LazyMethodIDCall (us) " << - base::TimeDelta(end_lazy - start_lazy).InMicroseconds(); - LOG(ERROR) << "JNI MethodIDCall (us) " << - base::TimeDelta(end - start).InMicroseconds(); - LOG(ERROR) << "JNI " << o; -} - - -} // namespace android -} // namespace base diff --git a/base/android/jni_generator/android_jar.classes b/base/android/jni_generator/android_jar.classes deleted file mode 100644 index 7d412ce..0000000 --- a/base/android/jni_generator/android_jar.classes +++ /dev/null @@ -1,98 +0,0 @@ -java/lang/AbstractMethodError.class -java/lang/AbstractStringBuilder.class -java/lang/Appendable.class -java/lang/ArithmeticException.class -java/lang/ArrayIndexOutOfBoundsException.class -java/lang/ArrayStoreException.class -java/lang/AssertionError.class -java/lang/AutoCloseable.class -java/lang/Boolean.class -java/lang/Byte.class -java/lang/Character.class -java/lang/Character$Subset.class -java/lang/Character$UnicodeBlock.class -java/lang/CharSequence.class -java/lang/ClassCastException.class -java/lang/ClassCircularityError.class -java/lang/Class.class -java/lang/ClassFormatError.class -java/lang/ClassLoader.class -java/lang/ClassNotFoundException.class -java/lang/Cloneable.class -java/lang/CloneNotSupportedException.class -java/lang/Comparable.class -java/lang/Compiler.class -java/lang/Deprecated.class -java/lang/Double.class -java/lang/Enum.class -java/lang/EnumConstantNotPresentException.class -java/lang/Error.class -java/lang/Exception.class -java/lang/ExceptionInInitializerError.class -java/lang/Float.class -java/lang/IllegalAccessError.class -java/lang/IllegalAccessException.class -java/lang/IllegalArgumentException.class -java/lang/IllegalMonitorStateException.class -java/lang/IllegalStateException.class -java/lang/IncompatibleClassChangeError.class -java/lang/IndexOutOfBoundsException.class -java/lang/InheritableThreadLocal.class -java/lang/InstantiationError.class -java/lang/InstantiationException.class -java/lang/Integer.class -java/lang/InternalError.class -java/lang/InterruptedException.class -java/lang/Iterable.class -java/lang/LinkageError.class -java/lang/Long.class -java/lang/Math.class -java/lang/NegativeArraySizeException.class -java/lang/NoClassDefFoundError.class -java/lang/NoSuchFieldError.class -java/lang/NoSuchFieldException.class -java/lang/NoSuchMethodError.class -java/lang/NoSuchMethodException.class -java/lang/NullPointerException.class -java/lang/Number.class -java/lang/NumberFormatException.class -java/lang/Object.class -java/lang/OutOfMemoryError.class -java/lang/Override.class -java/lang/Package.class -java/lang/ProcessBuilder.class -java/lang/Process.class -java/lang/Readable.class -java/lang/ReflectiveOperationException.class -java/lang/Runnable.class -java/lang/Runtime.class -java/lang/RuntimeException.class -java/lang/RuntimePermission.class -java/lang/SafeVarargs.class -java/lang/SecurityException.class -java/lang/SecurityManager.class -java/lang/Short.class -java/lang/StackOverflowError.class -java/lang/StackTraceElement.class -java/lang/StrictMath.class -java/lang/StringBuffer.class -java/lang/StringBuilder.class -java/lang/String.class -java/lang/StringIndexOutOfBoundsException.class -java/lang/SuppressWarnings.class -java/lang/System.class -java/lang/Thread.class -java/lang/ThreadDeath.class -java/lang/ThreadGroup.class -java/lang/ThreadLocal.class -java/lang/Thread$State.class -java/lang/Thread$UncaughtExceptionHandler.class -java/lang/Throwable.class -java/lang/TypeNotPresentException.class -java/lang/UnknownError.class -java/lang/UnsatisfiedLinkError.class -java/lang/UnsupportedClassVersionError.class -java/lang/UnsupportedOperationException.class -java/lang/VerifyError.class -java/lang/VirtualMachineError.class -java/lang/Void.class diff --git a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java deleted file mode 100644 index 42d8e56..0000000 --- a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.example.jni_generator; - -import android.graphics.Rect; - -import org.chromium.base.annotations.AccessedByNative; -import org.chromium.base.annotations.CalledByNative; -import org.chromium.base.annotations.CalledByNativeUnchecked; -import org.chromium.base.annotations.JNINamespace; -import org.chromium.base.annotations.NativeCall; -import org.chromium.base.annotations.NativeClassQualifiedName; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -// This class serves as a reference test for the bindings generator, and as example documentation -// for how to use the jni generator. -// The C++ counter-part is sample_for_tests.cc. -// jni_generator/BUILD.gn has a jni_generator_tests target that will: -// * Generate a header file for the JNI bindings based on this file. -// * Compile sample_for_tests.cc using the generated header file. -// * link a native executable to prove the generated header + cc file are self-contained. -// All comments are informational only, and are ignored by the jni generator. -// -// Binding C/C++ with Java is not trivial, specially when ownership and object lifetime -// semantics needs to be managed across boundaries. -// Following a few guidelines will make the code simpler and less buggy: -// -// - Never write any JNI "by hand". Rely on the bindings generator to have a thin -// layer of type-safety. -// -// - Treat the types from the other side as "opaque" as possible. Do not inspect any -// object directly, but rather, rely on well-defined getters / setters. -// -// - Minimize the surface API between the two sides, and rather than calling multiple -// functions across boundaries, call only one (and then, internally in the other side, -// call as many little functions as required). -// -// - If a Java object "owns" a native object, stash the pointer in a "long mNativeClassName". -// Note that it needs to have a "destruction path", i.e., it must eventually call a method -// to delete the native object (for example, the java object has a "close()" method that -// in turn deletes the native object). Avoid relying on finalizers: those run in a different -// thread and makes the native lifetime management more difficult. -// -// - For native object "owning" java objects: -// - If there's a strong 1:1 to relationship between native and java, the best way is to -// stash the java object into a base::android::ScopedJavaGlobalRef. This will ensure the -// java object can be GC'd once the native object is destroyed but note that this global strong -// ref implies a new GC root, so be sure it will not leak and it must never rely on being -// triggered (transitively) from a java side GC. -// - In all other cases, the native side should keep a JavaObjectWeakGlobalRef, and check whether -// that reference is still valid before de-referencing it. Note that you will need another -// java-side object to be holding a strong reference to this java object while it is in use, to -// avoid unpredictable GC of the object before native side has finished with it. -// -// - The best way to pass "compound" datatypes across in either direction is to create an inner -// class with PODs and a factory function. If possible, make it immutable (i.e., mark all the -// fields as "final"). See examples with "InnerStructB" below. -// -// - It's simpler to create thin wrappers with a well defined JNI interface than to -// expose a lot of internal details. This is specially significant for system classes where it's -// simpler to wrap factory methods and a few getters / setters than expose the entire class. -// -// - Use static factory functions annotated with @CalledByNative rather than calling the -// constructors directly. -// -// - Iterate over containers where they are originally owned, then create inner structs or -// directly call methods on the other side. It's much simpler than trying to amalgamate -// java and stl containers. -// -// An important note about qualified class name resolution: -// The generator doesn't compile the class and have little context about the -// classes being passed through the JNI layers. It adds a few simple rules: -// -// - all classes are either explicitly imported, or they are assumed to be in -// the same package. -// -// - Inner class needs to be done through an import and usage of the -// outer class, so that the generator knows how to qualify it: -// import foo.bar.Zoo; -// void call(Zoo.Inner); -// -// - implicitly imported classes aren't supported, so in order to pass -// things like Runnable, please import java.lang.Runnable; -// -// This JNINamespace annotation indicates that all native methods should be -// generated inside this namespace, including the native class that this -// object binds to. -@JNINamespace("base::android") -class SampleForTests { - // Classes can store their C++ pointer counter part as an int that is normally initialized by - // calling out a nativeInit() function. Replace "CPPClass" with your particular class name! - long mNativeCPPObject; - - // You can define methods and attributes on the java class just like any other. - // Methods without the @CalledByNative annotation won't be exposed to JNI. - public SampleForTests() { - } - - public void startExample() { - // Calls C++ Init(...) method and holds a pointer to the C++ class. - mNativeCPPObject = nativeInit("myParam"); - } - - public void doStuff() { - // This will call CPPClass::Method() using nativePtr as a pointer to the object. This must - // be done to: - // * avoid leaks. - // * using finalizers are not allowed to destroy the cpp class. - nativeMethod(mNativeCPPObject); - } - - public void finishExample() { - // We're done, so let's destroy nativePtr object. - nativeDestroy(mNativeCPPObject); - } - - // --------------------------------------------------------------------------------------------- - // The following methods demonstrate exporting Java methods for invocation from C++ code. - // Java functions are mapping into C global functions by prefixing the method name with - // "Java_<Class>_" - // This is triggered by the @CalledByNative annotation; the methods may be named as you wish. - - // Exported to C++ as: - // Java_SampleForTests_javaMethod(JNIEnv* env, jobject caller, jint foo, jint bar) - // Typically the C++ code would have obtained the jobject via the Init() call described above. - @CalledByNative - public int javaMethod(int foo, int bar) { - return 0; - } - - // Exported to C++ as Java_SampleForTests_staticJavaMethod(JNIEnv* env) - // Note no jobject argument, as it is static. - @CalledByNative - public static boolean staticJavaMethod() { - return true; - } - - // No prefix, so this method is package private. It will still be exported. - @CalledByNative - void packagePrivateJavaMethod() { - } - - // Note the "Unchecked" suffix. By default, @CalledByNative will always generate bindings that - // call CheckException(). With "@CalledByNativeUnchecked", the client C++ code is responsible to - // call ClearException() and act as appropriate. - // See more details at the "@CalledByNativeUnchecked" annotation. - @CalledByNativeUnchecked - void methodThatThrowsException() throws Exception {} - - // The generator is not confused by inline comments: - // @CalledByNative void thisShouldNotAppearInTheOutput(); - // @CalledByNativeUnchecked public static void neitherShouldThis(int foo); - - /** - * The generator is not confused by block comments: - * @CalledByNative void thisShouldNotAppearInTheOutputEither(); - * @CalledByNativeUnchecked public static void andDefinitelyNotThis(int foo); - */ - - // String constants that look like comments don't confuse the generator: - private String mArrgh = "*/*"; - - private @interface SomeAnnotation {} - - // The generator is not confused by @Annotated parameters. - @CalledByNative - void javaMethodWithAnnotatedParam(@SomeAnnotation int foo) { - } - - // --------------------------------------------------------------------------------------------- - // Java fields which are accessed from C++ code only must be annotated with @AccessedByNative to - // prevent them being eliminated when unreferenced code is stripped. - @AccessedByNative - private int mJavaField; - - // --------------------------------------------------------------------------------------------- - // The following methods demonstrate declaring methods to call into C++ from Java. - // The generator detects the "native" and "static" keywords, the type and name of the first - // parameter, and the "native" prefix to the function name to determine the C++ function - // signatures. Besides these constraints the methods can be freely named. - - // This declares a C++ function which the application code must implement: - // static jint Init(JNIEnv* env, jobject caller); - // The jobject parameter refers back to this java side object instance. - // The implementation must return the pointer to the C++ object cast to jint. - // The caller of this method should store it, and supply it as a the nativeCPPClass param to - // subsequent native method calls (see the methods below that take an "int native..." as first - // param). - private native long nativeInit(String param); - - // This defines a function binding to the associated C++ class member function. The name is - // derived from |nativeDestroy| and |nativeCPPClass| to arrive at CPPClass::Destroy() (i.e. - // native prefixes stripped). - // - // The |nativeCPPClass| is automatically cast to type CPPClass*, in order to obtain the object - // on - // which to invoke the member function. Replace "CPPClass" with your particular class name! - private native void nativeDestroy(long nativeCPPClass); - - // This declares a C++ function which the application code must implement: - // static jdouble GetDoubleFunction(JNIEnv* env, jobject caller); - // The jobject parameter refers back to this java side object instance. - private native double nativeGetDoubleFunction(); - - // Similar to nativeGetDoubleFunction(), but here the C++ side will receive a jclass rather than - // jobject param, as the function is declared static. - private static native float nativeGetFloatFunction(); - - // This function takes a non-POD datatype. We have a list mapping them to their full classpath - // in jni_generator.py JavaParamToJni. If you require a new datatype, make sure you add to that - // function. - private native void nativeSetNonPODDatatype(Rect rect); - - // This declares a C++ function which the application code must implement: - // static ScopedJavaLocalRef<jobject> GetNonPODDatatype(JNIEnv* env, jobject caller); - // The jobject parameter refers back to this java side object instance. - // Note that it returns a ScopedJavaLocalRef<jobject> so that you don' have to worry about - // deleting the JNI local reference. This is similar with Strings and arrays. - private native Object nativeGetNonPODDatatype(); - - // Similar to nativeDestroy above, this will cast nativeCPPClass into pointer of CPPClass type - // and call its Method member function. Replace "CPPClass" with your particular class name! - private native int nativeMethod(long nativeCPPClass); - - // Similar to nativeMethod above, but here the C++ fully qualified class name is taken from the - // annotation rather than parameter name, which can thus be chosen freely. - @NativeClassQualifiedName("CPPClass::InnerClass") - private native double nativeMethodOtherP0(long nativePtr); - - // This "struct" will be created by the native side using |createInnerStructA|, - // and used by the java-side somehow. - // Note that |@CalledByNative| has to contain the inner class name. - static class InnerStructA { - private final long mLong; - private final int mInt; - private final String mString; - - private InnerStructA(long l, int i, String s) { - mLong = l; - mInt = i; - mString = s; - } - - @CalledByNative("InnerStructA") - private static InnerStructA create(long l, int i, String s) { - return new InnerStructA(l, i, s); - } - } - - private List<InnerStructA> mListInnerStructA = new ArrayList<InnerStructA>(); - - @CalledByNative - private void addStructA(InnerStructA a) { - // Called by the native side to append another element. - mListInnerStructA.add(a); - } - - @CalledByNative - private void iterateAndDoSomething() { - Iterator<InnerStructA> it = mListInnerStructA.iterator(); - while (it.hasNext()) { - InnerStructA element = it.next(); - // Now, do something with element. - } - // Done, clear the list. - mListInnerStructA.clear(); - } - - // This "struct" will be created by the java side passed to native, which - // will use its getters. - // Note that |@CalledByNative| has to contain the inner class name. - static class InnerStructB { - private final long mKey; - private final String mValue; - - private InnerStructB(long k, String v) { - mKey = k; - mValue = v; - } - - @CalledByNative("InnerStructB") - private long getKey() { - return mKey; - } - - @CalledByNative("InnerStructB") - private String getValue() { - return mValue; - } - } - - List<InnerStructB> mListInnerStructB = new ArrayList<InnerStructB>(); - - void iterateAndDoSomethingWithMap() { - Iterator<InnerStructB> it = mListInnerStructB.iterator(); - while (it.hasNext()) { - InnerStructB element = it.next(); - // Now, do something with element. - nativeAddStructB(mNativeCPPObject, element); - } - nativeIterateAndDoSomethingWithStructB(mNativeCPPObject); - } - - native void nativeAddStructB(long nativeCPPClass, InnerStructB b); - native void nativeIterateAndDoSomethingWithStructB(long nativeCPPClass); - native String nativeReturnAString(long nativeCPPClass); - - // This inner class shows how to annotate native methods on inner classes. - static class InnerClass { - @NativeCall("InnerClass") - private static native int nativeGetInnerIntFunction(); - } -} diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py deleted file mode 100755 index 99d8b42..0000000 --- a/base/android/jni_generator/jni_generator.py +++ /dev/null @@ -1,1418 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Extracts native methods from a Java file and generates the JNI bindings. -If you change this, please run and update the tests.""" - -import collections -import errno -import optparse -import os -import re -import string -from string import Template -import subprocess -import sys -import textwrap -import zipfile - -CHROMIUM_SRC = os.path.join( - os.path.dirname(__file__), os.pardir, os.pardir, os.pardir) -BUILD_ANDROID_GYP = os.path.join( - CHROMIUM_SRC, 'build', 'android', 'gyp') - -sys.path.append(BUILD_ANDROID_GYP) - -from util import build_utils - - -class ParseError(Exception): - """Exception thrown when we can't parse the input file.""" - - def __init__(self, description, *context_lines): - Exception.__init__(self) - self.description = description - self.context_lines = context_lines - - def __str__(self): - context = '\n'.join(self.context_lines) - return '***\nERROR: %s\n\n%s\n***' % (self.description, context) - - -class Param(object): - """Describes a param for a method, either java or native.""" - - def __init__(self, **kwargs): - self.datatype = kwargs['datatype'] - self.name = kwargs['name'] - - -class NativeMethod(object): - """Describes a C/C++ method that is called by Java code""" - - def __init__(self, **kwargs): - self.static = kwargs['static'] - self.java_class_name = kwargs['java_class_name'] - self.return_type = kwargs['return_type'] - self.name = kwargs['name'] - self.params = kwargs['params'] - if self.params: - assert type(self.params) is list - assert type(self.params[0]) is Param - if (self.params and - self.params[0].datatype == kwargs.get('ptr_type', 'int') and - self.params[0].name.startswith('native')): - self.type = 'method' - self.p0_type = self.params[0].name[len('native'):] - if kwargs.get('native_class_name'): - self.p0_type = kwargs['native_class_name'] - else: - self.type = 'function' - self.method_id_var_name = kwargs.get('method_id_var_name', None) - - -class CalledByNative(object): - """Describes a java method exported to c/c++""" - - def __init__(self, **kwargs): - self.system_class = kwargs['system_class'] - self.unchecked = kwargs['unchecked'] - self.static = kwargs['static'] - self.java_class_name = kwargs['java_class_name'] - self.return_type = kwargs['return_type'] - self.name = kwargs['name'] - self.params = kwargs['params'] - self.method_id_var_name = kwargs.get('method_id_var_name', None) - self.signature = kwargs.get('signature') - self.is_constructor = kwargs.get('is_constructor', False) - self.env_call = GetEnvCall(self.is_constructor, self.static, - self.return_type) - self.static_cast = GetStaticCastForReturnType(self.return_type) - - -class ConstantField(object): - def __init__(self, **kwargs): - self.name = kwargs['name'] - self.value = kwargs['value'] - - -def JavaDataTypeToC(java_type): - """Returns a C datatype for the given java type.""" - java_pod_type_map = { - 'int': 'jint', - 'byte': 'jbyte', - 'char': 'jchar', - 'short': 'jshort', - 'boolean': 'jboolean', - 'long': 'jlong', - 'double': 'jdouble', - 'float': 'jfloat', - } - java_type_map = { - 'void': 'void', - 'String': 'jstring', - 'Throwable': 'jthrowable', - 'java/lang/String': 'jstring', - 'java/lang/Class': 'jclass', - 'java/lang/Throwable': 'jthrowable', - } - - if java_type in java_pod_type_map: - return java_pod_type_map[java_type] - elif java_type in java_type_map: - return java_type_map[java_type] - elif java_type.endswith('[]'): - if java_type[:-2] in java_pod_type_map: - return java_pod_type_map[java_type[:-2]] + 'Array' - return 'jobjectArray' - elif java_type.startswith('Class'): - # Checking just the start of the name, rather than a direct comparison, - # in order to handle generics. - return 'jclass' - else: - return 'jobject' - - -def WrapCTypeForDeclaration(c_type): - """Wrap the C datatype in a JavaRef if required.""" - if re.match(RE_SCOPED_JNI_TYPES, c_type): - return 'const base::android::JavaParamRef<' + c_type + '>&' - else: - return c_type - - -def JavaDataTypeToCForDeclaration(java_type): - """Returns a JavaRef-wrapped C datatype for the given java type.""" - return WrapCTypeForDeclaration(JavaDataTypeToC(java_type)) - - -def JavaDataTypeToCForCalledByNativeParam(java_type): - """Returns a C datatype to be when calling from native.""" - if java_type == 'int': - return 'JniIntWrapper' - else: - c_type = JavaDataTypeToC(java_type) - if re.match(RE_SCOPED_JNI_TYPES, c_type): - return 'const base::android::JavaRefOrBare<' + c_type + '>&' - else: - return c_type - - -def JavaReturnValueToC(java_type): - """Returns a valid C return value for the given java type.""" - java_pod_type_map = { - 'int': '0', - 'byte': '0', - 'char': '0', - 'short': '0', - 'boolean': 'false', - 'long': '0', - 'double': '0', - 'float': '0', - 'void': '' - } - return java_pod_type_map.get(java_type, 'NULL') - - -class JniParams(object): - _imports = [] - _fully_qualified_class = '' - _package = '' - _inner_classes = [] - _implicit_imports = [] - - @staticmethod - def SetFullyQualifiedClass(fully_qualified_class): - JniParams._fully_qualified_class = 'L' + fully_qualified_class - JniParams._package = '/'.join(fully_qualified_class.split('/')[:-1]) - - @staticmethod - def AddAdditionalImport(class_name): - assert class_name.endswith('.class') - raw_class_name = class_name[:-len('.class')] - if '.' in raw_class_name: - raise SyntaxError('%s cannot be used in @JNIAdditionalImport. ' - 'Only import unqualified outer classes.' % class_name) - new_import = 'L%s/%s' % (JniParams._package, raw_class_name) - if new_import in JniParams._imports: - raise SyntaxError('Do not use JNIAdditionalImport on an already ' - 'imported class: %s' % (new_import.replace('/', '.'))) - JniParams._imports += [new_import] - - @staticmethod - def ExtractImportsAndInnerClasses(contents): - if not JniParams._package: - raise RuntimeError('SetFullyQualifiedClass must be called before ' - 'ExtractImportsAndInnerClasses') - contents = contents.replace('\n', '') - re_import = re.compile(r'import.*?(?P<class>\S*?);') - for match in re.finditer(re_import, contents): - JniParams._imports += ['L' + match.group('class').replace('.', '/')] - - re_inner = re.compile(r'(class|interface)\s+?(?P<name>\w+?)\W') - for match in re.finditer(re_inner, contents): - inner = match.group('name') - if not JniParams._fully_qualified_class.endswith(inner): - JniParams._inner_classes += [JniParams._fully_qualified_class + '$' + - inner] - - re_additional_imports = re.compile( - r'@JNIAdditionalImport\(\s*{?(?P<class_names>.*?)}?\s*\)') - for match in re.finditer(re_additional_imports, contents): - for class_name in match.group('class_names').split(','): - JniParams.AddAdditionalImport(class_name.strip()) - - @staticmethod - def ParseJavaPSignature(signature_line): - prefix = 'Signature: ' - index = signature_line.find(prefix) - if index == -1: - prefix = 'descriptor: ' - index = signature_line.index(prefix) - return '"%s"' % signature_line[index + len(prefix):] - - @staticmethod - def JavaToJni(param): - """Converts a java param into a JNI signature type.""" - pod_param_map = { - 'int': 'I', - 'boolean': 'Z', - 'char': 'C', - 'short': 'S', - 'long': 'J', - 'double': 'D', - 'float': 'F', - 'byte': 'B', - 'void': 'V', - } - object_param_list = [ - 'Ljava/lang/Boolean', - 'Ljava/lang/Integer', - 'Ljava/lang/Long', - 'Ljava/lang/Object', - 'Ljava/lang/String', - 'Ljava/lang/Class', - 'Ljava/lang/CharSequence', - 'Ljava/lang/Runnable', - 'Ljava/lang/Throwable', - ] - - prefix = '' - # Array? - while param[-2:] == '[]': - prefix += '[' - param = param[:-2] - # Generic? - if '<' in param: - param = param[:param.index('<')] - if param in pod_param_map: - return prefix + pod_param_map[param] - if '/' in param: - # Coming from javap, use the fully qualified param directly. - return prefix + 'L' + param + ';' - - for qualified_name in (object_param_list + - [JniParams._fully_qualified_class] + - JniParams._inner_classes): - if (qualified_name.endswith('/' + param) or - qualified_name.endswith('$' + param.replace('.', '$')) or - qualified_name == 'L' + param): - return prefix + qualified_name + ';' - - # Is it from an import? (e.g. referecing Class from import pkg.Class; - # note that referencing an inner class Inner from import pkg.Class.Inner - # is not supported). - for qualified_name in JniParams._imports: - if qualified_name.endswith('/' + param): - # Ensure it's not an inner class. - components = qualified_name.split('/') - if len(components) > 2 and components[-2][0].isupper(): - raise SyntaxError('Inner class (%s) can not be imported ' - 'and used by JNI (%s). Please import the outer ' - 'class and use Outer.Inner instead.' % - (qualified_name, param)) - return prefix + qualified_name + ';' - - # Is it an inner class from an outer class import? (e.g. referencing - # Class.Inner from import pkg.Class). - if '.' in param: - components = param.split('.') - outer = '/'.join(components[:-1]) - inner = components[-1] - for qualified_name in JniParams._imports: - if qualified_name.endswith('/' + outer): - return (prefix + qualified_name + '$' + inner + ';') - raise SyntaxError('Inner class (%s) can not be ' - 'used directly by JNI. Please import the outer ' - 'class, probably:\n' - 'import %s.%s;' % - (param, JniParams._package.replace('/', '.'), - outer.replace('/', '.'))) - - JniParams._CheckImplicitImports(param) - - # Type not found, falling back to same package as this class. - return (prefix + 'L' + JniParams._package + '/' + param + ';') - - @staticmethod - def _CheckImplicitImports(param): - # Ensure implicit imports, such as java.lang.*, are not being treated - # as being in the same package. - if not JniParams._implicit_imports: - # This file was generated from android.jar and lists - # all classes that are implicitly imported. - with file(os.path.join(os.path.dirname(sys.argv[0]), - 'android_jar.classes'), 'r') as f: - JniParams._implicit_imports = f.readlines() - for implicit_import in JniParams._implicit_imports: - implicit_import = implicit_import.strip().replace('.class', '') - implicit_import = implicit_import.replace('/', '.') - if implicit_import.endswith('.' + param): - raise SyntaxError('Ambiguous class (%s) can not be used directly ' - 'by JNI.\nPlease import it, probably:\n\n' - 'import %s;' % - (param, implicit_import)) - - - @staticmethod - def Signature(params, returns, wrap): - """Returns the JNI signature for the given datatypes.""" - items = ['('] - items += [JniParams.JavaToJni(param.datatype) for param in params] - items += [')'] - items += [JniParams.JavaToJni(returns)] - if wrap: - return '\n' + '\n'.join(['"' + item + '"' for item in items]) - else: - return '"' + ''.join(items) + '"' - - @staticmethod - def Parse(params): - """Parses the params into a list of Param objects.""" - if not params: - return [] - ret = [] - for p in [p.strip() for p in params.split(',')]: - items = p.split(' ') - - # Remove @Annotations from parameters. - while items[0].startswith('@'): - del items[0] - - if 'final' in items: - items.remove('final') - - param = Param( - datatype=items[0], - name=(items[1] if len(items) > 1 else 'p%s' % len(ret)), - ) - ret += [param] - return ret - - -def ExtractJNINamespace(contents): - re_jni_namespace = re.compile('.*?@JNINamespace\("(.*?)"\)') - m = re.findall(re_jni_namespace, contents) - if not m: - return '' - return m[0] - - -def ExtractFullyQualifiedJavaClassName(java_file_name, contents): - re_package = re.compile('.*?package (.*?);') - matches = re.findall(re_package, contents) - if not matches: - raise SyntaxError('Unable to find "package" line in %s' % java_file_name) - return (matches[0].replace('.', '/') + '/' + - os.path.splitext(os.path.basename(java_file_name))[0]) - - -def ExtractNatives(contents, ptr_type): - """Returns a list of dict containing information about a native method.""" - contents = contents.replace('\n', '') - natives = [] - re_native = re.compile(r'(@NativeClassQualifiedName' - '\(\"(?P<native_class_name>.*?)\"\)\s+)?' - '(@NativeCall(\(\"(?P<java_class_name>.*?)\"\))\s+)?' - '(?P<qualifiers>\w+\s\w+|\w+|\s+)\s*native ' - '(?P<return_type>\S*) ' - '(?P<name>native\w+)\((?P<params>.*?)\);') - for match in re.finditer(re_native, contents): - native = NativeMethod( - static='static' in match.group('qualifiers'), - java_class_name=match.group('java_class_name'), - native_class_name=match.group('native_class_name'), - return_type=match.group('return_type'), - name=match.group('name').replace('native', ''), - params=JniParams.Parse(match.group('params')), - ptr_type=ptr_type) - natives += [native] - return natives - - -def IsMainDexJavaClass(contents): - """Returns "true" if the class is annotated with "@MainDex", "false" if not. - - JNI registration doesn't always need to be completed for non-browser processes - since most Java code is only used by the browser process. Classes that are - needed by non-browser processes must explicitly be annotated with @MainDex - to force JNI registration. - """ - re_maindex = re.compile(r'@MainDex[\s\S]*class\s+\w+\s*{') - found = re.search(re_maindex, contents) - return 'true' if found else 'false' - - -def GetStaticCastForReturnType(return_type): - type_map = { 'String' : 'jstring', - 'java/lang/String' : 'jstring', - 'Throwable': 'jthrowable', - 'java/lang/Throwable': 'jthrowable', - 'boolean[]': 'jbooleanArray', - 'byte[]': 'jbyteArray', - 'char[]': 'jcharArray', - 'short[]': 'jshortArray', - 'int[]': 'jintArray', - 'long[]': 'jlongArray', - 'float[]': 'jfloatArray', - 'double[]': 'jdoubleArray' } - ret = type_map.get(return_type, None) - if ret: - return ret - if return_type.endswith('[]'): - return 'jobjectArray' - return None - - -def GetEnvCall(is_constructor, is_static, return_type): - """Maps the types availabe via env->Call__Method.""" - if is_constructor: - return 'NewObject' - env_call_map = {'boolean': 'Boolean', - 'byte': 'Byte', - 'char': 'Char', - 'short': 'Short', - 'int': 'Int', - 'long': 'Long', - 'float': 'Float', - 'void': 'Void', - 'double': 'Double', - 'Object': 'Object', - } - call = env_call_map.get(return_type, 'Object') - if is_static: - call = 'Static' + call - return 'Call' + call + 'Method' - - -def GetMangledParam(datatype): - """Returns a mangled identifier for the datatype.""" - if len(datatype) <= 2: - return datatype.replace('[', 'A') - ret = '' - for i in range(1, len(datatype)): - c = datatype[i] - if c == '[': - ret += 'A' - elif c.isupper() or datatype[i - 1] in ['/', 'L']: - ret += c.upper() - return ret - - -def GetMangledMethodName(name, params, return_type): - """Returns a mangled method name for the given signature. - - The returned name can be used as a C identifier and will be unique for all - valid overloads of the same method. - - Args: - name: string. - params: list of Param. - return_type: string. - - Returns: - A mangled name. - """ - mangled_items = [] - for datatype in [return_type] + [x.datatype for x in params]: - mangled_items += [GetMangledParam(JniParams.JavaToJni(datatype))] - mangled_name = name + '_'.join(mangled_items) - assert re.match(r'[0-9a-zA-Z_]+', mangled_name) - return mangled_name - - -def MangleCalledByNatives(called_by_natives): - """Mangles all the overloads from the call_by_natives list.""" - method_counts = collections.defaultdict( - lambda: collections.defaultdict(lambda: 0)) - for called_by_native in called_by_natives: - java_class_name = called_by_native.java_class_name - name = called_by_native.name - method_counts[java_class_name][name] += 1 - for called_by_native in called_by_natives: - java_class_name = called_by_native.java_class_name - method_name = called_by_native.name - method_id_var_name = method_name - if method_counts[java_class_name][method_name] > 1: - method_id_var_name = GetMangledMethodName(method_name, - called_by_native.params, - called_by_native.return_type) - called_by_native.method_id_var_name = method_id_var_name - return called_by_natives - - -# Regex to match the JNI types that should be wrapped in a JavaRef. -RE_SCOPED_JNI_TYPES = re.compile('jobject|jclass|jstring|jthrowable|.*Array') - - -# Regex to match a string like "@CalledByNative public void foo(int bar)". -RE_CALLED_BY_NATIVE = re.compile( - '@CalledByNative(?P<Unchecked>(Unchecked)*?)(?:\("(?P<annotation>.*)"\))?' - '\s+(?P<prefix>[\w ]*?)' - '(:?\s*@\w+)?' # Ignore annotations in return types. - '\s*(?P<return_type>\S+?)' - '\s+(?P<name>\w+)' - '\s*\((?P<params>[^\)]*)\)') - - -# Removes empty lines that are indented (i.e. start with 2x spaces). -def RemoveIndentedEmptyLines(string): - return re.sub('^(?: {2})+$\n', '', string, flags=re.MULTILINE) - - -def ExtractCalledByNatives(contents): - """Parses all methods annotated with @CalledByNative. - - Args: - contents: the contents of the java file. - - Returns: - A list of dict with information about the annotated methods. - TODO(bulach): return a CalledByNative object. - - Raises: - ParseError: if unable to parse. - """ - called_by_natives = [] - for match in re.finditer(RE_CALLED_BY_NATIVE, contents): - called_by_natives += [CalledByNative( - system_class=False, - unchecked='Unchecked' in match.group('Unchecked'), - static='static' in match.group('prefix'), - java_class_name=match.group('annotation') or '', - return_type=match.group('return_type'), - name=match.group('name'), - params=JniParams.Parse(match.group('params')))] - # Check for any @CalledByNative occurrences that weren't matched. - unmatched_lines = re.sub(RE_CALLED_BY_NATIVE, '', contents).split('\n') - for line1, line2 in zip(unmatched_lines, unmatched_lines[1:]): - if '@CalledByNative' in line1: - raise ParseError('could not parse @CalledByNative method signature', - line1, line2) - return MangleCalledByNatives(called_by_natives) - - -class JNIFromJavaP(object): - """Uses 'javap' to parse a .class file and generate the JNI header file.""" - - def __init__(self, contents, options): - self.contents = contents - self.namespace = options.namespace - for line in contents: - class_name = re.match( - '.*?(public).*?(class|interface) (?P<class_name>\S+?)( |\Z)', - line) - if class_name: - self.fully_qualified_class = class_name.group('class_name') - break - self.fully_qualified_class = self.fully_qualified_class.replace('.', '/') - # Java 7's javap includes type parameters in output, like HashSet<T>. Strip - # away the <...> and use the raw class name that Java 6 would've given us. - self.fully_qualified_class = self.fully_qualified_class.split('<', 1)[0] - JniParams.SetFullyQualifiedClass(self.fully_qualified_class) - self.java_class_name = self.fully_qualified_class.split('/')[-1] - if not self.namespace: - self.namespace = 'JNI_' + self.java_class_name - re_method = re.compile('(?P<prefix>.*?)(?P<return_type>\S+?) (?P<name>\w+?)' - '\((?P<params>.*?)\)') - self.called_by_natives = [] - for lineno, content in enumerate(contents[2:], 2): - match = re.match(re_method, content) - if not match: - continue - self.called_by_natives += [CalledByNative( - system_class=True, - unchecked=False, - static='static' in match.group('prefix'), - java_class_name='', - return_type=match.group('return_type').replace('.', '/'), - name=match.group('name'), - params=JniParams.Parse(match.group('params').replace('.', '/')), - signature=JniParams.ParseJavaPSignature(contents[lineno + 1]))] - re_constructor = re.compile('(.*?)public ' + - self.fully_qualified_class.replace('/', '.') + - '\((?P<params>.*?)\)') - for lineno, content in enumerate(contents[2:], 2): - match = re.match(re_constructor, content) - if not match: - continue - self.called_by_natives += [CalledByNative( - system_class=True, - unchecked=False, - static=False, - java_class_name='', - return_type=self.fully_qualified_class, - name='Constructor', - params=JniParams.Parse(match.group('params').replace('.', '/')), - signature=JniParams.ParseJavaPSignature(contents[lineno + 1]), - is_constructor=True)] - self.called_by_natives = MangleCalledByNatives(self.called_by_natives) - - self.constant_fields = [] - re_constant_field = re.compile('.*?public static final int (?P<name>.*?);') - re_constant_field_value = re.compile( - '.*?Constant(Value| value): int (?P<value>(-*[0-9]+)?)') - for lineno, content in enumerate(contents[2:], 2): - match = re.match(re_constant_field, content) - if not match: - continue - value = re.match(re_constant_field_value, contents[lineno + 2]) - if not value: - value = re.match(re_constant_field_value, contents[lineno + 3]) - if value: - self.constant_fields.append( - ConstantField(name=match.group('name'), - value=value.group('value'))) - - self.inl_header_file_generator = InlHeaderFileGenerator( - self.namespace, self.fully_qualified_class, [], self.called_by_natives, - self.constant_fields, options) - - def GetContent(self): - return self.inl_header_file_generator.GetContent() - - @staticmethod - def CreateFromClass(class_file, options): - class_name = os.path.splitext(os.path.basename(class_file))[0] - p = subprocess.Popen(args=[options.javap, '-c', '-verbose', - '-s', class_name], - cwd=os.path.dirname(class_file), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, _ = p.communicate() - jni_from_javap = JNIFromJavaP(stdout.split('\n'), options) - return jni_from_javap - - -class JNIFromJavaSource(object): - """Uses the given java source file to generate the JNI header file.""" - - # Match single line comments, multiline comments, character literals, and - # double-quoted strings. - _comment_remover_regex = re.compile( - r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', - re.DOTALL | re.MULTILINE) - - def __init__(self, contents, fully_qualified_class, options): - contents = self._RemoveComments(contents) - JniParams.SetFullyQualifiedClass(fully_qualified_class) - JniParams.ExtractImportsAndInnerClasses(contents) - jni_namespace = ExtractJNINamespace(contents) or options.namespace - natives = ExtractNatives(contents, options.ptr_type) - called_by_natives = ExtractCalledByNatives(contents) - maindex = IsMainDexJavaClass(contents) - if len(natives) == 0 and len(called_by_natives) == 0: - raise SyntaxError('Unable to find any JNI methods for %s.' % - fully_qualified_class) - inl_header_file_generator = InlHeaderFileGenerator( - jni_namespace, fully_qualified_class, natives, called_by_natives, [], - options, maindex) - self.content = inl_header_file_generator.GetContent() - - @classmethod - def _RemoveComments(cls, contents): - # We need to support both inline and block comments, and we need to handle - # strings that contain '//' or '/*'. - # TODO(bulach): This is a bit hacky. It would be cleaner to use a real Java - # parser. Maybe we could ditch JNIFromJavaSource and just always use - # JNIFromJavaP; or maybe we could rewrite this script in Java and use APT. - # http://code.google.com/p/chromium/issues/detail?id=138941 - def replacer(match): - # Replace matches that are comments with nothing; return literals/strings - # unchanged. - s = match.group(0) - if s.startswith('/'): - return '' - else: - return s - return cls._comment_remover_regex.sub(replacer, contents) - - def GetContent(self): - return self.content - - @staticmethod - def CreateFromFile(java_file_name, options): - contents = file(java_file_name).read() - fully_qualified_class = ExtractFullyQualifiedJavaClassName(java_file_name, - contents) - return JNIFromJavaSource(contents, fully_qualified_class, options) - - -class InlHeaderFileGenerator(object): - """Generates an inline header file for JNI integration.""" - - def __init__(self, namespace, fully_qualified_class, natives, - called_by_natives, constant_fields, options, maindex='false'): - self.namespace = namespace - self.fully_qualified_class = fully_qualified_class - self.class_name = self.fully_qualified_class.split('/')[-1] - self.natives = natives - self.called_by_natives = called_by_natives - self.header_guard = fully_qualified_class.replace('/', '_') + '_JNI' - self.constant_fields = constant_fields - self.maindex = maindex - self.options = options - - - def GetContent(self): - """Returns the content of the JNI binding file.""" - template = Template("""\ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - -// This file is autogenerated by -// ${SCRIPT_NAME} -// For -// ${FULLY_QUALIFIED_CLASS} - -#ifndef ${HEADER_GUARD} -#define ${HEADER_GUARD} - -#include <jni.h> - -${INCLUDES} - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -$CLASS_PATH_DEFINITIONS - -} // namespace - -$OPEN_NAMESPACE - -$CONSTANT_FIELDS - -// Step 2: method stubs. -$METHOD_STUBS - -// Step 3: RegisterNatives. -$JNI_NATIVE_METHODS -$REGISTER_NATIVES -$CLOSE_NAMESPACE - -#endif // ${HEADER_GUARD} -""") - values = { - 'SCRIPT_NAME': self.options.script_name, - 'FULLY_QUALIFIED_CLASS': self.fully_qualified_class, - 'CLASS_PATH_DEFINITIONS': self.GetClassPathDefinitionsString(), - 'CONSTANT_FIELDS': self.GetConstantFieldsString(), - 'METHOD_STUBS': self.GetMethodStubsString(), - 'OPEN_NAMESPACE': self.GetOpenNamespaceString(), - 'JNI_NATIVE_METHODS': self.GetJNINativeMethodsString(), - 'REGISTER_NATIVES': self.GetRegisterNativesString(), - 'CLOSE_NAMESPACE': self.GetCloseNamespaceString(), - 'HEADER_GUARD': self.header_guard, - 'INCLUDES': self.GetIncludesString(), - } - assert ((values['JNI_NATIVE_METHODS'] == '') == - (values['REGISTER_NATIVES'] == '')) - return WrapOutput(template.substitute(values)) - - def GetClassPathDefinitionsString(self): - ret = [] - ret += [self.GetClassPathDefinitions()] - return '\n'.join(ret) - - def GetConstantFieldsString(self): - if not self.constant_fields: - return '' - ret = ['enum Java_%s_constant_fields {' % self.class_name] - for c in self.constant_fields: - ret += [' %s = %s,' % (c.name, c.value)] - ret += ['};'] - return '\n'.join(ret) - - def GetMethodStubsString(self): - """Returns the code corresponding to method stubs.""" - ret = [] - for native in self.natives: - ret += [self.GetNativeStub(native)] - ret += self.GetLazyCalledByNativeMethodStubs() - return '\n'.join(ret) - - def GetLazyCalledByNativeMethodStubs(self): - return [self.GetLazyCalledByNativeMethodStub(called_by_native) - for called_by_native in self.called_by_natives] - - def GetIncludesString(self): - if not self.options.includes: - return '' - includes = self.options.includes.split(',') - return '\n'.join('#include "%s"' % x for x in includes) - - def GetKMethodsString(self, clazz): - ret = [] - for native in self.natives: - if (native.java_class_name == clazz or - (not native.java_class_name and clazz == self.class_name)): - ret += [self.GetKMethodArrayEntry(native)] - return '\n'.join(ret) - - def SubstituteNativeMethods(self, template): - """Substitutes JAVA_CLASS and KMETHODS in the provided template.""" - ret = [] - all_classes = self.GetUniqueClasses(self.natives) - all_classes[self.class_name] = self.fully_qualified_class - for clazz in all_classes: - kmethods = self.GetKMethodsString(clazz) - if kmethods: - values = {'JAVA_CLASS': clazz, - 'KMETHODS': kmethods} - ret += [template.substitute(values)] - if not ret: return '' - return '\n' + '\n'.join(ret) - - def GetJNINativeMethodsString(self): - """Returns the implementation of the array of native methods.""" - if not self.options.native_exports_optional: - return '' - template = Template("""\ -static const JNINativeMethod kMethods${JAVA_CLASS}[] = { -${KMETHODS} -}; -""") - return self.SubstituteNativeMethods(template) - - def GetRegisterNativesString(self): - """Returns the code for RegisterNatives.""" - natives = self.GetRegisterNativesImplString() - if not natives: - return '' - - template = Template("""\ -${REGISTER_NATIVES_SIGNATURE} { -${EARLY_EXIT} -${NATIVES} - return true; -} -""") - signature = 'static bool RegisterNativesImpl(JNIEnv* env)' - early_exit = '' - if self.options.native_exports_optional: - early_exit = """\ - if (jni_generator::ShouldSkipJniRegistration(%s)) - return true; -""" % self.maindex - - values = {'REGISTER_NATIVES_SIGNATURE': signature, - 'EARLY_EXIT': early_exit, - 'NATIVES': natives, - } - - return template.substitute(values) - - def GetRegisterNativesImplString(self): - """Returns the shared implementation for RegisterNatives.""" - if not self.options.native_exports_optional: - return '' - - template = Template("""\ - const int kMethods${JAVA_CLASS}Size = arraysize(kMethods${JAVA_CLASS}); - - if (env->RegisterNatives(${JAVA_CLASS}_clazz(env), - kMethods${JAVA_CLASS}, - kMethods${JAVA_CLASS}Size) < 0) { - jni_generator::HandleRegistrationError( - env, ${JAVA_CLASS}_clazz(env), __FILE__); - return false; - } -""") - return self.SubstituteNativeMethods(template) - - def GetOpenNamespaceString(self): - if self.namespace: - all_namespaces = ['namespace %s {' % ns - for ns in self.namespace.split('::')] - return '\n'.join(all_namespaces) - return '' - - def GetCloseNamespaceString(self): - if self.namespace: - all_namespaces = ['} // namespace %s' % ns - for ns in self.namespace.split('::')] - all_namespaces.reverse() - return '\n'.join(all_namespaces) + '\n' - return '' - - def GetJNIFirstParamType(self, native): - if native.type == 'method': - return 'jobject' - elif native.type == 'function': - if native.static: - return 'jclass' - else: - return 'jobject' - - def GetJNIFirstParam(self, native, for_declaration): - c_type = self.GetJNIFirstParamType(native) - if for_declaration: - c_type = WrapCTypeForDeclaration(c_type) - return [c_type + ' jcaller'] - - def GetParamsInDeclaration(self, native): - """Returns the params for the forward declaration. - - Args: - native: the native dictionary describing the method. - - Returns: - A string containing the params. - """ - return ',\n '.join(self.GetJNIFirstParam(native, True) + - [JavaDataTypeToCForDeclaration(param.datatype) + ' ' + - param.name - for param in native.params]) - - def GetParamsInStub(self, native): - """Returns the params for the stub declaration. - - Args: - native: the native dictionary describing the method. - - Returns: - A string containing the params. - """ - return ',\n '.join(self.GetJNIFirstParam(native, False) + - [JavaDataTypeToC(param.datatype) + ' ' + - param.name - for param in native.params]) - - def GetCalledByNativeParamsInDeclaration(self, called_by_native): - return ',\n '.join([ - JavaDataTypeToCForCalledByNativeParam(param.datatype) + ' ' + - param.name - for param in called_by_native.params]) - - def GetStubName(self, native): - """Return the name of the stub function for this native method. - - Args: - native: the native dictionary describing the method. - - Returns: - A string with the stub function name (used by the JVM). - """ - template = Template("Java_${JAVA_NAME}_native${NAME}") - - java_name = self.fully_qualified_class.replace('_', '_1').replace('/', '_') - if native.java_class_name: - java_name += '_00024' + native.java_class_name - - values = {'NAME': native.name, - 'JAVA_NAME': java_name} - return template.substitute(values) - - def GetJavaParamRefForCall(self, c_type, name): - return Template( - 'base::android::JavaParamRef<${TYPE}>(env, ${NAME})').substitute({ - 'TYPE': c_type, - 'NAME': name, - }) - - def GetJNIFirstParamForCall(self, native): - c_type = self.GetJNIFirstParamType(native) - return [self.GetJavaParamRefForCall(c_type, 'jcaller')] - - def GetNativeStub(self, native): - is_method = native.type == 'method' - - if is_method: - params = native.params[1:] - else: - params = native.params - params_in_call = ['env'] + self.GetJNIFirstParamForCall(native) - for p in params: - c_type = JavaDataTypeToC(p.datatype) - if re.match(RE_SCOPED_JNI_TYPES, c_type): - params_in_call.append(self.GetJavaParamRefForCall(c_type, p.name)) - else: - params_in_call.append(p.name) - params_in_call = ', '.join(params_in_call) - - return_type = return_declaration = JavaDataTypeToC(native.return_type) - post_call = '' - if re.match(RE_SCOPED_JNI_TYPES, return_type): - post_call = '.Release()' - return_declaration = ('base::android::ScopedJavaLocalRef<' + return_type + - '>') - profiling_entered_native = '' - if self.options.enable_profiling: - profiling_entered_native = 'JNI_LINK_SAVED_FRAME_POINTER;' - values = { - 'RETURN': return_type, - 'RETURN_DECLARATION': return_declaration, - 'NAME': native.name, - 'PARAMS': self.GetParamsInDeclaration(native), - 'PARAMS_IN_STUB': self.GetParamsInStub(native), - 'PARAMS_IN_CALL': params_in_call, - 'POST_CALL': post_call, - 'STUB_NAME': self.GetStubName(native), - 'PROFILING_ENTERED_NATIVE': profiling_entered_native, - } - - if is_method: - optional_error_return = JavaReturnValueToC(native.return_type) - if optional_error_return: - optional_error_return = ', ' + optional_error_return - values.update({ - 'OPTIONAL_ERROR_RETURN': optional_error_return, - 'PARAM0_NAME': native.params[0].name, - 'P0_TYPE': native.p0_type, - }) - template = Template("""\ -JNI_GENERATOR_EXPORT ${RETURN} ${STUB_NAME}(JNIEnv* env, ${PARAMS_IN_STUB}) { - ${PROFILING_ENTERED_NATIVE} - ${P0_TYPE}* native = reinterpret_cast<${P0_TYPE}*>(${PARAM0_NAME}); - CHECK_NATIVE_PTR(env, jcaller, native, "${NAME}"${OPTIONAL_ERROR_RETURN}); - return native->${NAME}(${PARAMS_IN_CALL})${POST_CALL}; -} -""") - else: - template = Template(""" -static ${RETURN_DECLARATION} ${NAME}(JNIEnv* env, ${PARAMS}); - -JNI_GENERATOR_EXPORT ${RETURN} ${STUB_NAME}(JNIEnv* env, ${PARAMS_IN_STUB}) { - ${PROFILING_ENTERED_NATIVE} - return ${NAME}(${PARAMS_IN_CALL})${POST_CALL}; -} -""") - - return RemoveIndentedEmptyLines(template.substitute(values)) - - def GetArgument(self, param): - if param.datatype == 'int': - return 'as_jint(' + param.name + ')' - elif re.match(RE_SCOPED_JNI_TYPES, JavaDataTypeToC(param.datatype)): - return param.name + '.obj()' - else: - return param.name - - def GetArgumentsInCall(self, params): - """Return a string of arguments to call from native into Java""" - return [self.GetArgument(p) for p in params] - - def GetCalledByNativeValues(self, called_by_native): - """Fills in necessary values for the CalledByNative methods.""" - java_class = called_by_native.java_class_name or self.class_name - if called_by_native.static or called_by_native.is_constructor: - first_param_in_declaration = '' - first_param_in_call = ('%s_clazz(env)' % java_class) - else: - first_param_in_declaration = ( - ', const base::android::JavaRefOrBare<jobject>& obj') - first_param_in_call = 'obj.obj()' - params_in_declaration = self.GetCalledByNativeParamsInDeclaration( - called_by_native) - if params_in_declaration: - params_in_declaration = ', ' + params_in_declaration - params_in_call = ', '.join(self.GetArgumentsInCall(called_by_native.params)) - if params_in_call: - params_in_call = ', ' + params_in_call - pre_call = '' - post_call = '' - if called_by_native.static_cast: - pre_call = 'static_cast<%s>(' % called_by_native.static_cast - post_call = ')' - check_exception = '' - if not called_by_native.unchecked: - check_exception = 'jni_generator::CheckException(env);' - return_type = JavaDataTypeToC(called_by_native.return_type) - optional_error_return = JavaReturnValueToC(called_by_native.return_type) - if optional_error_return: - optional_error_return = ', ' + optional_error_return - return_declaration = '' - return_clause = '' - if return_type != 'void': - pre_call = ' ' + pre_call - return_declaration = return_type + ' ret =' - if re.match(RE_SCOPED_JNI_TYPES, return_type): - return_type = 'base::android::ScopedJavaLocalRef<' + return_type + '>' - return_clause = 'return ' + return_type + '(env, ret);' - else: - return_clause = 'return ret;' - profiling_leaving_native = '' - if self.options.enable_profiling: - profiling_leaving_native = 'JNI_SAVE_FRAME_POINTER;' - return { - 'JAVA_CLASS': java_class, - 'RETURN_TYPE': return_type, - 'OPTIONAL_ERROR_RETURN': optional_error_return, - 'RETURN_DECLARATION': return_declaration, - 'RETURN_CLAUSE': return_clause, - 'FIRST_PARAM_IN_DECLARATION': first_param_in_declaration, - 'PARAMS_IN_DECLARATION': params_in_declaration, - 'PRE_CALL': pre_call, - 'POST_CALL': post_call, - 'ENV_CALL': called_by_native.env_call, - 'FIRST_PARAM_IN_CALL': first_param_in_call, - 'PARAMS_IN_CALL': params_in_call, - 'METHOD_ID_VAR_NAME': called_by_native.method_id_var_name, - 'CHECK_EXCEPTION': check_exception, - 'GET_METHOD_ID_IMPL': self.GetMethodIDImpl(called_by_native), - 'PROFILING_LEAVING_NATIVE': profiling_leaving_native, - } - - - def GetLazyCalledByNativeMethodStub(self, called_by_native): - """Returns a string.""" - function_signature_template = Template("""\ -static ${RETURN_TYPE} Java_${JAVA_CLASS}_${METHOD_ID_VAR_NAME}(\ -JNIEnv* env${FIRST_PARAM_IN_DECLARATION}${PARAMS_IN_DECLARATION})""") - function_header_template = Template("""\ -${FUNCTION_SIGNATURE} {""") - function_header_with_unused_template = Template("""\ -${FUNCTION_SIGNATURE} __attribute__ ((unused)); -${FUNCTION_SIGNATURE} {""") - template = Template(""" -static base::subtle::AtomicWord g_${JAVA_CLASS}_${METHOD_ID_VAR_NAME} = 0; -${FUNCTION_HEADER} - CHECK_CLAZZ(env, ${FIRST_PARAM_IN_CALL}, - ${JAVA_CLASS}_clazz(env)${OPTIONAL_ERROR_RETURN}); - jmethodID method_id = - ${GET_METHOD_ID_IMPL} - ${PROFILING_LEAVING_NATIVE} - ${RETURN_DECLARATION} - ${PRE_CALL}env->${ENV_CALL}(${FIRST_PARAM_IN_CALL}, - method_id${PARAMS_IN_CALL})${POST_CALL}; - ${CHECK_EXCEPTION} - ${RETURN_CLAUSE} -}""") - values = self.GetCalledByNativeValues(called_by_native) - values['FUNCTION_SIGNATURE'] = ( - function_signature_template.substitute(values)) - if called_by_native.system_class: - values['FUNCTION_HEADER'] = ( - function_header_with_unused_template.substitute(values)) - else: - values['FUNCTION_HEADER'] = function_header_template.substitute(values) - return RemoveIndentedEmptyLines(template.substitute(values)) - - def GetKMethodArrayEntry(self, native): - template = Template(' { "native${NAME}", ${JNI_SIGNATURE}, ' + - 'reinterpret_cast<void*>(${STUB_NAME}) },') - values = {'NAME': native.name, - 'JNI_SIGNATURE': JniParams.Signature(native.params, - native.return_type, - True), - 'STUB_NAME': self.GetStubName(native)} - return template.substitute(values) - - def GetUniqueClasses(self, origin): - ret = {self.class_name: self.fully_qualified_class} - for entry in origin: - class_name = self.class_name - jni_class_path = self.fully_qualified_class - if entry.java_class_name: - class_name = entry.java_class_name - jni_class_path = self.fully_qualified_class + '$' + class_name - ret[class_name] = jni_class_path - return ret - - def GetClassPathDefinitions(self): - """Returns the ClassPath constants.""" - ret = [] - template = Template("""\ -const char k${JAVA_CLASS}ClassPath[] = "${JNI_CLASS_PATH}";""") - all_classes = self.GetUniqueClasses(self.called_by_natives) - if self.options.native_exports_optional: - all_classes.update(self.GetUniqueClasses(self.natives)) - - for clazz in all_classes: - values = { - 'JAVA_CLASS': clazz, - 'JNI_CLASS_PATH': all_classes[clazz], - } - ret += [template.substitute(values)] - ret += '' - - template = Template("""\ -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_${JAVA_CLASS}_clazz __attribute__((unused)) = 0; -#define ${JAVA_CLASS}_clazz(env) \ -base::android::LazyGetClass(env, k${JAVA_CLASS}ClassPath, \ -&g_${JAVA_CLASS}_clazz)""") - - for clazz in all_classes: - values = { - 'JAVA_CLASS': clazz, - } - ret += [template.substitute(values)] - - return '\n'.join(ret) - - def GetMethodIDImpl(self, called_by_native): - """Returns the implementation of GetMethodID.""" - template = Template("""\ - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_${STATIC}>( - env, ${JAVA_CLASS}_clazz(env), - "${JNI_NAME}", - ${JNI_SIGNATURE}, - &g_${JAVA_CLASS}_${METHOD_ID_VAR_NAME}); -""") - jni_name = called_by_native.name - jni_return_type = called_by_native.return_type - if called_by_native.is_constructor: - jni_name = '<init>' - jni_return_type = 'void' - if called_by_native.signature: - signature = called_by_native.signature - else: - signature = JniParams.Signature(called_by_native.params, - jni_return_type, - True) - values = { - 'JAVA_CLASS': called_by_native.java_class_name or self.class_name, - 'JNI_NAME': jni_name, - 'METHOD_ID_VAR_NAME': called_by_native.method_id_var_name, - 'STATIC': 'STATIC' if called_by_native.static else 'INSTANCE', - 'JNI_SIGNATURE': signature, - } - return template.substitute(values) - - -def WrapOutput(output): - ret = [] - for line in output.splitlines(): - # Do not wrap lines under 80 characters or preprocessor directives. - if len(line) < 80 or line.lstrip()[:1] == '#': - stripped = line.rstrip() - if len(ret) == 0 or len(ret[-1]) or len(stripped): - ret.append(stripped) - else: - first_line_indent = ' ' * (len(line) - len(line.lstrip())) - subsequent_indent = first_line_indent + ' ' * 4 - if line.startswith('//'): - subsequent_indent = '//' + subsequent_indent - wrapper = textwrap.TextWrapper(width=80, - subsequent_indent=subsequent_indent, - break_long_words=False) - ret += [wrapped.rstrip() for wrapped in wrapper.wrap(line)] - ret += [''] - return '\n'.join(ret) - - -def ExtractJarInputFile(jar_file, input_file, out_dir): - """Extracts input file from jar and returns the filename. - - The input file is extracted to the same directory that the generated jni - headers will be placed in. This is passed as an argument to script. - - Args: - jar_file: the jar file containing the input files to extract. - input_files: the list of files to extract from the jar file. - out_dir: the name of the directories to extract to. - - Returns: - the name of extracted input file. - """ - jar_file = zipfile.ZipFile(jar_file) - - out_dir = os.path.join(out_dir, os.path.dirname(input_file)) - try: - os.makedirs(out_dir) - except OSError as e: - if e.errno != errno.EEXIST: - raise - extracted_file_name = os.path.join(out_dir, os.path.basename(input_file)) - with open(extracted_file_name, 'w') as outfile: - outfile.write(jar_file.read(input_file)) - - return extracted_file_name - - -def GenerateJNIHeader(input_file, output_file, options): - try: - if os.path.splitext(input_file)[1] == '.class': - jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, options) - content = jni_from_javap.GetContent() - else: - jni_from_java_source = JNIFromJavaSource.CreateFromFile( - input_file, options) - content = jni_from_java_source.GetContent() - except ParseError, e: - print e - sys.exit(1) - if output_file: - if not os.path.exists(os.path.dirname(os.path.abspath(output_file))): - os.makedirs(os.path.dirname(os.path.abspath(output_file))) - if options.optimize_generation and os.path.exists(output_file): - with file(output_file, 'r') as f: - existing_content = f.read() - if existing_content == content: - return - with file(output_file, 'w') as f: - f.write(content) - else: - print content - - -def GetScriptName(): - script_components = os.path.abspath(sys.argv[0]).split(os.path.sep) - base_index = 0 - for idx, value in enumerate(script_components): - if value == 'base' or value == 'third_party': - base_index = idx - break - return os.sep.join(script_components[base_index:]) - - -def main(argv): - usage = """usage: %prog [OPTIONS] -This script will parse the given java source code extracting the native -declarations and print the header file to stdout (or a file). -See SampleForTests.java for more details. - """ - option_parser = optparse.OptionParser(usage=usage) - build_utils.AddDepfileOption(option_parser) - - option_parser.add_option('-j', '--jar_file', dest='jar_file', - help='Extract the list of input files from' - ' a specified jar file.' - ' Uses javap to extract the methods from a' - ' pre-compiled class. --input should point' - ' to pre-compiled Java .class files.') - option_parser.add_option('-n', dest='namespace', - help='Uses as a namespace in the generated header ' - 'instead of the javap class name, or when there is ' - 'no JNINamespace annotation in the java source.') - option_parser.add_option('--input_file', - help='Single input file name. The output file name ' - 'will be derived from it. Must be used with ' - '--output_dir.') - option_parser.add_option('--output_dir', - help='The output directory. Must be used with ' - '--input') - option_parser.add_option('--optimize_generation', type="int", - default=0, help='Whether we should optimize JNI ' - 'generation by not regenerating files if they have ' - 'not changed.') - option_parser.add_option('--script_name', default=GetScriptName(), - help='The name of this script in the generated ' - 'header.') - option_parser.add_option('--includes', - help='The comma-separated list of header files to ' - 'include in the generated header.') - option_parser.add_option('--ptr_type', default='int', - type='choice', choices=['int', 'long'], - help='The type used to represent native pointers in ' - 'Java code. For 32-bit, use int; ' - 'for 64-bit, use long.') - option_parser.add_option('--cpp', default='cpp', - help='The path to cpp command.') - option_parser.add_option('--javap', default='javap', - help='The path to javap command.') - option_parser.add_option('--native_exports_optional', action='store_true', - help='Support both explicit and native method' - 'registration.') - option_parser.add_option('--enable_profiling', action='store_true', - help='Add additional profiling instrumentation.') - options, args = option_parser.parse_args(argv) - if options.jar_file: - input_file = ExtractJarInputFile(options.jar_file, options.input_file, - options.output_dir) - elif options.input_file: - input_file = options.input_file - else: - option_parser.print_help() - print '\nError: Must specify --jar_file or --input_file.' - return 1 - output_file = None - if options.output_dir: - root_name = os.path.splitext(os.path.basename(input_file))[0] - output_file = os.path.join(options.output_dir, root_name) + '_jni.h' - GenerateJNIHeader(input_file, output_file, options) - - if options.depfile: - build_utils.WriteDepfile(options.depfile, output_file) - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/base/android/jni_generator/jni_generator_helper.h b/base/android/jni_generator/jni_generator_helper.h deleted file mode 100644 index 3062806..0000000 --- a/base/android/jni_generator/jni_generator_helper.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ -#define BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ - -#include <jni.h> - -#include "base/android/jni_android.h" -#include "base/android/scoped_java_ref.h" -#include "base/logging.h" -#include "build/build_config.h" - -// Project-specific macros used by the header files generated by -// jni_generator.py. Different projects can then specify their own -// implementation for this file. -#define CHECK_NATIVE_PTR(env, jcaller, native_ptr, method_name, ...) \ - DCHECK(native_ptr) << method_name; - -#define CHECK_CLAZZ(env, jcaller, clazz, ...) DCHECK(clazz); - -#if defined(ARCH_CPU_X86) -// Dalvik JIT generated code doesn't guarantee 16-byte stack alignment on -// x86 - use force_align_arg_pointer to realign the stack at the JNI -// boundary. crbug.com/655248 -#define JNI_GENERATOR_EXPORT \ - extern "C" __attribute__((visibility("default"), force_align_arg_pointer)) -#else -#define JNI_GENERATOR_EXPORT extern "C" __attribute__((visibility("default"))) -#endif - -namespace jni_generator { - -inline void HandleRegistrationError(JNIEnv* env, - jclass clazz, - const char* filename) { - LOG(ERROR) << "RegisterNatives failed in " << filename; -} - -inline void CheckException(JNIEnv* env) { - base::android::CheckException(env); -} - -inline bool ShouldSkipJniRegistration(bool is_maindex_class) { - switch (base::android::GetJniRegistrationType()) { - case base::android::ALL_JNI_REGISTRATION: - return false; - case base::android::NO_JNI_REGISTRATION: - // TODO(estevenson): Change this to a DCHECK. - return true; - case base::android::SELECTIVE_JNI_REGISTRATION: - return !is_maindex_class; - default: - NOTREACHED(); - return false; - } -} - -} // namespace jni_generator - -#endif // BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ diff --git a/base/android/jni_generator/jni_generator_tests.py b/base/android/jni_generator/jni_generator_tests.py deleted file mode 100755 index c0c8238..0000000 --- a/base/android/jni_generator/jni_generator_tests.py +++ /dev/null @@ -1,1097 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Tests for jni_generator.py. - -This test suite contains various tests for the JNI generator. -It exercises the low-level parser all the way up to the -code generator and ensures the output matches a golden -file. -""" - -import difflib -import inspect -import optparse -import os -import sys -import unittest -import jni_generator -from jni_generator import CalledByNative, JniParams, NativeMethod, Param - - -SCRIPT_NAME = 'base/android/jni_generator/jni_generator.py' -INCLUDES = ( - 'base/android/jni_generator/jni_generator_helper.h' -) - -# Set this environment variable in order to regenerate the golden text -# files. -REBASELINE_ENV = 'REBASELINE' - -class TestOptions(object): - """The mock options object which is passed to the jni_generator.py script.""" - - def __init__(self): - self.namespace = None - self.script_name = SCRIPT_NAME - self.includes = INCLUDES - self.ptr_type = 'long' - self.cpp = 'cpp' - self.javap = 'javap' - self.native_exports_optional = True - self.enable_profiling = False - -class TestGenerator(unittest.TestCase): - def assertObjEquals(self, first, second): - dict_first = first.__dict__ - dict_second = second.__dict__ - self.assertEquals(dict_first.keys(), dict_second.keys()) - for key, value in dict_first.iteritems(): - if (type(value) is list and len(value) and - isinstance(type(value[0]), object)): - self.assertListEquals(value, second.__getattribute__(key)) - else: - actual = second.__getattribute__(key) - self.assertEquals(value, actual, - 'Key ' + key + ': ' + str(value) + '!=' + str(actual)) - - def assertListEquals(self, first, second): - self.assertEquals(len(first), len(second)) - for i in xrange(len(first)): - if isinstance(first[i], object): - self.assertObjEquals(first[i], second[i]) - else: - self.assertEquals(first[i], second[i]) - - def assertTextEquals(self, golden_text, generated_text): - if not self.compareText(golden_text, generated_text): - self.fail('Golden text mismatch.') - - def compareText(self, golden_text, generated_text): - def FilterText(text): - return [ - l.strip() for l in text.split('\n') - if not l.startswith('// Copyright') - ] - stripped_golden = FilterText(golden_text) - stripped_generated = FilterText(generated_text) - if stripped_golden == stripped_generated: - return True - print self.id() - for line in difflib.context_diff(stripped_golden, stripped_generated): - print line - print '\n\nGenerated' - print '=' * 80 - print generated_text - print '=' * 80 - print 'Run with:' - print 'REBASELINE=1', sys.argv[0] - print 'to regenerate the data files.' - - def _ReadGoldenFile(self, golden_file): - if not os.path.exists(golden_file): - return None - with file(golden_file, 'r') as f: - return f.read() - - def assertGoldenTextEquals(self, generated_text): - script_dir = os.path.dirname(sys.argv[0]) - # This is the caller test method. - caller = inspect.stack()[1][3] - self.assertTrue(caller.startswith('test'), - 'assertGoldenTextEquals can only be called from a ' - 'test* method, not %s' % caller) - golden_file = os.path.join(script_dir, caller + '.golden') - golden_text = self._ReadGoldenFile(golden_file) - if os.environ.get(REBASELINE_ENV): - if golden_text != generated_text: - with file(golden_file, 'w') as f: - f.write(generated_text) - return - self.assertTextEquals(golden_text, generated_text) - - def testInspectCaller(self): - def willRaise(): - # This function can only be called from a test* method. - self.assertGoldenTextEquals('') - self.assertRaises(AssertionError, willRaise) - - def testNatives(self): - test_data = """" - interface OnFrameAvailableListener {} - private native int nativeInit(); - private native void nativeDestroy(int nativeChromeBrowserProvider); - private native long nativeAddBookmark( - int nativeChromeBrowserProvider, - String url, String title, boolean isFolder, long parentId); - private static native String nativeGetDomainAndRegistry(String url); - private static native void nativeCreateHistoricalTabFromState( - byte[] state, int tab_index); - private native byte[] nativeGetStateAsByteArray(View view); - private static native String[] nativeGetAutofillProfileGUIDs(); - private native void nativeSetRecognitionResults( - int sessionId, String[] results); - private native long nativeAddBookmarkFromAPI( - int nativeChromeBrowserProvider, - String url, Long created, Boolean isBookmark, - Long date, byte[] favicon, String title, Integer visits); - native int nativeFindAll(String find); - private static native OnFrameAvailableListener nativeGetInnerClass(); - private native Bitmap nativeQueryBitmap( - int nativeChromeBrowserProvider, - String[] projection, String selection, - String[] selectionArgs, String sortOrder); - private native void nativeGotOrientation( - int nativeDataFetcherImplAndroid, - double alpha, double beta, double gamma); - private static native Throwable nativeMessWithJavaException(Throwable e); - """ - jni_generator.JniParams.SetFullyQualifiedClass( - 'org/chromium/example/jni_generator/SampleForTests') - jni_generator.JniParams.ExtractImportsAndInnerClasses(test_data) - natives = jni_generator.ExtractNatives(test_data, 'int') - golden_natives = [ - NativeMethod(return_type='int', static=False, - name='Init', - params=[], - java_class_name=None, - type='function'), - NativeMethod(return_type='void', static=False, name='Destroy', - params=[Param(datatype='int', - name='nativeChromeBrowserProvider')], - java_class_name=None, - type='method', - p0_type='ChromeBrowserProvider'), - NativeMethod(return_type='long', static=False, name='AddBookmark', - params=[Param(datatype='int', - name='nativeChromeBrowserProvider'), - Param(datatype='String', - name='url'), - Param(datatype='String', - name='title'), - Param(datatype='boolean', - name='isFolder'), - Param(datatype='long', - name='parentId')], - java_class_name=None, - type='method', - p0_type='ChromeBrowserProvider'), - NativeMethod(return_type='String', static=True, - name='GetDomainAndRegistry', - params=[Param(datatype='String', - name='url')], - java_class_name=None, - type='function'), - NativeMethod(return_type='void', static=True, - name='CreateHistoricalTabFromState', - params=[Param(datatype='byte[]', - name='state'), - Param(datatype='int', - name='tab_index')], - java_class_name=None, - type='function'), - NativeMethod(return_type='byte[]', static=False, - name='GetStateAsByteArray', - params=[Param(datatype='View', name='view')], - java_class_name=None, - type='function'), - NativeMethod(return_type='String[]', static=True, - name='GetAutofillProfileGUIDs', params=[], - java_class_name=None, - type='function'), - NativeMethod(return_type='void', static=False, - name='SetRecognitionResults', - params=[Param(datatype='int', name='sessionId'), - Param(datatype='String[]', name='results')], - java_class_name=None, - type='function'), - NativeMethod(return_type='long', static=False, - name='AddBookmarkFromAPI', - params=[Param(datatype='int', - name='nativeChromeBrowserProvider'), - Param(datatype='String', - name='url'), - Param(datatype='Long', - name='created'), - Param(datatype='Boolean', - name='isBookmark'), - Param(datatype='Long', - name='date'), - Param(datatype='byte[]', - name='favicon'), - Param(datatype='String', - name='title'), - Param(datatype='Integer', - name='visits')], - java_class_name=None, - type='method', - p0_type='ChromeBrowserProvider'), - NativeMethod(return_type='int', static=False, - name='FindAll', - params=[Param(datatype='String', - name='find')], - java_class_name=None, - type='function'), - NativeMethod(return_type='OnFrameAvailableListener', static=True, - name='GetInnerClass', - params=[], - java_class_name=None, - type='function'), - NativeMethod(return_type='Bitmap', - static=False, - name='QueryBitmap', - params=[Param(datatype='int', - name='nativeChromeBrowserProvider'), - Param(datatype='String[]', - name='projection'), - Param(datatype='String', - name='selection'), - Param(datatype='String[]', - name='selectionArgs'), - Param(datatype='String', - name='sortOrder'), - ], - java_class_name=None, - type='method', - p0_type='ChromeBrowserProvider'), - NativeMethod(return_type='void', static=False, - name='GotOrientation', - params=[Param(datatype='int', - name='nativeDataFetcherImplAndroid'), - Param(datatype='double', - name='alpha'), - Param(datatype='double', - name='beta'), - Param(datatype='double', - name='gamma'), - ], - java_class_name=None, - type='method', - p0_type='content::DataFetcherImplAndroid'), - NativeMethod(return_type='Throwable', static=True, - name='MessWithJavaException', - params=[Param(datatype='Throwable', name='e')], - java_class_name=None, - type='function') - ] - self.assertListEquals(golden_natives, natives) - h = jni_generator.InlHeaderFileGenerator('', 'org/chromium/TestJni', - natives, [], [], TestOptions()) - self.assertGoldenTextEquals(h.GetContent()) - - def testInnerClassNatives(self): - test_data = """ - class MyInnerClass { - @NativeCall("MyInnerClass") - private native int nativeInit(); - } - """ - natives = jni_generator.ExtractNatives(test_data, 'int') - golden_natives = [ - NativeMethod(return_type='int', static=False, - name='Init', params=[], - java_class_name='MyInnerClass', - type='function') - ] - self.assertListEquals(golden_natives, natives) - h = jni_generator.InlHeaderFileGenerator('', 'org/chromium/TestJni', - natives, [], [], TestOptions()) - self.assertGoldenTextEquals(h.GetContent()) - - def testInnerClassNativesMultiple(self): - test_data = """ - class MyInnerClass { - @NativeCall("MyInnerClass") - private native int nativeInit(); - } - class MyOtherInnerClass { - @NativeCall("MyOtherInnerClass") - private native int nativeInit(); - } - """ - natives = jni_generator.ExtractNatives(test_data, 'int') - golden_natives = [ - NativeMethod(return_type='int', static=False, - name='Init', params=[], - java_class_name='MyInnerClass', - type='function'), - NativeMethod(return_type='int', static=False, - name='Init', params=[], - java_class_name='MyOtherInnerClass', - type='function') - ] - self.assertListEquals(golden_natives, natives) - h = jni_generator.InlHeaderFileGenerator('', 'org/chromium/TestJni', - natives, [], [], TestOptions()) - self.assertGoldenTextEquals(h.GetContent()) - - def testInnerClassNativesBothInnerAndOuter(self): - test_data = """ - class MyOuterClass { - private native int nativeInit(); - class MyOtherInnerClass { - @NativeCall("MyOtherInnerClass") - private native int nativeInit(); - } - } - """ - natives = jni_generator.ExtractNatives(test_data, 'int') - golden_natives = [ - NativeMethod(return_type='int', static=False, - name='Init', params=[], - java_class_name=None, - type='function'), - NativeMethod(return_type='int', static=False, - name='Init', params=[], - java_class_name='MyOtherInnerClass', - type='function') - ] - self.assertListEquals(golden_natives, natives) - h = jni_generator.InlHeaderFileGenerator('', 'org/chromium/TestJni', - natives, [], [], TestOptions()) - self.assertGoldenTextEquals(h.GetContent()) - - def testCalledByNatives(self): - test_data = """" - import android.graphics.Bitmap; - import android.view.View; - import java.io.InputStream; - import java.util.List; - - class InnerClass {} - - @CalledByNative - InnerClass showConfirmInfoBar(int nativeInfoBar, - String buttonOk, String buttonCancel, String title, Bitmap icon) { - InfoBar infobar = new ConfirmInfoBar(nativeInfoBar, mContext, - buttonOk, buttonCancel, - title, icon); - return infobar; - } - @CalledByNative - InnerClass showAutoLoginInfoBar(int nativeInfoBar, - String realm, String account, String args) { - AutoLoginInfoBar infobar = new AutoLoginInfoBar(nativeInfoBar, mContext, - realm, account, args); - if (infobar.displayedAccountCount() == 0) - infobar = null; - return infobar; - } - @CalledByNative("InfoBar") - void dismiss(); - @SuppressWarnings("unused") - @CalledByNative - private static boolean shouldShowAutoLogin(View view, - String realm, String account, String args) { - AccountManagerContainer accountManagerContainer = - new AccountManagerContainer((Activity)contentView.getContext(), - realm, account, args); - String[] logins = accountManagerContainer.getAccountLogins(null); - return logins.length != 0; - } - @CalledByNative - static InputStream openUrl(String url) { - return null; - } - @CalledByNative - private void activateHardwareAcceleration(final boolean activated, - final int iPid, final int iType, - final int iPrimaryID, final int iSecondaryID) { - if (!activated) { - return - } - } - @CalledByNative - public static @Status int updateStatus(@Status int status) { - return getAndUpdateStatus(status); - } - @CalledByNativeUnchecked - private void uncheckedCall(int iParam); - - @CalledByNative - public byte[] returnByteArray(); - - @CalledByNative - public boolean[] returnBooleanArray(); - - @CalledByNative - public char[] returnCharArray(); - - @CalledByNative - public short[] returnShortArray(); - - @CalledByNative - public int[] returnIntArray(); - - @CalledByNative - public long[] returnLongArray(); - - @CalledByNative - public double[] returnDoubleArray(); - - @CalledByNative - public Object[] returnObjectArray(); - - @CalledByNative - public byte[][] returnArrayOfByteArray(); - - @CalledByNative - public Bitmap.CompressFormat getCompressFormat(); - - @CalledByNative - public List<Bitmap.CompressFormat> getCompressFormatList(); - """ - jni_generator.JniParams.SetFullyQualifiedClass('org/chromium/Foo') - jni_generator.JniParams.ExtractImportsAndInnerClasses(test_data) - called_by_natives = jni_generator.ExtractCalledByNatives(test_data) - golden_called_by_natives = [ - CalledByNative( - return_type='InnerClass', - system_class=False, - static=False, - name='showConfirmInfoBar', - method_id_var_name='showConfirmInfoBar', - java_class_name='', - params=[Param(datatype='int', name='nativeInfoBar'), - Param(datatype='String', name='buttonOk'), - Param(datatype='String', name='buttonCancel'), - Param(datatype='String', name='title'), - Param(datatype='Bitmap', name='icon')], - env_call=('Object', ''), - unchecked=False, - ), - CalledByNative( - return_type='InnerClass', - system_class=False, - static=False, - name='showAutoLoginInfoBar', - method_id_var_name='showAutoLoginInfoBar', - java_class_name='', - params=[Param(datatype='int', name='nativeInfoBar'), - Param(datatype='String', name='realm'), - Param(datatype='String', name='account'), - Param(datatype='String', name='args')], - env_call=('Object', ''), - unchecked=False, - ), - CalledByNative( - return_type='void', - system_class=False, - static=False, - name='dismiss', - method_id_var_name='dismiss', - java_class_name='InfoBar', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='boolean', - system_class=False, - static=True, - name='shouldShowAutoLogin', - method_id_var_name='shouldShowAutoLogin', - java_class_name='', - params=[Param(datatype='View', name='view'), - Param(datatype='String', name='realm'), - Param(datatype='String', name='account'), - Param(datatype='String', name='args')], - env_call=('Boolean', ''), - unchecked=False, - ), - CalledByNative( - return_type='InputStream', - system_class=False, - static=True, - name='openUrl', - method_id_var_name='openUrl', - java_class_name='', - params=[Param(datatype='String', name='url')], - env_call=('Object', ''), - unchecked=False, - ), - CalledByNative( - return_type='void', - system_class=False, - static=False, - name='activateHardwareAcceleration', - method_id_var_name='activateHardwareAcceleration', - java_class_name='', - params=[Param(datatype='boolean', name='activated'), - Param(datatype='int', name='iPid'), - Param(datatype='int', name='iType'), - Param(datatype='int', name='iPrimaryID'), - Param(datatype='int', name='iSecondaryID'), - ], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='int', - system_class=False, - static=True, - name='updateStatus', - method_id_var_name='updateStatus', - java_class_name='', - params=[Param(datatype='int', name='status')], - env_call=('Integer', ''), - unchecked=False, - ), - CalledByNative( - return_type='void', - system_class=False, - static=False, - name='uncheckedCall', - method_id_var_name='uncheckedCall', - java_class_name='', - params=[Param(datatype='int', name='iParam')], - env_call=('Void', ''), - unchecked=True, - ), - CalledByNative( - return_type='byte[]', - system_class=False, - static=False, - name='returnByteArray', - method_id_var_name='returnByteArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='boolean[]', - system_class=False, - static=False, - name='returnBooleanArray', - method_id_var_name='returnBooleanArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='char[]', - system_class=False, - static=False, - name='returnCharArray', - method_id_var_name='returnCharArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='short[]', - system_class=False, - static=False, - name='returnShortArray', - method_id_var_name='returnShortArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='int[]', - system_class=False, - static=False, - name='returnIntArray', - method_id_var_name='returnIntArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='long[]', - system_class=False, - static=False, - name='returnLongArray', - method_id_var_name='returnLongArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='double[]', - system_class=False, - static=False, - name='returnDoubleArray', - method_id_var_name='returnDoubleArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='Object[]', - system_class=False, - static=False, - name='returnObjectArray', - method_id_var_name='returnObjectArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='byte[][]', - system_class=False, - static=False, - name='returnArrayOfByteArray', - method_id_var_name='returnArrayOfByteArray', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='Bitmap.CompressFormat', - system_class=False, - static=False, - name='getCompressFormat', - method_id_var_name='getCompressFormat', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - CalledByNative( - return_type='List<Bitmap.CompressFormat>', - system_class=False, - static=False, - name='getCompressFormatList', - method_id_var_name='getCompressFormatList', - java_class_name='', - params=[], - env_call=('Void', ''), - unchecked=False, - ), - ] - self.assertListEquals(golden_called_by_natives, called_by_natives) - h = jni_generator.InlHeaderFileGenerator('', 'org/chromium/TestJni', - [], called_by_natives, [], - TestOptions()) - self.assertGoldenTextEquals(h.GetContent()) - - def testCalledByNativeParseError(self): - try: - jni_generator.ExtractCalledByNatives(""" -@CalledByNative -public static int foo(); // This one is fine - -@CalledByNative -scooby doo -""") - self.fail('Expected a ParseError') - except jni_generator.ParseError, e: - self.assertEquals(('@CalledByNative', 'scooby doo'), e.context_lines) - - def testFullyQualifiedClassName(self): - contents = """ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.content.browser; - -import org.chromium.base.BuildInfo; -""" - self.assertEquals('org/chromium/content/browser/Foo', - jni_generator.ExtractFullyQualifiedJavaClassName( - 'org/chromium/content/browser/Foo.java', contents)) - self.assertEquals('org/chromium/content/browser/Foo', - jni_generator.ExtractFullyQualifiedJavaClassName( - 'frameworks/Foo.java', contents)) - self.assertRaises(SyntaxError, - jni_generator.ExtractFullyQualifiedJavaClassName, - 'com/foo/Bar', 'no PACKAGE line') - - def testMethodNameMangling(self): - self.assertEquals('closeV', - jni_generator.GetMangledMethodName('close', [], 'void')) - self.assertEquals('readI_AB_I_I', - jni_generator.GetMangledMethodName('read', - [Param(name='p1', - datatype='byte[]'), - Param(name='p2', - datatype='int'), - Param(name='p3', - datatype='int'),], - 'int')) - self.assertEquals('openJIIS_JLS', - jni_generator.GetMangledMethodName('open', - [Param(name='p1', - datatype='java/lang/String'),], - 'java/io/InputStream')) - - def testFromJavaPGenerics(self): - contents = """ -public abstract class java.util.HashSet<T> extends java.util.AbstractSet<E> - implements java.util.Set<E>, java.lang.Cloneable, java.io.Serializable { - public void dummy(); - Signature: ()V -} -""" - jni_from_javap = jni_generator.JNIFromJavaP(contents.split('\n'), - TestOptions()) - self.assertEquals(1, len(jni_from_javap.called_by_natives)) - self.assertGoldenTextEquals(jni_from_javap.GetContent()) - - def testSnippnetJavap6_7_8(self): - content_javap6 = """ -public class java.util.HashSet { -public boolean add(java.lang.Object); - Signature: (Ljava/lang/Object;)Z -} -""" - - content_javap7 = """ -public class java.util.HashSet { -public boolean add(E); - Signature: (Ljava/lang/Object;)Z -} -""" - - content_javap8 = """ -public class java.util.HashSet { - public boolean add(E); - descriptor: (Ljava/lang/Object;)Z -} -""" - - jni_from_javap6 = jni_generator.JNIFromJavaP(content_javap6.split('\n'), - TestOptions()) - jni_from_javap7 = jni_generator.JNIFromJavaP(content_javap7.split('\n'), - TestOptions()) - jni_from_javap8 = jni_generator.JNIFromJavaP(content_javap8.split('\n'), - TestOptions()) - self.assertTrue(jni_from_javap6.GetContent()) - self.assertTrue(jni_from_javap7.GetContent()) - self.assertTrue(jni_from_javap8.GetContent()) - # Ensure the javap7 is correctly parsed and uses the Signature field rather - # than the "E" parameter. - self.assertTextEquals(jni_from_javap6.GetContent(), - jni_from_javap7.GetContent()) - # Ensure the javap8 is correctly parsed and uses the descriptor field. - self.assertTextEquals(jni_from_javap7.GetContent(), - jni_from_javap8.GetContent()) - - def testFromJavaP(self): - contents = self._ReadGoldenFile(os.path.join(os.path.dirname(sys.argv[0]), - 'testInputStream.javap')) - jni_from_javap = jni_generator.JNIFromJavaP(contents.split('\n'), - TestOptions()) - self.assertEquals(10, len(jni_from_javap.called_by_natives)) - self.assertGoldenTextEquals(jni_from_javap.GetContent()) - - def testConstantsFromJavaP(self): - for f in ['testMotionEvent.javap', 'testMotionEvent.javap7']: - contents = self._ReadGoldenFile(os.path.join(os.path.dirname(sys.argv[0]), - f)) - jni_from_javap = jni_generator.JNIFromJavaP(contents.split('\n'), - TestOptions()) - self.assertEquals(86, len(jni_from_javap.called_by_natives)) - self.assertGoldenTextEquals(jni_from_javap.GetContent()) - - def testREForNatives(self): - # We should not match "native SyncSetupFlow" inside the comment. - test_data = """ - /** - * Invoked when the setup process is complete so we can disconnect from the - * native-side SyncSetupFlowHandler. - */ - public void destroy() { - Log.v(TAG, "Destroying native SyncSetupFlow"); - if (mNativeSyncSetupFlow != 0) { - nativeSyncSetupEnded(mNativeSyncSetupFlow); - mNativeSyncSetupFlow = 0; - } - } - private native void nativeSyncSetupEnded( - int nativeAndroidSyncSetupFlowHandler); - """ - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, 'foo/bar', TestOptions()) - - def testRaisesOnNonJNIMethod(self): - test_data = """ - class MyInnerClass { - private int Foo(int p0) { - } - } - """ - self.assertRaises(SyntaxError, - jni_generator.JNIFromJavaSource, - test_data, 'foo/bar', TestOptions()) - - def testJniSelfDocumentingExample(self): - script_dir = os.path.dirname(sys.argv[0]) - content = file(os.path.join(script_dir, - 'java/src/org/chromium/example/jni_generator/SampleForTests.java') - ).read() - golden_file = os.path.join(script_dir, 'SampleForTests_jni.golden') - golden_content = file(golden_file).read() - jni_from_java = jni_generator.JNIFromJavaSource( - content, 'org/chromium/example/jni_generator/SampleForTests', - TestOptions()) - generated_text = jni_from_java.GetContent() - if not self.compareText(golden_content, generated_text): - if os.environ.get(REBASELINE_ENV): - with file(golden_file, 'w') as f: - f.write(generated_text) - return - self.fail('testJniSelfDocumentingExample') - - def testNoWrappingPreprocessorLines(self): - test_data = """ - package com.google.lookhowextremelylongiam.snarf.icankeepthisupallday; - - class ReallyLongClassNamesAreAllTheRage { - private static native int nativeTest(); - } - """ - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, ('com/google/lookhowextremelylongiam/snarf/' - 'icankeepthisupallday/ReallyLongClassNamesAreAllTheRage'), - TestOptions()) - jni_lines = jni_from_java.GetContent().split('\n') - line = filter(lambda line: line.lstrip().startswith('#ifndef'), - jni_lines)[0] - self.assertTrue(len(line) > 80, - ('Expected #ifndef line to be > 80 chars: ', line)) - - def testImports(self): - import_header = """ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.content.app; - -import android.app.Service; -import android.content.Context; -import android.content.Intent; -import android.graphics.SurfaceTexture; -import android.os.Bundle; -import android.os.IBinder; -import android.os.ParcelFileDescriptor; -import android.os.Process; -import android.os.RemoteException; -import android.util.Log; -import android.view.Surface; - -import java.util.ArrayList; - -import org.chromium.base.annotations.CalledByNative; -import org.chromium.base.annotations.JNINamespace; -import org.chromium.content.app.ContentMain; -import org.chromium.content.browser.SandboxedProcessConnection; -import org.chromium.content.common.ISandboxedProcessCallback; -import org.chromium.content.common.ISandboxedProcessService; -import org.chromium.content.common.WillNotRaise.AnException; -import org.chromium.content.common.WillRaise.AnException; - -import static org.chromium.Bar.Zoo; - -class Foo { - public static class BookmarkNode implements Parcelable { - } - public interface PasswordListObserver { - } -} - """ - jni_generator.JniParams.SetFullyQualifiedClass( - 'org/chromium/content/app/Foo') - jni_generator.JniParams.ExtractImportsAndInnerClasses(import_header) - self.assertTrue('Lorg/chromium/content/common/ISandboxedProcessService' in - jni_generator.JniParams._imports) - self.assertTrue('Lorg/chromium/Bar/Zoo' in - jni_generator.JniParams._imports) - self.assertTrue('Lorg/chromium/content/app/Foo$BookmarkNode' in - jni_generator.JniParams._inner_classes) - self.assertTrue('Lorg/chromium/content/app/Foo$PasswordListObserver' in - jni_generator.JniParams._inner_classes) - self.assertEquals('Lorg/chromium/content/app/ContentMain$Inner;', - jni_generator.JniParams.JavaToJni('ContentMain.Inner')) - self.assertRaises(SyntaxError, - jni_generator.JniParams.JavaToJni, - 'AnException') - - def testJniParamsJavaToJni(self): - self.assertTextEquals('I', JniParams.JavaToJni('int')) - self.assertTextEquals('[B', JniParams.JavaToJni('byte[]')) - self.assertTextEquals( - '[Ljava/nio/ByteBuffer;', JniParams.JavaToJni('java/nio/ByteBuffer[]')) - - def testNativesLong(self): - test_options = TestOptions() - test_options.ptr_type = 'long' - test_data = """" - private native void nativeDestroy(long nativeChromeBrowserProvider); - """ - jni_generator.JniParams.ExtractImportsAndInnerClasses(test_data) - natives = jni_generator.ExtractNatives(test_data, test_options.ptr_type) - golden_natives = [ - NativeMethod(return_type='void', static=False, name='Destroy', - params=[Param(datatype='long', - name='nativeChromeBrowserProvider')], - java_class_name=None, - type='method', - p0_type='ChromeBrowserProvider', - ptr_type=test_options.ptr_type), - ] - self.assertListEquals(golden_natives, natives) - h = jni_generator.InlHeaderFileGenerator('', 'org/chromium/TestJni', - natives, [], [], test_options) - self.assertGoldenTextEquals(h.GetContent()) - - def testMainDexFile(self): - test_data = """ - package org.chromium.example.jni_generator; - - @MainDex - class Test { - private static native int nativeStaticMethod(long nativeTest, int arg1); - } - """ - options = TestOptions() - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, 'org/chromium/foo/Bar', options) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - - def testNonMainDexFile(self): - test_data = """ - package org.chromium.example.jni_generator; - - class Test { - private static native int nativeStaticMethod(long nativeTest, int arg1); - } - """ - options = TestOptions() - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, 'org/chromium/foo/Bar', options) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - - def testNativeExportsOnlyOption(self): - test_data = """ - package org.chromium.example.jni_generator; - - /** The pointer to the native Test. */ - long nativeTest; - - class Test { - private static native int nativeStaticMethod(long nativeTest, int arg1); - private native int nativeMethod(long nativeTest, int arg1); - @CalledByNative - private void testMethodWithParam(int iParam); - @CalledByNative - private String testMethodWithParamAndReturn(int iParam); - @CalledByNative - private static int testStaticMethodWithParam(int iParam); - @CalledByNative - private static double testMethodWithNoParam(); - @CalledByNative - private static String testStaticMethodWithNoParam(); - - class MyInnerClass { - @NativeCall("MyInnerClass") - private native int nativeInit(); - } - class MyOtherInnerClass { - @NativeCall("MyOtherInnerClass") - private native int nativeInit(); - } - } - """ - options = TestOptions() - options.native_exports_optional = False - jni_from_java = jni_generator.JNIFromJavaSource( - test_data, 'org/chromium/example/jni_generator/SampleForTests', options) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - - def testOuterInnerRaises(self): - test_data = """ - package org.chromium.media; - - @CalledByNative - static int getCaptureFormatWidth(VideoCapture.CaptureFormat format) { - return format.getWidth(); - } - """ - def willRaise(): - jni_generator.JNIFromJavaSource( - test_data, - 'org/chromium/media/VideoCaptureFactory', - TestOptions()) - self.assertRaises(SyntaxError, willRaise) - - def testSingleJNIAdditionalImport(self): - test_data = """ - package org.chromium.foo; - - @JNIAdditionalImport(Bar.class) - class Foo { - - @CalledByNative - private static void calledByNative(Bar.Callback callback) { - } - - private static native void nativeDoSomething(Bar.Callback callback); - } - """ - jni_from_java = jni_generator.JNIFromJavaSource(test_data, - 'org/chromium/foo/Foo', - TestOptions()) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - - def testMultipleJNIAdditionalImport(self): - test_data = """ - package org.chromium.foo; - - @JNIAdditionalImport({Bar1.class, Bar2.class}) - class Foo { - - @CalledByNative - private static void calledByNative(Bar1.Callback callback1, - Bar2.Callback callback2) { - } - - private static native void nativeDoSomething(Bar1.Callback callback1, - Bar2.Callback callback2); - } - """ - jni_from_java = jni_generator.JNIFromJavaSource(test_data, - 'org/chromium/foo/Foo', - TestOptions()) - self.assertGoldenTextEquals(jni_from_java.GetContent()) - - -def TouchStamp(stamp_path): - dir_name = os.path.dirname(stamp_path) - if not os.path.isdir(dir_name): - os.makedirs(dir_name) - - with open(stamp_path, 'a'): - os.utime(stamp_path, None) - - -def main(argv): - parser = optparse.OptionParser() - parser.add_option('--stamp', help='Path to touch on success.') - options, _ = parser.parse_args(argv[1:]) - - test_result = unittest.main(argv=argv[0:1], exit=False) - - if test_result.result.wasSuccessful() and options.stamp: - TouchStamp(options.stamp) - - return not test_result.result.wasSuccessful() - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/base/android/jni_generator/sample_for_tests.cc b/base/android/jni_generator/sample_for_tests.cc deleted file mode 100644 index 42b2143..0000000 --- a/base/android/jni_generator/sample_for_tests.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <iostream> - -#include "base/android/jni_generator/sample_for_tests.h" - -#include "base/android/jni_android.h" -#include "base/android/jni_string.h" -#include "base/android/scoped_java_ref.h" -// Generated file for JNI bindings from C++ to Java @CalledByNative methods. -// Only to be included in one .cc file. -// Name is based on the java file name: *.java -> jni/*_jni.h -#include "jni/SampleForTests_jni.h" // Generated by JNI. - -using base::android::AttachCurrentThread; -using base::android::ConvertJavaStringToUTF8; -using base::android::ConvertUTF8ToJavaString; -using base::android::ScopedJavaLocalRef; - -namespace base { -namespace android { - -jdouble CPPClass::InnerClass::MethodOtherP0( - JNIEnv* env, - const JavaParamRef<jobject>& caller) { - return 0.0; -} - -CPPClass::CPPClass() { -} - -CPPClass::~CPPClass() { -} - -// static -bool CPPClass::RegisterJNI(JNIEnv* env) { - return RegisterNativesImpl(env); // Generated in SampleForTests_jni.h -} - -void CPPClass::Destroy(JNIEnv* env, const JavaParamRef<jobject>& caller) { - delete this; -} - -jint CPPClass::Method(JNIEnv* env, const JavaParamRef<jobject>& caller) { - return 0; -} - -void CPPClass::AddStructB(JNIEnv* env, - const JavaParamRef<jobject>& caller, - const JavaParamRef<jobject>& structb) { - long key = Java_InnerStructB_getKey(env, structb); - std::string value = - ConvertJavaStringToUTF8(env, Java_InnerStructB_getValue(env, structb)); - map_[key] = value; -} - -void CPPClass::IterateAndDoSomethingWithStructB( - JNIEnv* env, - const JavaParamRef<jobject>& caller) { - // Iterate over the elements and do something with them. - for (std::map<long, std::string>::const_iterator it = map_.begin(); - it != map_.end(); ++it) { - long key = it->first; - std::string value = it->second; - std::cout << key << value; - } - map_.clear(); -} - -ScopedJavaLocalRef<jstring> CPPClass::ReturnAString( - JNIEnv* env, - const JavaParamRef<jobject>& caller) { - return ConvertUTF8ToJavaString(env, "test"); -} - -// Static free functions declared and called directly from java. -static jlong Init(JNIEnv* env, - const JavaParamRef<jobject>& caller, - const JavaParamRef<jstring>& param) { - return 0; -} - -static jdouble GetDoubleFunction(JNIEnv*, const JavaParamRef<jobject>&) { - return 0; -} - -static jfloat GetFloatFunction(JNIEnv*, const JavaParamRef<jclass>&) { - return 0; -} - -static void SetNonPODDatatype(JNIEnv*, - const JavaParamRef<jobject>&, - const JavaParamRef<jobject>&) {} - -static ScopedJavaLocalRef<jobject> GetNonPODDatatype( - JNIEnv*, - const JavaParamRef<jobject>&) { - return ScopedJavaLocalRef<jobject>(); -} - -static jint GetInnerIntFunction(JNIEnv*, const JavaParamRef<jclass>&) { - return 0; -} - -} // namespace android -} // namespace base - -int main() { - // On a regular application, you'd call AttachCurrentThread(). This sample is - // not yet linking with all the libraries. - JNIEnv* env = /* AttachCurrentThread() */ NULL; - - // This is how you call a java static method from C++. - bool foo = base::android::Java_SampleForTests_staticJavaMethod(env); - - // This is how you call a java method from C++. Note that you must have - // obtained the jobject somehow. - ScopedJavaLocalRef<jobject> my_java_object; - int bar = base::android::Java_SampleForTests_javaMethod( - env, my_java_object, 1, 2); - - std::cout << foo << bar; - - for (int i = 0; i < 10; ++i) { - // Creates a "struct" that will then be used by the java side. - ScopedJavaLocalRef<jobject> struct_a = - base::android::Java_InnerStructA_create( - env, 0, 1, ConvertUTF8ToJavaString(env, "test")); - base::android::Java_SampleForTests_addStructA(env, my_java_object, - struct_a); - } - base::android::Java_SampleForTests_iterateAndDoSomething(env, my_java_object); - base::android::Java_SampleForTests_packagePrivateJavaMethod(env, - my_java_object); - base::android::Java_SampleForTests_methodThatThrowsException(env, - my_java_object); - base::android::Java_SampleForTests_javaMethodWithAnnotatedParam( - env, my_java_object, 42); - return 0; -} diff --git a/base/android/jni_generator/sample_for_tests.h b/base/android/jni_generator/sample_for_tests.h deleted file mode 100644 index a9cf7b0..0000000 --- a/base/android/jni_generator/sample_for_tests.h +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ -#define BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ - -#include <jni.h> -#include <map> -#include <string> - -#include "base/android/jni_android.h" - -namespace base { -namespace android { - -// This file is used to: -// - document the best practices and guidelines on JNI usage. -// - ensure sample_for_tests_jni.h compiles and the functions declared in it -// as expected. -// -// Methods are called directly from Java (except RegisterJNI). More -// documentation in SampleForTests.java -// -// For C++ to access Java methods: -// - GN Build must be configured to generate bindings: -// # Add import at top of file: -// if (is_android) { -// import("//build/config/android/rules.gni") # For generate_jni(). -// } -// # ... -// # An example target that will rely on JNI: -// component("foo") { -// # ... normal sources, defines, deps. -// # For each jni generated .java -> .h header file in jni_headers -// # target there will be a single .cc file here that includes it. -// # -// # Add a dep for JNI: -// if (is_android) { -// deps += [ ":foo_jni" ] -// } -// } -// # ... -// # Create target for JNI: -// if (is_android) { -// generate_jni("jni_headers") { -// sources = [ -// "java/src/org/chromium/example/jni_generator/SampleForTests.java", -// ] -// jni_package = "foo" -// } -// android_library("java") { -// java_files = [ -// "java/src/org/chromium/example/jni_generator/SampleForTests.java", -// "java/src/org/chromium/example/jni_generator/NonJniFile.java", -// ] -// } -// } -// -// For C++ methods to be exposed to Java: -// - The generated RegisterNativesImpl method must be called, this is typically -// done by having a static RegisterJNI method in the C++ class. -// - The RegisterJNI method is added to a module's collection of register -// methods, such as: example_jni_registrar.h/cc files which call -// base::android::RegisterNativeMethods. -// An example_jni_registstrar.cc: -// -// namespace { -// const base::android::RegistrationMethod kRegisteredMethods[] = { -// // Initial string is for debugging only. -// { "ExampleName", base::ExampleNameAndroid::RegisterJNI }, -// { "ExampleName2", base::ExampleName2Android::RegisterJNI }, -// }; -// } // namespace -// -// bool RegisterModuleNameJni(JNIEnv* env) { -// return RegisterNativeMethods(env, kRegisteredMethods, -// arraysize(kRegisteredMethods)); -// } -// -// - Each module's RegisterModuleNameJni must be called by a larger module, -// or application during startup. -// -class CPPClass { - public: - CPPClass(); - ~CPPClass(); - - // Register C++ methods exposed to Java using JNI. - static bool RegisterJNI(JNIEnv* env); - - // Java @CalledByNative methods implicitly available to C++ via the _jni.h - // file included in the .cc file. - - class InnerClass { - public: - jdouble MethodOtherP0(JNIEnv* env, - const base::android::JavaParamRef<jobject>& caller); - }; - - void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& caller); - - jint Method(JNIEnv* env, const base::android::JavaParamRef<jobject>& caller); - - void AddStructB(JNIEnv* env, - const base::android::JavaParamRef<jobject>& caller, - const base::android::JavaParamRef<jobject>& structb); - - void IterateAndDoSomethingWithStructB( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& caller); - - base::android::ScopedJavaLocalRef<jstring> ReturnAString( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& caller); - - private: - std::map<long, std::string> map_; - - DISALLOW_COPY_AND_ASSIGN(CPPClass); -}; - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ diff --git a/base/android/jni_generator/testCalledByNatives.golden b/base/android/jni_generator/testCalledByNatives.golden deleted file mode 100644 index ac86b2e..0000000 --- a/base/android/jni_generator/testCalledByNatives.golden +++ /dev/null @@ -1,497 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/TestJni - -#ifndef org_chromium_TestJni_JNI -#define org_chromium_TestJni_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kTestJniClassPath[] = "org/chromium/TestJni"; -const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; -#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_InfoBar_clazz __attribute__((unused)) = 0; -#define InfoBar_clazz(env) base::android::LazyGetClass(env, kInfoBarClassPath, &g_InfoBar_clazz) - -} // namespace - -// Step 2: method stubs. - -static base::subtle::AtomicWord g_TestJni_showConfirmInfoBar = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_TestJni_showConfirmInfoBar(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper nativeInfoBar, - const base::android::JavaRefOrBare<jstring>& buttonOk, - const base::android::JavaRefOrBare<jstring>& buttonCancel, - const base::android::JavaRefOrBare<jstring>& title, - const base::android::JavaRefOrBare<jobject>& icon) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "showConfirmInfoBar", -"(" -"I" -"Ljava/lang/String;" -"Ljava/lang/String;" -"Ljava/lang/String;" -"Landroid/graphics/Bitmap;" -")" -"Lorg/chromium/Foo$InnerClass;", - &g_TestJni_showConfirmInfoBar); - - jobject ret = - env->CallObjectMethod(obj.obj(), - method_id, as_jint(nativeInfoBar), buttonOk.obj(), buttonCancel.obj(), - title.obj(), icon.obj()); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_TestJni_showAutoLoginInfoBar(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper nativeInfoBar, - const base::android::JavaRefOrBare<jstring>& realm, - const base::android::JavaRefOrBare<jstring>& account, - const base::android::JavaRefOrBare<jstring>& args) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "showAutoLoginInfoBar", -"(" -"I" -"Ljava/lang/String;" -"Ljava/lang/String;" -"Ljava/lang/String;" -")" -"Lorg/chromium/Foo$InnerClass;", - &g_TestJni_showAutoLoginInfoBar); - - jobject ret = - env->CallObjectMethod(obj.obj(), - method_id, as_jint(nativeInfoBar), realm.obj(), account.obj(), - args.obj()); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_InfoBar_dismiss = 0; -static void Java_InfoBar_dismiss(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - InfoBar_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InfoBar_clazz(env), - "dismiss", -"(" -")" -"V", - &g_InfoBar_dismiss); - - env->CallVoidMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_TestJni_shouldShowAutoLogin = 0; -static jboolean Java_TestJni_shouldShowAutoLogin(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& view, - const base::android::JavaRefOrBare<jstring>& realm, - const base::android::JavaRefOrBare<jstring>& account, - const base::android::JavaRefOrBare<jstring>& args) { - CHECK_CLAZZ(env, TestJni_clazz(env), - TestJni_clazz(env), false); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, TestJni_clazz(env), - "shouldShowAutoLogin", -"(" -"Landroid/view/View;" -"Ljava/lang/String;" -"Ljava/lang/String;" -"Ljava/lang/String;" -")" -"Z", - &g_TestJni_shouldShowAutoLogin); - - jboolean ret = - env->CallStaticBooleanMethod(TestJni_clazz(env), - method_id, view.obj(), realm.obj(), account.obj(), args.obj()); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_TestJni_openUrl = 0; -static base::android::ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv* - env, const base::android::JavaRefOrBare<jstring>& url) { - CHECK_CLAZZ(env, TestJni_clazz(env), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, TestJni_clazz(env), - "openUrl", -"(" -"Ljava/lang/String;" -")" -"Ljava/io/InputStream;", - &g_TestJni_openUrl); - - jobject ret = - env->CallStaticObjectMethod(TestJni_clazz(env), - method_id, url.obj()); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0; -static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jboolean activated, - JniIntWrapper iPid, - JniIntWrapper iType, - JniIntWrapper iPrimaryID, - JniIntWrapper iSecondaryID) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "activateHardwareAcceleration", -"(" -"Z" -"I" -"I" -"I" -"I" -")" -"V", - &g_TestJni_activateHardwareAcceleration); - - env->CallVoidMethod(obj.obj(), - method_id, activated, as_jint(iPid), as_jint(iType), - as_jint(iPrimaryID), as_jint(iSecondaryID)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_TestJni_updateStatus = 0; -static jint Java_TestJni_updateStatus(JNIEnv* env, JniIntWrapper status) { - CHECK_CLAZZ(env, TestJni_clazz(env), - TestJni_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, TestJni_clazz(env), - "updateStatus", -"(" -"I" -")" -"I", - &g_TestJni_updateStatus); - - jint ret = - env->CallStaticIntMethod(TestJni_clazz(env), - method_id, as_jint(status)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_TestJni_uncheckedCall = 0; -static void Java_TestJni_uncheckedCall(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "uncheckedCall", -"(" -"I" -")" -"V", - &g_TestJni_uncheckedCall); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(iParam)); -} - -static base::subtle::AtomicWord g_TestJni_returnByteArray = 0; -static base::android::ScopedJavaLocalRef<jbyteArray> - Java_TestJni_returnByteArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnByteArray", -"(" -")" -"[B", - &g_TestJni_returnByteArray); - - jbyteArray ret = - static_cast<jbyteArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jbyteArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnBooleanArray = 0; -static base::android::ScopedJavaLocalRef<jbooleanArray> - Java_TestJni_returnBooleanArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnBooleanArray", -"(" -")" -"[Z", - &g_TestJni_returnBooleanArray); - - jbooleanArray ret = - static_cast<jbooleanArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jbooleanArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnCharArray = 0; -static base::android::ScopedJavaLocalRef<jcharArray> - Java_TestJni_returnCharArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnCharArray", -"(" -")" -"[C", - &g_TestJni_returnCharArray); - - jcharArray ret = - static_cast<jcharArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jcharArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnShortArray = 0; -static base::android::ScopedJavaLocalRef<jshortArray> - Java_TestJni_returnShortArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnShortArray", -"(" -")" -"[S", - &g_TestJni_returnShortArray); - - jshortArray ret = - static_cast<jshortArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jshortArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnIntArray = 0; -static base::android::ScopedJavaLocalRef<jintArray> - Java_TestJni_returnIntArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnIntArray", -"(" -")" -"[I", - &g_TestJni_returnIntArray); - - jintArray ret = - static_cast<jintArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jintArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnLongArray = 0; -static base::android::ScopedJavaLocalRef<jlongArray> - Java_TestJni_returnLongArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnLongArray", -"(" -")" -"[J", - &g_TestJni_returnLongArray); - - jlongArray ret = - static_cast<jlongArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jlongArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnDoubleArray = 0; -static base::android::ScopedJavaLocalRef<jdoubleArray> - Java_TestJni_returnDoubleArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnDoubleArray", -"(" -")" -"[D", - &g_TestJni_returnDoubleArray); - - jdoubleArray ret = - static_cast<jdoubleArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jdoubleArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnObjectArray = 0; -static base::android::ScopedJavaLocalRef<jobjectArray> - Java_TestJni_returnObjectArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnObjectArray", -"(" -")" -"[Ljava/lang/Object;", - &g_TestJni_returnObjectArray); - - jobjectArray ret = - static_cast<jobjectArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobjectArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_returnArrayOfByteArray = 0; -static base::android::ScopedJavaLocalRef<jobjectArray> - Java_TestJni_returnArrayOfByteArray(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "returnArrayOfByteArray", -"(" -")" -"[[B", - &g_TestJni_returnArrayOfByteArray); - - jobjectArray ret = - static_cast<jobjectArray>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobjectArray>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_getCompressFormat = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_TestJni_getCompressFormat(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "getCompressFormat", -"(" -")" -"Landroid/graphics/Bitmap$CompressFormat;", - &g_TestJni_getCompressFormat); - - jobject ret = - env->CallObjectMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_TestJni_getCompressFormatList = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_TestJni_getCompressFormatList(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - TestJni_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, TestJni_clazz(env), - "getCompressFormatList", -"(" -")" -"Ljava/util/List;", - &g_TestJni_getCompressFormatList); - - jobject ret = - env->CallObjectMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -// Step 3: RegisterNatives. - -#endif // org_chromium_TestJni_JNI diff --git a/base/android/jni_generator/testConstantsFromJavaP.golden b/base/android/jni_generator/testConstantsFromJavaP.golden deleted file mode 100644 index b16956f..0000000 --- a/base/android/jni_generator/testConstantsFromJavaP.golden +++ /dev/null @@ -1,2195 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// android/view/MotionEvent - -#ifndef android_view_MotionEvent_JNI -#define android_view_MotionEvent_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kMotionEventClassPath[] = "android/view/MotionEvent"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_MotionEvent_clazz __attribute__((unused)) = 0; -#define MotionEvent_clazz(env) base::android::LazyGetClass(env, kMotionEventClassPath, &g_MotionEvent_clazz) - -} // namespace - -namespace JNI_MotionEvent { - -enum Java_MotionEvent_constant_fields { - INVALID_POINTER_ID = -1, - ACTION_MASK = 255, - ACTION_DOWN = 0, - ACTION_UP = 1, - ACTION_MOVE = 2, - ACTION_CANCEL = 3, - ACTION_OUTSIDE = 4, - ACTION_POINTER_DOWN = 5, - ACTION_POINTER_UP = 6, - ACTION_HOVER_MOVE = 7, - ACTION_SCROLL = 8, - ACTION_HOVER_ENTER = 9, - ACTION_HOVER_EXIT = 10, - ACTION_POINTER_INDEX_MASK = 65280, - ACTION_POINTER_INDEX_SHIFT = 8, - ACTION_POINTER_1_DOWN = 5, - ACTION_POINTER_2_DOWN = 261, - ACTION_POINTER_3_DOWN = 517, - ACTION_POINTER_1_UP = 6, - ACTION_POINTER_2_UP = 262, - ACTION_POINTER_3_UP = 518, - ACTION_POINTER_ID_MASK = 65280, - ACTION_POINTER_ID_SHIFT = 8, - FLAG_WINDOW_IS_OBSCURED = 1, - EDGE_TOP = 1, - EDGE_BOTTOM = 2, - EDGE_LEFT = 4, - EDGE_RIGHT = 8, - AXIS_X = 0, - AXIS_Y = 1, - AXIS_PRESSURE = 2, - AXIS_SIZE = 3, - AXIS_TOUCH_MAJOR = 4, - AXIS_TOUCH_MINOR = 5, - AXIS_TOOL_MAJOR = 6, - AXIS_TOOL_MINOR = 7, - AXIS_ORIENTATION = 8, - AXIS_VSCROLL = 9, - AXIS_HSCROLL = 10, - AXIS_Z = 11, - AXIS_RX = 12, - AXIS_RY = 13, - AXIS_RZ = 14, - AXIS_HAT_X = 15, - AXIS_HAT_Y = 16, - AXIS_LTRIGGER = 17, - AXIS_RTRIGGER = 18, - AXIS_THROTTLE = 19, - AXIS_RUDDER = 20, - AXIS_WHEEL = 21, - AXIS_GAS = 22, - AXIS_BRAKE = 23, - AXIS_DISTANCE = 24, - AXIS_TILT = 25, - AXIS_GENERIC_1 = 32, - AXIS_GENERIC_2 = 33, - AXIS_GENERIC_3 = 34, - AXIS_GENERIC_4 = 35, - AXIS_GENERIC_5 = 36, - AXIS_GENERIC_6 = 37, - AXIS_GENERIC_7 = 38, - AXIS_GENERIC_8 = 39, - AXIS_GENERIC_9 = 40, - AXIS_GENERIC_10 = 41, - AXIS_GENERIC_11 = 42, - AXIS_GENERIC_12 = 43, - AXIS_GENERIC_13 = 44, - AXIS_GENERIC_14 = 45, - AXIS_GENERIC_15 = 46, - AXIS_GENERIC_16 = 47, - BUTTON_PRIMARY = 1, - BUTTON_SECONDARY = 2, - BUTTON_TERTIARY = 4, - BUTTON_BACK = 8, - BUTTON_FORWARD = 16, - TOOL_TYPE_UNKNOWN = 0, - TOOL_TYPE_FINGER = 1, - TOOL_TYPE_STYLUS = 2, - TOOL_TYPE_MOUSE = 3, - TOOL_TYPE_ERASER = 4, -}; - -// Step 2: method stubs. - -static base::subtle::AtomicWord g_MotionEvent_finalize = 0; -static void Java_MotionEvent_finalize(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static void Java_MotionEvent_finalize(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "finalize", - "()V", - &g_MotionEvent_finalize); - - env->CallVoidMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord - g_MotionEvent_obtainAVME_J_J_I_I_LAVMEPP_LAVMEPC_I_I_F_F_I_I_I_I = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_I_LAVMEPP_LAVMEPC_I_I_F_F_I_I_I_I(JNIEnv* - env, jlong p0, - jlong p1, - JniIntWrapper p2, - JniIntWrapper p3, - const base::android::JavaRefOrBare<jobjectArray>& p4, - const base::android::JavaRefOrBare<jobjectArray>& p5, - JniIntWrapper p6, - JniIntWrapper p7, - jfloat p8, - jfloat p9, - JniIntWrapper p10, - JniIntWrapper p11, - JniIntWrapper p12, - JniIntWrapper p13) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_I_LAVMEPP_LAVMEPC_I_I_F_F_I_I_I_I(JNIEnv* - env, jlong p0, - jlong p1, - JniIntWrapper p2, - JniIntWrapper p3, - const base::android::JavaRefOrBare<jobjectArray>& p4, - const base::android::JavaRefOrBare<jobjectArray>& p5, - JniIntWrapper p6, - JniIntWrapper p7, - jfloat p8, - jfloat p9, - JniIntWrapper p10, - JniIntWrapper p11, - JniIntWrapper p12, - JniIntWrapper p13) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtain", -"(JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainAVME_J_J_I_I_LAVMEPP_LAVMEPC_I_I_F_F_I_I_I_I); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0, p1, as_jint(p2), as_jint(p3), p4.obj(), p5.obj(), - as_jint(p6), as_jint(p7), p8, p9, as_jint(p10), as_jint(p11), - as_jint(p12), as_jint(p13)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord - g_MotionEvent_obtainAVME_J_J_I_I_AI_LAVMEPC_I_F_F_I_I_I_I = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_I_AI_LAVMEPC_I_F_F_I_I_I_I(JNIEnv* env, - jlong p0, - jlong p1, - JniIntWrapper p2, - JniIntWrapper p3, - const base::android::JavaRefOrBare<jintArray>& p4, - const base::android::JavaRefOrBare<jobjectArray>& p5, - JniIntWrapper p6, - jfloat p7, - jfloat p8, - JniIntWrapper p9, - JniIntWrapper p10, - JniIntWrapper p11, - JniIntWrapper p12) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_I_AI_LAVMEPC_I_F_F_I_I_I_I(JNIEnv* env, - jlong p0, - jlong p1, - JniIntWrapper p2, - JniIntWrapper p3, - const base::android::JavaRefOrBare<jintArray>& p4, - const base::android::JavaRefOrBare<jobjectArray>& p5, - JniIntWrapper p6, - jfloat p7, - jfloat p8, - JniIntWrapper p9, - JniIntWrapper p10, - JniIntWrapper p11, - JniIntWrapper p12) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtain", -"(JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainAVME_J_J_I_I_AI_LAVMEPC_I_F_F_I_I_I_I); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0, p1, as_jint(p2), as_jint(p3), p4.obj(), p5.obj(), - as_jint(p6), p7, p8, as_jint(p9), as_jint(p10), as_jint(p11), - as_jint(p12)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_obtainAVME_J_J_I_F_F_F_F_I_F_F_I_I - = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_F_F_F_F_I_F_F_I_I(JNIEnv* env, jlong p0, - jlong p1, - JniIntWrapper p2, - jfloat p3, - jfloat p4, - jfloat p5, - jfloat p6, - JniIntWrapper p7, - jfloat p8, - jfloat p9, - JniIntWrapper p10, - JniIntWrapper p11) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_F_F_F_F_I_F_F_I_I(JNIEnv* env, jlong p0, - jlong p1, - JniIntWrapper p2, - jfloat p3, - jfloat p4, - jfloat p5, - jfloat p6, - JniIntWrapper p7, - jfloat p8, - jfloat p9, - JniIntWrapper p10, - JniIntWrapper p11) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtain", - "(JJIFFFFIFFII)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainAVME_J_J_I_F_F_F_F_I_F_F_I_I); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0, p1, as_jint(p2), p3, p4, p5, p6, as_jint(p7), p8, p9, - as_jint(p10), as_jint(p11)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord - g_MotionEvent_obtainAVME_J_J_I_I_F_F_F_F_I_F_F_I_I = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_I_F_F_F_F_I_F_F_I_I(JNIEnv* env, jlong p0, - jlong p1, - JniIntWrapper p2, - JniIntWrapper p3, - jfloat p4, - jfloat p5, - jfloat p6, - jfloat p7, - JniIntWrapper p8, - jfloat p9, - jfloat p10, - JniIntWrapper p11, - JniIntWrapper p12) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_I_F_F_F_F_I_F_F_I_I(JNIEnv* env, jlong p0, - jlong p1, - JniIntWrapper p2, - JniIntWrapper p3, - jfloat p4, - jfloat p5, - jfloat p6, - jfloat p7, - JniIntWrapper p8, - jfloat p9, - jfloat p10, - JniIntWrapper p11, - JniIntWrapper p12) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtain", - "(JJIIFFFFIFFII)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainAVME_J_J_I_I_F_F_F_F_I_F_F_I_I); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0, p1, as_jint(p2), as_jint(p3), p4, p5, p6, p7, - as_jint(p8), p9, p10, as_jint(p11), as_jint(p12)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_obtainAVME_J_J_I_F_F_I = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_F_F_I(JNIEnv* env, jlong p0, - jlong p1, - JniIntWrapper p2, - jfloat p3, - jfloat p4, - JniIntWrapper p5) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_J_J_I_F_F_I(JNIEnv* env, jlong p0, - jlong p1, - JniIntWrapper p2, - jfloat p3, - jfloat p4, - JniIntWrapper p5) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtain", - "(JJIFFI)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainAVME_J_J_I_F_F_I); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0, p1, as_jint(p2), p3, p4, as_jint(p5)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_obtainAVME_AVME = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_AVME(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& p0) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainAVME_AVME(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& p0) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtain", - "(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainAVME_AVME); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0.obj()); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_obtainNoHistory = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainNoHistory(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& p0) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_MotionEvent_obtainNoHistory(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& p0) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "obtainNoHistory", - "(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;", - &g_MotionEvent_obtainNoHistory); - - jobject ret = - env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, p0.obj()); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_recycle = 0; -static void Java_MotionEvent_recycle(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static void Java_MotionEvent_recycle(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "recycle", - "()V", - &g_MotionEvent_recycle); - - env->CallVoidMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_getDeviceId = 0; -static jint Java_MotionEvent_getDeviceId(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getDeviceId(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getDeviceId", - "()I", - &g_MotionEvent_getDeviceId); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getSource = 0; -static jint Java_MotionEvent_getSource(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getSource(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getSource", - "()I", - &g_MotionEvent_getSource); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_setSource = 0; -static void Java_MotionEvent_setSource(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static void Java_MotionEvent_setSource(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "setSource", - "(I)V", - &g_MotionEvent_setSource); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_getAction = 0; -static jint Java_MotionEvent_getAction(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getAction(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getAction", - "()I", - &g_MotionEvent_getAction); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getActionMasked = 0; -static jint Java_MotionEvent_getActionMasked(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getActionMasked(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getActionMasked", - "()I", - &g_MotionEvent_getActionMasked); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getActionIndex = 0; -static jint Java_MotionEvent_getActionIndex(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getActionIndex(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getActionIndex", - "()I", - &g_MotionEvent_getActionIndex); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getFlags = 0; -static jint Java_MotionEvent_getFlags(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getFlags(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getFlags", - "()I", - &g_MotionEvent_getFlags); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getDownTime = 0; -static jlong Java_MotionEvent_getDownTime(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jlong Java_MotionEvent_getDownTime(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getDownTime", - "()J", - &g_MotionEvent_getDownTime); - - jlong ret = - env->CallLongMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getEventTime = 0; -static jlong Java_MotionEvent_getEventTime(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jlong Java_MotionEvent_getEventTime(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getEventTime", - "()J", - &g_MotionEvent_getEventTime); - - jlong ret = - env->CallLongMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getXF = 0; -static jfloat Java_MotionEvent_getXF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getXF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getX", - "()F", - &g_MotionEvent_getXF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getYF = 0; -static jfloat Java_MotionEvent_getYF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getYF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getY", - "()F", - &g_MotionEvent_getYF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getPressureF = 0; -static jfloat Java_MotionEvent_getPressureF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getPressureF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getPressure", - "()F", - &g_MotionEvent_getPressureF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getSizeF = 0; -static jfloat Java_MotionEvent_getSizeF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getSizeF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getSize", - "()F", - &g_MotionEvent_getSizeF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getTouchMajorF = 0; -static jfloat Java_MotionEvent_getTouchMajorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getTouchMajorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getTouchMajor", - "()F", - &g_MotionEvent_getTouchMajorF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getTouchMinorF = 0; -static jfloat Java_MotionEvent_getTouchMinorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getTouchMinorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getTouchMinor", - "()F", - &g_MotionEvent_getTouchMinorF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getToolMajorF = 0; -static jfloat Java_MotionEvent_getToolMajorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getToolMajorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getToolMajor", - "()F", - &g_MotionEvent_getToolMajorF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getToolMinorF = 0; -static jfloat Java_MotionEvent_getToolMinorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getToolMinorF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getToolMinor", - "()F", - &g_MotionEvent_getToolMinorF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getOrientationF = 0; -static jfloat Java_MotionEvent_getOrientationF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getOrientationF(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getOrientation", - "()F", - &g_MotionEvent_getOrientationF); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getAxisValueF_I = 0; -static jfloat Java_MotionEvent_getAxisValueF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getAxisValueF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getAxisValue", - "(I)F", - &g_MotionEvent_getAxisValueF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getPointerCount = 0; -static jint Java_MotionEvent_getPointerCount(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getPointerCount(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getPointerCount", - "()I", - &g_MotionEvent_getPointerCount); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getPointerId = 0; -static jint Java_MotionEvent_getPointerId(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jint Java_MotionEvent_getPointerId(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getPointerId", - "(I)I", - &g_MotionEvent_getPointerId); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getToolType = 0; -static jint Java_MotionEvent_getToolType(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jint Java_MotionEvent_getToolType(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getToolType", - "(I)I", - &g_MotionEvent_getToolType); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_findPointerIndex = 0; -static jint Java_MotionEvent_findPointerIndex(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jint Java_MotionEvent_findPointerIndex(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "findPointerIndex", - "(I)I", - &g_MotionEvent_findPointerIndex); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getXF_I = 0; -static jfloat Java_MotionEvent_getXF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getXF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getX", - "(I)F", - &g_MotionEvent_getXF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getYF_I = 0; -static jfloat Java_MotionEvent_getYF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getYF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getY", - "(I)F", - &g_MotionEvent_getYF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getPressureF_I = 0; -static jfloat Java_MotionEvent_getPressureF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getPressureF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getPressure", - "(I)F", - &g_MotionEvent_getPressureF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getSizeF_I = 0; -static jfloat Java_MotionEvent_getSizeF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getSizeF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getSize", - "(I)F", - &g_MotionEvent_getSizeF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getTouchMajorF_I = 0; -static jfloat Java_MotionEvent_getTouchMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getTouchMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getTouchMajor", - "(I)F", - &g_MotionEvent_getTouchMajorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getTouchMinorF_I = 0; -static jfloat Java_MotionEvent_getTouchMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getTouchMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getTouchMinor", - "(I)F", - &g_MotionEvent_getTouchMinorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getToolMajorF_I = 0; -static jfloat Java_MotionEvent_getToolMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getToolMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getToolMajor", - "(I)F", - &g_MotionEvent_getToolMajorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getToolMinorF_I = 0; -static jfloat Java_MotionEvent_getToolMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getToolMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getToolMinor", - "(I)F", - &g_MotionEvent_getToolMinorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getOrientationF_I = 0; -static jfloat Java_MotionEvent_getOrientationF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getOrientationF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getOrientation", - "(I)F", - &g_MotionEvent_getOrientationF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getAxisValueF_I_I = 0; -static jfloat Java_MotionEvent_getAxisValueF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getAxisValueF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getAxisValue", - "(II)F", - &g_MotionEvent_getAxisValueF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getPointerCoords = 0; -static void Java_MotionEvent_getPointerCoords(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - const base::android::JavaRefOrBare<jobject>& p1) __attribute__ ((unused)); -static void Java_MotionEvent_getPointerCoords(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - const base::android::JavaRefOrBare<jobject>& p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getPointerCoords", - "(ILandroid/view/MotionEvent$PointerCoords;)V", - &g_MotionEvent_getPointerCoords); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0), p1.obj()); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_getPointerProperties = 0; -static void Java_MotionEvent_getPointerProperties(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - const base::android::JavaRefOrBare<jobject>& p1) __attribute__ ((unused)); -static void Java_MotionEvent_getPointerProperties(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - const base::android::JavaRefOrBare<jobject>& p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getPointerProperties", - "(ILandroid/view/MotionEvent$PointerProperties;)V", - &g_MotionEvent_getPointerProperties); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0), p1.obj()); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_getMetaState = 0; -static jint Java_MotionEvent_getMetaState(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getMetaState(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getMetaState", - "()I", - &g_MotionEvent_getMetaState); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getButtonState = 0; -static jint Java_MotionEvent_getButtonState(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getButtonState(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getButtonState", - "()I", - &g_MotionEvent_getButtonState); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getRawX = 0; -static jfloat Java_MotionEvent_getRawX(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getRawX(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getRawX", - "()F", - &g_MotionEvent_getRawX); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getRawY = 0; -static jfloat Java_MotionEvent_getRawY(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getRawY(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getRawY", - "()F", - &g_MotionEvent_getRawY); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getXPrecision = 0; -static jfloat Java_MotionEvent_getXPrecision(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getXPrecision(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getXPrecision", - "()F", - &g_MotionEvent_getXPrecision); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getYPrecision = 0; -static jfloat Java_MotionEvent_getYPrecision(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getYPrecision(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getYPrecision", - "()F", - &g_MotionEvent_getYPrecision); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistorySize = 0; -static jint Java_MotionEvent_getHistorySize(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getHistorySize(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistorySize", - "()I", - &g_MotionEvent_getHistorySize); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalEventTime = 0; -static jlong Java_MotionEvent_getHistoricalEventTime(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jlong Java_MotionEvent_getHistoricalEventTime(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalEventTime", - "(I)J", - &g_MotionEvent_getHistoricalEventTime); - - jlong ret = - env->CallLongMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalXF_I = 0; -static jfloat Java_MotionEvent_getHistoricalXF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalXF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalX", - "(I)F", - &g_MotionEvent_getHistoricalXF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalYF_I = 0; -static jfloat Java_MotionEvent_getHistoricalYF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalYF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalY", - "(I)F", - &g_MotionEvent_getHistoricalYF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalPressureF_I = 0; -static jfloat Java_MotionEvent_getHistoricalPressureF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalPressureF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalPressure", - "(I)F", - &g_MotionEvent_getHistoricalPressureF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalSizeF_I = 0; -static jfloat Java_MotionEvent_getHistoricalSizeF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalSizeF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalSize", - "(I)F", - &g_MotionEvent_getHistoricalSizeF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalTouchMajorF_I = 0; -static jfloat Java_MotionEvent_getHistoricalTouchMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalTouchMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalTouchMajor", - "(I)F", - &g_MotionEvent_getHistoricalTouchMajorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalTouchMinorF_I = 0; -static jfloat Java_MotionEvent_getHistoricalTouchMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalTouchMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalTouchMinor", - "(I)F", - &g_MotionEvent_getHistoricalTouchMinorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalToolMajorF_I = 0; -static jfloat Java_MotionEvent_getHistoricalToolMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalToolMajorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalToolMajor", - "(I)F", - &g_MotionEvent_getHistoricalToolMajorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalToolMinorF_I = 0; -static jfloat Java_MotionEvent_getHistoricalToolMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalToolMinorF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalToolMinor", - "(I)F", - &g_MotionEvent_getHistoricalToolMinorF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalOrientationF_I = 0; -static jfloat Java_MotionEvent_getHistoricalOrientationF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static jfloat Java_MotionEvent_getHistoricalOrientationF_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalOrientation", - "(I)F", - &g_MotionEvent_getHistoricalOrientationF_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalAxisValueF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalAxisValueF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalAxisValueF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalAxisValue", - "(II)F", - &g_MotionEvent_getHistoricalAxisValueF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalXF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalXF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalXF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalX", - "(II)F", - &g_MotionEvent_getHistoricalXF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalYF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalYF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalYF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalY", - "(II)F", - &g_MotionEvent_getHistoricalYF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalPressureF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalPressureF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalPressureF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalPressure", - "(II)F", - &g_MotionEvent_getHistoricalPressureF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalSizeF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalSizeF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalSizeF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalSize", - "(II)F", - &g_MotionEvent_getHistoricalSizeF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalTouchMajorF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalTouchMajorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalTouchMajorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalTouchMajor", - "(II)F", - &g_MotionEvent_getHistoricalTouchMajorF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalTouchMinorF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalTouchMinorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalTouchMinorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalTouchMinor", - "(II)F", - &g_MotionEvent_getHistoricalTouchMinorF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalToolMajorF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalToolMajorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalToolMajorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalToolMajor", - "(II)F", - &g_MotionEvent_getHistoricalToolMajorF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalToolMinorF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalToolMinorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalToolMinorF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalToolMinor", - "(II)F", - &g_MotionEvent_getHistoricalToolMinorF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalOrientationF_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalOrientationF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalOrientationF_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalOrientation", - "(II)F", - &g_MotionEvent_getHistoricalOrientationF_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalAxisValueF_I_I_I = 0; -static jfloat Java_MotionEvent_getHistoricalAxisValueF_I_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1, - JniIntWrapper p2) __attribute__ ((unused)); -static jfloat Java_MotionEvent_getHistoricalAxisValueF_I_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1, - JniIntWrapper p2) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalAxisValue", - "(III)F", - &g_MotionEvent_getHistoricalAxisValueF_I_I_I); - - jfloat ret = - env->CallFloatMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1), as_jint(p2)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_getHistoricalPointerCoords = 0; -static void Java_MotionEvent_getHistoricalPointerCoords(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1, - const base::android::JavaRefOrBare<jobject>& p2) __attribute__ ((unused)); -static void Java_MotionEvent_getHistoricalPointerCoords(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0, - JniIntWrapper p1, - const base::android::JavaRefOrBare<jobject>& p2) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getHistoricalPointerCoords", - "(IILandroid/view/MotionEvent$PointerCoords;)V", - &g_MotionEvent_getHistoricalPointerCoords); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0), as_jint(p1), p2.obj()); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_getEdgeFlags = 0; -static jint Java_MotionEvent_getEdgeFlags(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_MotionEvent_getEdgeFlags(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "getEdgeFlags", - "()I", - &g_MotionEvent_getEdgeFlags); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_setEdgeFlags = 0; -static void Java_MotionEvent_setEdgeFlags(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static void Java_MotionEvent_setEdgeFlags(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "setEdgeFlags", - "(I)V", - &g_MotionEvent_setEdgeFlags); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_setAction = 0; -static void Java_MotionEvent_setAction(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static void Java_MotionEvent_setAction(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "setAction", - "(I)V", - &g_MotionEvent_setAction); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_offsetLocation = 0; -static void Java_MotionEvent_offsetLocation(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jfloat p0, - jfloat p1) __attribute__ ((unused)); -static void Java_MotionEvent_offsetLocation(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jfloat p0, - jfloat p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "offsetLocation", - "(FF)V", - &g_MotionEvent_offsetLocation); - - env->CallVoidMethod(obj.obj(), - method_id, p0, p1); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_setLocation = 0; -static void Java_MotionEvent_setLocation(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jfloat p0, - jfloat p1) __attribute__ ((unused)); -static void Java_MotionEvent_setLocation(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jfloat p0, - jfloat p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "setLocation", - "(FF)V", - &g_MotionEvent_setLocation); - - env->CallVoidMethod(obj.obj(), - method_id, p0, p1); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_transform = 0; -static void Java_MotionEvent_transform(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jobject>& p0) __attribute__ ((unused)); -static void Java_MotionEvent_transform(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jobject>& p0) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "transform", - "(Landroid/graphics/Matrix;)V", - &g_MotionEvent_transform); - - env->CallVoidMethod(obj.obj(), - method_id, p0.obj()); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_addBatchV_J_F_F_F_F_I = 0; -static void Java_MotionEvent_addBatchV_J_F_F_F_F_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jlong p0, - jfloat p1, - jfloat p2, - jfloat p3, - jfloat p4, - JniIntWrapper p5) __attribute__ ((unused)); -static void Java_MotionEvent_addBatchV_J_F_F_F_F_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jlong p0, - jfloat p1, - jfloat p2, - jfloat p3, - jfloat p4, - JniIntWrapper p5) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "addBatch", - "(JFFFFI)V", - &g_MotionEvent_addBatchV_J_F_F_F_F_I); - - env->CallVoidMethod(obj.obj(), - method_id, p0, p1, p2, p3, p4, as_jint(p5)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_addBatchV_J_LAVMEPC_I = 0; -static void Java_MotionEvent_addBatchV_J_LAVMEPC_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jlong p0, - const base::android::JavaRefOrBare<jobjectArray>& p1, - JniIntWrapper p2) __attribute__ ((unused)); -static void Java_MotionEvent_addBatchV_J_LAVMEPC_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jlong p0, - const base::android::JavaRefOrBare<jobjectArray>& p1, - JniIntWrapper p2) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "addBatch", - "(J[Landroid/view/MotionEvent$PointerCoords;I)V", - &g_MotionEvent_addBatchV_J_LAVMEPC_I); - - env->CallVoidMethod(obj.obj(), - method_id, p0, p1.obj(), as_jint(p2)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_MotionEvent_toString = 0; -static base::android::ScopedJavaLocalRef<jstring> - Java_MotionEvent_toString(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jstring> - Java_MotionEvent_toString(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "toString", - "()Ljava/lang/String;", - &g_MotionEvent_toString); - - jstring ret = - static_cast<jstring>(env->CallObjectMethod(obj.obj(), - method_id)); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jstring>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_actionToString = 0; -static base::android::ScopedJavaLocalRef<jstring> - Java_MotionEvent_actionToString(JNIEnv* env, JniIntWrapper p0) __attribute__ - ((unused)); -static base::android::ScopedJavaLocalRef<jstring> - Java_MotionEvent_actionToString(JNIEnv* env, JniIntWrapper p0) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "actionToString", - "(I)Ljava/lang/String;", - &g_MotionEvent_actionToString); - - jstring ret = - static_cast<jstring>(env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, as_jint(p0))); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jstring>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_axisToString = 0; -static base::android::ScopedJavaLocalRef<jstring> - Java_MotionEvent_axisToString(JNIEnv* env, JniIntWrapper p0) __attribute__ - ((unused)); -static base::android::ScopedJavaLocalRef<jstring> - Java_MotionEvent_axisToString(JNIEnv* env, JniIntWrapper p0) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "axisToString", - "(I)Ljava/lang/String;", - &g_MotionEvent_axisToString); - - jstring ret = - static_cast<jstring>(env->CallStaticObjectMethod(MotionEvent_clazz(env), - method_id, as_jint(p0))); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jstring>(env, ret); -} - -static base::subtle::AtomicWord g_MotionEvent_axisFromString = 0; -static jint Java_MotionEvent_axisFromString(JNIEnv* env, const - base::android::JavaRefOrBare<jstring>& p0) __attribute__ ((unused)); -static jint Java_MotionEvent_axisFromString(JNIEnv* env, const - base::android::JavaRefOrBare<jstring>& p0) { - CHECK_CLAZZ(env, MotionEvent_clazz(env), - MotionEvent_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, MotionEvent_clazz(env), - "axisFromString", - "(Ljava/lang/String;)I", - &g_MotionEvent_axisFromString); - - jint ret = - env->CallStaticIntMethod(MotionEvent_clazz(env), - method_id, p0.obj()); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_MotionEvent_writeToParcel = 0; -static void Java_MotionEvent_writeToParcel(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jobject>& p0, - JniIntWrapper p1) __attribute__ ((unused)); -static void Java_MotionEvent_writeToParcel(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jobject>& p0, - JniIntWrapper p1) { - CHECK_CLAZZ(env, obj.obj(), - MotionEvent_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, MotionEvent_clazz(env), - "writeToParcel", - "(Landroid/os/Parcel;I)V", - &g_MotionEvent_writeToParcel); - - env->CallVoidMethod(obj.obj(), - method_id, p0.obj(), as_jint(p1)); - jni_generator::CheckException(env); -} - -// Step 3: RegisterNatives. - -} // namespace JNI_MotionEvent - -#endif // android_view_MotionEvent_JNI diff --git a/base/android/jni_generator/testFromJavaP.golden b/base/android/jni_generator/testFromJavaP.golden deleted file mode 100644 index 18a9430..0000000 --- a/base/android/jni_generator/testFromJavaP.golden +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// java/io/InputStream - -#ifndef java_io_InputStream_JNI -#define java_io_InputStream_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kInputStreamClassPath[] = "java/io/InputStream"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_InputStream_clazz __attribute__((unused)) = 0; -#define InputStream_clazz(env) base::android::LazyGetClass(env, kInputStreamClassPath, &g_InputStream_clazz) - -} // namespace - -namespace JNI_InputStream { - -// Step 2: method stubs. - -static base::subtle::AtomicWord g_InputStream_available = 0; -static jint Java_InputStream_available(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_InputStream_available(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "available", - "()I", - &g_InputStream_available); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_InputStream_close = 0; -static void Java_InputStream_close(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static void Java_InputStream_close(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "close", - "()V", - &g_InputStream_close); - - env->CallVoidMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_InputStream_mark = 0; -static void Java_InputStream_mark(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) __attribute__ - ((unused)); -static void Java_InputStream_mark(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper p0) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "mark", - "(I)V", - &g_InputStream_mark); - - env->CallVoidMethod(obj.obj(), - method_id, as_jint(p0)); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_InputStream_markSupported = 0; -static jboolean Java_InputStream_markSupported(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jboolean Java_InputStream_markSupported(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env), false); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "markSupported", - "()Z", - &g_InputStream_markSupported); - - jboolean ret = - env->CallBooleanMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_InputStream_readI = 0; -static jint Java_InputStream_readI(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static jint Java_InputStream_readI(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "read", - "()I", - &g_InputStream_readI); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_InputStream_readI_AB = 0; -static jint Java_InputStream_readI_AB(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jbyteArray>& p0) __attribute__ ((unused)); -static jint Java_InputStream_readI_AB(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jbyteArray>& p0) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "read", - "([B)I", - &g_InputStream_readI_AB); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id, p0.obj()); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0; -static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jbyteArray>& p0, - JniIntWrapper p1, - JniIntWrapper p2) __attribute__ ((unused)); -static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, const - base::android::JavaRefOrBare<jbyteArray>& p0, - JniIntWrapper p1, - JniIntWrapper p2) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "read", - "([BII)I", - &g_InputStream_readI_AB_I_I); - - jint ret = - env->CallIntMethod(obj.obj(), - method_id, p0.obj(), as_jint(p1), as_jint(p2)); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_InputStream_reset = 0; -static void Java_InputStream_reset(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static void Java_InputStream_reset(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "reset", - "()V", - &g_InputStream_reset); - - env->CallVoidMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); -} - -static base::subtle::AtomicWord g_InputStream_skip = 0; -static jlong Java_InputStream_skip(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jlong p0) __attribute__ - ((unused)); -static jlong Java_InputStream_skip(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj, jlong p0) { - CHECK_CLAZZ(env, obj.obj(), - InputStream_clazz(env), 0); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "skip", - "(J)J", - &g_InputStream_skip); - - jlong ret = - env->CallLongMethod(obj.obj(), - method_id, p0); - jni_generator::CheckException(env); - return ret; -} - -static base::subtle::AtomicWord g_InputStream_Constructor = 0; -static base::android::ScopedJavaLocalRef<jobject> - Java_InputStream_Constructor(JNIEnv* env) __attribute__ ((unused)); -static base::android::ScopedJavaLocalRef<jobject> - Java_InputStream_Constructor(JNIEnv* env) { - CHECK_CLAZZ(env, InputStream_clazz(env), - InputStream_clazz(env), NULL); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, InputStream_clazz(env), - "<init>", - "()V", - &g_InputStream_Constructor); - - jobject ret = - env->NewObject(InputStream_clazz(env), - method_id); - jni_generator::CheckException(env); - return base::android::ScopedJavaLocalRef<jobject>(env, ret); -} - -// Step 3: RegisterNatives. - -} // namespace JNI_InputStream - -#endif // java_io_InputStream_JNI diff --git a/base/android/jni_generator/testFromJavaPGenerics.golden b/base/android/jni_generator/testFromJavaPGenerics.golden deleted file mode 100644 index c076c39..0000000 --- a/base/android/jni_generator/testFromJavaPGenerics.golden +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// java/util/HashSet - -#ifndef java_util_HashSet_JNI -#define java_util_HashSet_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kHashSetClassPath[] = "java/util/HashSet"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_HashSet_clazz __attribute__((unused)) = 0; -#define HashSet_clazz(env) base::android::LazyGetClass(env, kHashSetClassPath, &g_HashSet_clazz) - -} // namespace - -namespace JNI_HashSet { - -// Step 2: method stubs. - -static base::subtle::AtomicWord g_HashSet_dummy = 0; -static void Java_HashSet_dummy(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) __attribute__ ((unused)); -static void Java_HashSet_dummy(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& obj) { - CHECK_CLAZZ(env, obj.obj(), - HashSet_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_INSTANCE>( - env, HashSet_clazz(env), - "dummy", - "()V", - &g_HashSet_dummy); - - env->CallVoidMethod(obj.obj(), - method_id); - jni_generator::CheckException(env); -} - -// Step 3: RegisterNatives. - -} // namespace JNI_HashSet - -#endif // java_util_HashSet_JNI diff --git a/base/android/jni_generator/testInnerClassNatives.golden b/base/android/jni_generator/testInnerClassNatives.golden deleted file mode 100644 index 20b8830..0000000 --- a/base/android/jni_generator/testInnerClassNatives.golden +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/TestJni - -#ifndef org_chromium_TestJni_JNI -#define org_chromium_TestJni_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kTestJniClassPath[] = "org/chromium/TestJni"; -const char kMyInnerClassClassPath[] = "org/chromium/TestJni$MyInnerClass"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; -#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_MyInnerClass_clazz __attribute__((unused)) = 0; -#define MyInnerClass_clazz(env) base::android::LazyGetClass(env, kMyInnerClassClassPath, &g_MyInnerClass_clazz) - -} // namespace - -// Step 2: method stubs. - -static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller); - -JNI_GENERATOR_EXPORT jint - Java_org_chromium_TestJni_00024MyInnerClass_nativeInit(JNIEnv* env, jobject - jcaller) { - return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsMyInnerClass[] = { - { "nativeInit", -"(" -")" -"I", - reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyInnerClass_nativeInit) - }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass); - - if (env->RegisterNatives(MyInnerClass_clazz(env), - kMethodsMyInnerClass, - kMethodsMyInnerClassSize) < 0) { - jni_generator::HandleRegistrationError( - env, MyInnerClass_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_TestJni_JNI diff --git a/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden b/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden deleted file mode 100644 index 67352e7..0000000 --- a/base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/TestJni - -#ifndef org_chromium_TestJni_JNI -#define org_chromium_TestJni_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kMyOtherInnerClassClassPath[] = - "org/chromium/TestJni$MyOtherInnerClass"; -const char kTestJniClassPath[] = "org/chromium/TestJni"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_MyOtherInnerClass_clazz __attribute__((unused)) = 0; -#define MyOtherInnerClass_clazz(env) base::android::LazyGetClass(env, kMyOtherInnerClassClassPath, &g_MyOtherInnerClass_clazz) -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; -#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) - -} // namespace - -// Step 2: method stubs. - -static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller); - -JNI_GENERATOR_EXPORT jint Java_org_chromium_TestJni_nativeInit(JNIEnv* env, - jobject jcaller) { - return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); -} - -static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller); - -JNI_GENERATOR_EXPORT jint - Java_org_chromium_TestJni_00024MyOtherInnerClass_nativeInit(JNIEnv* env, - jobject jcaller) { - return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsMyOtherInnerClass[] = { - { "nativeInit", -"(" -")" -"I", - reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyOtherInnerClass_nativeInit) - }, -}; - -static const JNINativeMethod kMethodsTestJni[] = { - { "nativeInit", -"(" -")" -"I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeInit) }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsMyOtherInnerClassSize = - arraysize(kMethodsMyOtherInnerClass); - - if (env->RegisterNatives(MyOtherInnerClass_clazz(env), - kMethodsMyOtherInnerClass, - kMethodsMyOtherInnerClassSize) < 0) { - jni_generator::HandleRegistrationError( - env, MyOtherInnerClass_clazz(env), __FILE__); - return false; - } - - const int kMethodsTestJniSize = arraysize(kMethodsTestJni); - - if (env->RegisterNatives(TestJni_clazz(env), - kMethodsTestJni, - kMethodsTestJniSize) < 0) { - jni_generator::HandleRegistrationError( - env, TestJni_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_TestJni_JNI diff --git a/base/android/jni_generator/testInnerClassNativesMultiple.golden b/base/android/jni_generator/testInnerClassNativesMultiple.golden deleted file mode 100644 index 7807efa..0000000 --- a/base/android/jni_generator/testInnerClassNativesMultiple.golden +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/TestJni - -#ifndef org_chromium_TestJni_JNI -#define org_chromium_TestJni_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kMyOtherInnerClassClassPath[] = - "org/chromium/TestJni$MyOtherInnerClass"; -const char kTestJniClassPath[] = "org/chromium/TestJni"; -const char kMyInnerClassClassPath[] = "org/chromium/TestJni$MyInnerClass"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_MyOtherInnerClass_clazz __attribute__((unused)) = 0; -#define MyOtherInnerClass_clazz(env) base::android::LazyGetClass(env, kMyOtherInnerClassClassPath, &g_MyOtherInnerClass_clazz) -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; -#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_MyInnerClass_clazz __attribute__((unused)) = 0; -#define MyInnerClass_clazz(env) base::android::LazyGetClass(env, kMyInnerClassClassPath, &g_MyInnerClass_clazz) - -} // namespace - -// Step 2: method stubs. - -static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller); - -JNI_GENERATOR_EXPORT jint - Java_org_chromium_TestJni_00024MyInnerClass_nativeInit(JNIEnv* env, jobject - jcaller) { - return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); -} - -static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller); - -JNI_GENERATOR_EXPORT jint - Java_org_chromium_TestJni_00024MyOtherInnerClass_nativeInit(JNIEnv* env, - jobject jcaller) { - return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsMyOtherInnerClass[] = { - { "nativeInit", -"(" -")" -"I", - reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyOtherInnerClass_nativeInit) - }, -}; - -static const JNINativeMethod kMethodsMyInnerClass[] = { - { "nativeInit", -"(" -")" -"I", - reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyInnerClass_nativeInit) - }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsMyOtherInnerClassSize = - arraysize(kMethodsMyOtherInnerClass); - - if (env->RegisterNatives(MyOtherInnerClass_clazz(env), - kMethodsMyOtherInnerClass, - kMethodsMyOtherInnerClassSize) < 0) { - jni_generator::HandleRegistrationError( - env, MyOtherInnerClass_clazz(env), __FILE__); - return false; - } - - const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass); - - if (env->RegisterNatives(MyInnerClass_clazz(env), - kMethodsMyInnerClass, - kMethodsMyInnerClassSize) < 0) { - jni_generator::HandleRegistrationError( - env, MyInnerClass_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_TestJni_JNI diff --git a/base/android/jni_generator/testInputStream.javap b/base/android/jni_generator/testInputStream.javap deleted file mode 100644 index 50ab617..0000000 --- a/base/android/jni_generator/testInputStream.javap +++ /dev/null @@ -1,228 +0,0 @@ -Compiled from "InputStream.java" -public abstract class java.io.InputStream extends java.lang.Object implements java.io.Closeable - SourceFile: "InputStream.java" - minor version: 0 - major version: 49 - Constant pool: -const #1 = Method #6.#39; // java/lang/Object."<init>":()V -const #2 = class #40; // java/lang/RuntimeException -const #3 = String #41; // Stub! -const #4 = Method #2.#42; // java/lang/RuntimeException."<init>":(Ljava/lang/String;)V -const #5 = class #43; // java/io/InputStream -const #6 = class #44; // java/lang/Object -const #7 = class #45; // java/io/Closeable -const #8 = Asciz <init>; -const #9 = Asciz ()V; -const #10 = Asciz Code; -const #11 = Asciz LineNumberTable; -const #12 = Asciz LocalVariableTable; -const #13 = Asciz this; -const #14 = Asciz Ljava/io/InputStream;; -const #15 = Asciz available; -const #16 = Asciz ()I; -const #17 = Asciz Exceptions; -const #18 = class #46; // java/io/IOException -const #19 = Asciz close; -const #20 = Asciz mark; -const #21 = Asciz (I)V; -const #22 = Asciz readlimit; -const #23 = Asciz I; -const #24 = Asciz markSupported; -const #25 = Asciz ()Z; -const #26 = Asciz read; -const #27 = Asciz ([B)I; -const #28 = Asciz buffer; -const #29 = Asciz [B; -const #30 = Asciz ([BII)I; -const #31 = Asciz byteOffset; -const #32 = Asciz byteCount; -const #33 = Asciz reset; -const #34 = Asciz skip; -const #35 = Asciz (J)J; -const #36 = Asciz J; -const #37 = Asciz SourceFile; -const #38 = Asciz InputStream.java; -const #39 = NameAndType #8:#9;// "<init>":()V -const #40 = Asciz java/lang/RuntimeException; -const #41 = Asciz Stub!; -const #42 = NameAndType #8:#47;// "<init>":(Ljava/lang/String;)V -const #43 = Asciz java/io/InputStream; -const #44 = Asciz java/lang/Object; -const #45 = Asciz java/io/Closeable; -const #46 = Asciz java/io/IOException; -const #47 = Asciz (Ljava/lang/String;)V; - -{ -public java.io.InputStream(); - Signature: ()V - Code: - Stack=3, Locals=1, Args_size=1 - 0: aload_0 - 1: invokespecial #1; //Method java/lang/Object."<init>":()V - 4: new #2; //class java/lang/RuntimeException - 7: dup - 8: ldc #3; //String Stub! - 10: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 13: athrow - LineNumberTable: - line 5: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 14 0 this Ljava/io/InputStream; - - -public int available() throws java.io.IOException; - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 6: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - - Exceptions: - throws java.io.IOException -public void close() throws java.io.IOException; - Signature: ()V - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 7: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - - Exceptions: - throws java.io.IOException -public void mark(int); - Signature: (I)V - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 8: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - 0 10 1 readlimit I - - -public boolean markSupported(); - Signature: ()Z - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 9: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - - -public abstract int read() throws java.io.IOException; - Signature: ()I - Exceptions: - throws java.io.IOException -public int read(byte[]) throws java.io.IOException; - Signature: ([B)I - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 11: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - 0 10 1 buffer [B - - Exceptions: - throws java.io.IOException -public int read(byte[], int, int) throws java.io.IOException; - Signature: ([BII)I - Code: - Stack=3, Locals=4, Args_size=4 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 12: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - 0 10 1 buffer [B - 0 10 2 byteOffset I - 0 10 3 byteCount I - - Exceptions: - throws java.io.IOException -public synchronized void reset() throws java.io.IOException; - Signature: ()V - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 13: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - - Exceptions: - throws java.io.IOException -public long skip(long) throws java.io.IOException; - Signature: (J)J - Code: - Stack=3, Locals=3, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 14: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Ljava/io/InputStream; - 0 10 1 byteCount J - - Exceptions: - throws java.io.IOException -} - diff --git a/base/android/jni_generator/testMotionEvent.javap b/base/android/jni_generator/testMotionEvent.javap deleted file mode 100644 index 0746943..0000000 --- a/base/android/jni_generator/testMotionEvent.javap +++ /dev/null @@ -1,2295 +0,0 @@ -Compiled from "MotionEvent.java" -public final class android.view.MotionEvent extends android.view.InputEvent implements android.os.Parcelable - SourceFile: "MotionEvent.java" - InnerClass: - public final #10= #9 of #6; //PointerProperties=class android/view/MotionEvent$PointerProperties of class android/view/MotionEvent - public final #13= #12 of #6; //PointerCoords=class android/view/MotionEvent$PointerCoords of class android/view/MotionEvent - public abstract #150= #149 of #8; //Creator=class android/os/Parcelable$Creator of class android/os/Parcelable - minor version: 0 - major version: 49 - Constant pool: -const #1 = Method #7.#293; // android/view/InputEvent."<init>":()V -const #2 = class #294; // java/lang/RuntimeException -const #3 = String #295; // Stub! -const #4 = Method #2.#296; // java/lang/RuntimeException."<init>":(Ljava/lang/String;)V -const #5 = Field #6.#297; // android/view/MotionEvent.CREATOR:Landroid/os/Parcelable$Creator; -const #6 = class #298; // android/view/MotionEvent -const #7 = class #299; // android/view/InputEvent -const #8 = class #300; // android/os/Parcelable -const #9 = class #301; // android/view/MotionEvent$PointerProperties -const #10 = Asciz PointerProperties; -const #11 = Asciz InnerClasses; -const #12 = class #302; // android/view/MotionEvent$PointerCoords -const #13 = Asciz PointerCoords; -const #14 = Asciz INVALID_POINTER_ID; -const #15 = Asciz I; -const #16 = Asciz ConstantValue; -const #17 = int -1; -const #18 = Asciz ACTION_MASK; -const #19 = int 255; -const #20 = Asciz ACTION_DOWN; -const #21 = int 0; -const #22 = Asciz ACTION_UP; -const #23 = int 1; -const #24 = Asciz ACTION_MOVE; -const #25 = int 2; -const #26 = Asciz ACTION_CANCEL; -const #27 = int 3; -const #28 = Asciz ACTION_OUTSIDE; -const #29 = int 4; -const #30 = Asciz ACTION_POINTER_DOWN; -const #31 = int 5; -const #32 = Asciz ACTION_POINTER_UP; -const #33 = int 6; -const #34 = Asciz ACTION_HOVER_MOVE; -const #35 = int 7; -const #36 = Asciz ACTION_SCROLL; -const #37 = int 8; -const #38 = Asciz ACTION_HOVER_ENTER; -const #39 = int 9; -const #40 = Asciz ACTION_HOVER_EXIT; -const #41 = int 10; -const #42 = Asciz ACTION_POINTER_INDEX_MASK; -const #43 = int 65280; -const #44 = Asciz ACTION_POINTER_INDEX_SHIFT; -const #45 = Asciz ACTION_POINTER_1_DOWN; -const #46 = Asciz Deprecated; -const #47 = Asciz RuntimeVisibleAnnotations; -const #48 = Asciz Ljava/lang/Deprecated;; -const #49 = Asciz ACTION_POINTER_2_DOWN; -const #50 = int 261; -const #51 = Asciz ACTION_POINTER_3_DOWN; -const #52 = int 517; -const #53 = Asciz ACTION_POINTER_1_UP; -const #54 = Asciz ACTION_POINTER_2_UP; -const #55 = int 262; -const #56 = Asciz ACTION_POINTER_3_UP; -const #57 = int 518; -const #58 = Asciz ACTION_POINTER_ID_MASK; -const #59 = Asciz ACTION_POINTER_ID_SHIFT; -const #60 = Asciz FLAG_WINDOW_IS_OBSCURED; -const #61 = Asciz EDGE_TOP; -const #62 = Asciz EDGE_BOTTOM; -const #63 = Asciz EDGE_LEFT; -const #64 = Asciz EDGE_RIGHT; -const #65 = Asciz AXIS_X; -const #66 = Asciz AXIS_Y; -const #67 = Asciz AXIS_PRESSURE; -const #68 = Asciz AXIS_SIZE; -const #69 = Asciz AXIS_TOUCH_MAJOR; -const #70 = Asciz AXIS_TOUCH_MINOR; -const #71 = Asciz AXIS_TOOL_MAJOR; -const #72 = Asciz AXIS_TOOL_MINOR; -const #73 = Asciz AXIS_ORIENTATION; -const #74 = Asciz AXIS_VSCROLL; -const #75 = Asciz AXIS_HSCROLL; -const #76 = Asciz AXIS_Z; -const #77 = int 11; -const #78 = Asciz AXIS_RX; -const #79 = int 12; -const #80 = Asciz AXIS_RY; -const #81 = int 13; -const #82 = Asciz AXIS_RZ; -const #83 = int 14; -const #84 = Asciz AXIS_HAT_X; -const #85 = int 15; -const #86 = Asciz AXIS_HAT_Y; -const #87 = int 16; -const #88 = Asciz AXIS_LTRIGGER; -const #89 = int 17; -const #90 = Asciz AXIS_RTRIGGER; -const #91 = int 18; -const #92 = Asciz AXIS_THROTTLE; -const #93 = int 19; -const #94 = Asciz AXIS_RUDDER; -const #95 = int 20; -const #96 = Asciz AXIS_WHEEL; -const #97 = int 21; -const #98 = Asciz AXIS_GAS; -const #99 = int 22; -const #100 = Asciz AXIS_BRAKE; -const #101 = int 23; -const #102 = Asciz AXIS_DISTANCE; -const #103 = int 24; -const #104 = Asciz AXIS_TILT; -const #105 = int 25; -const #106 = Asciz AXIS_GENERIC_1; -const #107 = int 32; -const #108 = Asciz AXIS_GENERIC_2; -const #109 = int 33; -const #110 = Asciz AXIS_GENERIC_3; -const #111 = int 34; -const #112 = Asciz AXIS_GENERIC_4; -const #113 = int 35; -const #114 = Asciz AXIS_GENERIC_5; -const #115 = int 36; -const #116 = Asciz AXIS_GENERIC_6; -const #117 = int 37; -const #118 = Asciz AXIS_GENERIC_7; -const #119 = int 38; -const #120 = Asciz AXIS_GENERIC_8; -const #121 = int 39; -const #122 = Asciz AXIS_GENERIC_9; -const #123 = int 40; -const #124 = Asciz AXIS_GENERIC_10; -const #125 = int 41; -const #126 = Asciz AXIS_GENERIC_11; -const #127 = int 42; -const #128 = Asciz AXIS_GENERIC_12; -const #129 = int 43; -const #130 = Asciz AXIS_GENERIC_13; -const #131 = int 44; -const #132 = Asciz AXIS_GENERIC_14; -const #133 = int 45; -const #134 = Asciz AXIS_GENERIC_15; -const #135 = int 46; -const #136 = Asciz AXIS_GENERIC_16; -const #137 = int 47; -const #138 = Asciz BUTTON_PRIMARY; -const #139 = Asciz BUTTON_SECONDARY; -const #140 = Asciz BUTTON_TERTIARY; -const #141 = Asciz BUTTON_BACK; -const #142 = Asciz BUTTON_FORWARD; -const #143 = Asciz TOOL_TYPE_UNKNOWN; -const #144 = Asciz TOOL_TYPE_FINGER; -const #145 = Asciz TOOL_TYPE_STYLUS; -const #146 = Asciz TOOL_TYPE_MOUSE; -const #147 = Asciz TOOL_TYPE_ERASER; -const #148 = Asciz CREATOR; -const #149 = class #303; // android/os/Parcelable$Creator -const #150 = Asciz Creator; -const #151 = Asciz Landroid/os/Parcelable$Creator;; -const #152 = Asciz Signature; -const #153 = Asciz Landroid/os/Parcelable$Creator<Landroid/view/MotionEvent;>;; -const #154 = Asciz <init>; -const #155 = Asciz ()V; -const #156 = Asciz Code; -const #157 = Asciz LineNumberTable; -const #158 = Asciz LocalVariableTable; -const #159 = Asciz this; -const #160 = Asciz Landroid/view/MotionEvent;; -const #161 = Asciz finalize; -const #162 = Asciz Exceptions; -const #163 = class #304; // java/lang/Throwable -const #164 = Asciz obtain; -const #165 = Asciz (JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent;; -const #166 = Asciz downTime; -const #167 = Asciz J; -const #168 = Asciz eventTime; -const #169 = Asciz action; -const #170 = Asciz pointerCount; -const #171 = Asciz pointerProperties; -const #172 = Asciz [Landroid/view/MotionEvent$PointerProperties;; -const #173 = Asciz pointerCoords; -const #174 = Asciz [Landroid/view/MotionEvent$PointerCoords;; -const #175 = Asciz metaState; -const #176 = Asciz buttonState; -const #177 = Asciz xPrecision; -const #178 = Asciz F; -const #179 = Asciz yPrecision; -const #180 = Asciz deviceId; -const #181 = Asciz edgeFlags; -const #182 = Asciz source; -const #183 = Asciz flags; -const #184 = Asciz (JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent;; -const #185 = Asciz pointerIds; -const #186 = Asciz [I; -const #187 = Asciz (JJIFFFFIFFII)Landroid/view/MotionEvent;; -const #188 = Asciz x; -const #189 = Asciz y; -const #190 = Asciz pressure; -const #191 = Asciz size; -const #192 = Asciz (JJIIFFFFIFFII)Landroid/view/MotionEvent;; -const #193 = Asciz (JJIFFI)Landroid/view/MotionEvent;; -const #194 = Asciz (Landroid/view/MotionEvent;)Landroid/view/MotionEvent;; -const #195 = Asciz other; -const #196 = Asciz obtainNoHistory; -const #197 = Asciz recycle; -const #198 = Asciz getDeviceId; -const #199 = Asciz ()I; -const #200 = Asciz getSource; -const #201 = Asciz setSource; -const #202 = Asciz (I)V; -const #203 = Asciz getAction; -const #204 = Asciz getActionMasked; -const #205 = Asciz getActionIndex; -const #206 = Asciz getFlags; -const #207 = Asciz getDownTime; -const #208 = Asciz ()J; -const #209 = Asciz getEventTime; -const #210 = Asciz getX; -const #211 = Asciz ()F; -const #212 = Asciz getY; -const #213 = Asciz getPressure; -const #214 = Asciz getSize; -const #215 = Asciz getTouchMajor; -const #216 = Asciz getTouchMinor; -const #217 = Asciz getToolMajor; -const #218 = Asciz getToolMinor; -const #219 = Asciz getOrientation; -const #220 = Asciz getAxisValue; -const #221 = Asciz (I)F; -const #222 = Asciz axis; -const #223 = Asciz getPointerCount; -const #224 = Asciz getPointerId; -const #225 = Asciz (I)I; -const #226 = Asciz pointerIndex; -const #227 = Asciz getToolType; -const #228 = Asciz findPointerIndex; -const #229 = Asciz pointerId; -const #230 = Asciz (II)F; -const #231 = Asciz getPointerCoords; -const #232 = Asciz (ILandroid/view/MotionEvent$PointerCoords;)V; -const #233 = Asciz outPointerCoords; -const #234 = Asciz Landroid/view/MotionEvent$PointerCoords;; -const #235 = Asciz getPointerProperties; -const #236 = Asciz (ILandroid/view/MotionEvent$PointerProperties;)V; -const #237 = Asciz outPointerProperties; -const #238 = Asciz Landroid/view/MotionEvent$PointerProperties;; -const #239 = Asciz getMetaState; -const #240 = Asciz getButtonState; -const #241 = Asciz getRawX; -const #242 = Asciz getRawY; -const #243 = Asciz getXPrecision; -const #244 = Asciz getYPrecision; -const #245 = Asciz getHistorySize; -const #246 = Asciz getHistoricalEventTime; -const #247 = Asciz (I)J; -const #248 = Asciz pos; -const #249 = Asciz getHistoricalX; -const #250 = Asciz getHistoricalY; -const #251 = Asciz getHistoricalPressure; -const #252 = Asciz getHistoricalSize; -const #253 = Asciz getHistoricalTouchMajor; -const #254 = Asciz getHistoricalTouchMinor; -const #255 = Asciz getHistoricalToolMajor; -const #256 = Asciz getHistoricalToolMinor; -const #257 = Asciz getHistoricalOrientation; -const #258 = Asciz getHistoricalAxisValue; -const #259 = Asciz (III)F; -const #260 = Asciz getHistoricalPointerCoords; -const #261 = Asciz (IILandroid/view/MotionEvent$PointerCoords;)V; -const #262 = Asciz getEdgeFlags; -const #263 = Asciz setEdgeFlags; -const #264 = Asciz setAction; -const #265 = Asciz offsetLocation; -const #266 = Asciz (FF)V; -const #267 = Asciz deltaX; -const #268 = Asciz deltaY; -const #269 = Asciz setLocation; -const #270 = Asciz transform; -const #271 = Asciz (Landroid/graphics/Matrix;)V; -const #272 = Asciz matrix; -const #273 = Asciz Landroid/graphics/Matrix;; -const #274 = Asciz addBatch; -const #275 = Asciz (JFFFFI)V; -const #276 = Asciz (J[Landroid/view/MotionEvent$PointerCoords;I)V; -const #277 = Asciz toString; -const #278 = Asciz ()Ljava/lang/String;; -const #279 = Asciz actionToString; -const #280 = Asciz (I)Ljava/lang/String;; -const #281 = Asciz axisToString; -const #282 = Asciz axisFromString; -const #283 = Asciz (Ljava/lang/String;)I; -const #284 = Asciz symbolicName; -const #285 = Asciz Ljava/lang/String;; -const #286 = Asciz writeToParcel; -const #287 = Asciz (Landroid/os/Parcel;I)V; -const #288 = Asciz out; -const #289 = Asciz Landroid/os/Parcel;; -const #290 = Asciz <clinit>; -const #291 = Asciz SourceFile; -const #292 = Asciz MotionEvent.java; -const #293 = NameAndType #154:#155;// "<init>":()V -const #294 = Asciz java/lang/RuntimeException; -const #295 = Asciz Stub!; -const #296 = NameAndType #154:#305;// "<init>":(Ljava/lang/String;)V -const #297 = NameAndType #148:#151;// CREATOR:Landroid/os/Parcelable$Creator; -const #298 = Asciz android/view/MotionEvent; -const #299 = Asciz android/view/InputEvent; -const #300 = Asciz android/os/Parcelable; -const #301 = Asciz android/view/MotionEvent$PointerProperties; -const #302 = Asciz android/view/MotionEvent$PointerCoords; -const #303 = Asciz android/os/Parcelable$Creator; -const #304 = Asciz java/lang/Throwable; -const #305 = Asciz (Ljava/lang/String;)V; - -{ -public static final int INVALID_POINTER_ID; - Signature: I - Constant value: int -1 - -public static final int ACTION_MASK; - Signature: I - Constant value: int 255 - -public static final int ACTION_DOWN; - Signature: I - Constant value: int 0 - -public static final int ACTION_UP; - Signature: I - Constant value: int 1 - -public static final int ACTION_MOVE; - Signature: I - Constant value: int 2 - -public static final int ACTION_CANCEL; - Signature: I - Constant value: int 3 - -public static final int ACTION_OUTSIDE; - Signature: I - Constant value: int 4 - -public static final int ACTION_POINTER_DOWN; - Signature: I - Constant value: int 5 - -public static final int ACTION_POINTER_UP; - Signature: I - Constant value: int 6 - -public static final int ACTION_HOVER_MOVE; - Signature: I - Constant value: int 7 - -public static final int ACTION_SCROLL; - Signature: I - Constant value: int 8 - -public static final int ACTION_HOVER_ENTER; - Signature: I - Constant value: int 9 - -public static final int ACTION_HOVER_EXIT; - Signature: I - Constant value: int 10 - -public static final int ACTION_POINTER_INDEX_MASK; - Signature: I - Constant value: int 65280 - -public static final int ACTION_POINTER_INDEX_SHIFT; - Signature: I - Constant value: int 8 - -public static final int ACTION_POINTER_1_DOWN; - Signature: I - Constant value: int 5Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_2_DOWN; - Signature: I - Constant value: int 261Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_3_DOWN; - Signature: I - Constant value: int 517Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_1_UP; - Signature: I - Constant value: int 6Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_2_UP; - Signature: I - Constant value: int 262Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_3_UP; - Signature: I - Constant value: int 518Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_ID_MASK; - Signature: I - Constant value: int 65280Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int ACTION_POINTER_ID_SHIFT; - Signature: I - Constant value: int 8Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - - -public static final int FLAG_WINDOW_IS_OBSCURED; - Signature: I - Constant value: int 1 - -public static final int EDGE_TOP; - Signature: I - Constant value: int 1 - -public static final int EDGE_BOTTOM; - Signature: I - Constant value: int 2 - -public static final int EDGE_LEFT; - Signature: I - Constant value: int 4 - -public static final int EDGE_RIGHT; - Signature: I - Constant value: int 8 - -public static final int AXIS_X; - Signature: I - Constant value: int 0 - -public static final int AXIS_Y; - Signature: I - Constant value: int 1 - -public static final int AXIS_PRESSURE; - Signature: I - Constant value: int 2 - -public static final int AXIS_SIZE; - Signature: I - Constant value: int 3 - -public static final int AXIS_TOUCH_MAJOR; - Signature: I - Constant value: int 4 - -public static final int AXIS_TOUCH_MINOR; - Signature: I - Constant value: int 5 - -public static final int AXIS_TOOL_MAJOR; - Signature: I - Constant value: int 6 - -public static final int AXIS_TOOL_MINOR; - Signature: I - Constant value: int 7 - -public static final int AXIS_ORIENTATION; - Signature: I - Constant value: int 8 - -public static final int AXIS_VSCROLL; - Signature: I - Constant value: int 9 - -public static final int AXIS_HSCROLL; - Signature: I - Constant value: int 10 - -public static final int AXIS_Z; - Signature: I - Constant value: int 11 - -public static final int AXIS_RX; - Signature: I - Constant value: int 12 - -public static final int AXIS_RY; - Signature: I - Constant value: int 13 - -public static final int AXIS_RZ; - Signature: I - Constant value: int 14 - -public static final int AXIS_HAT_X; - Signature: I - Constant value: int 15 - -public static final int AXIS_HAT_Y; - Signature: I - Constant value: int 16 - -public static final int AXIS_LTRIGGER; - Signature: I - Constant value: int 17 - -public static final int AXIS_RTRIGGER; - Signature: I - Constant value: int 18 - -public static final int AXIS_THROTTLE; - Signature: I - Constant value: int 19 - -public static final int AXIS_RUDDER; - Signature: I - Constant value: int 20 - -public static final int AXIS_WHEEL; - Signature: I - Constant value: int 21 - -public static final int AXIS_GAS; - Signature: I - Constant value: int 22 - -public static final int AXIS_BRAKE; - Signature: I - Constant value: int 23 - -public static final int AXIS_DISTANCE; - Signature: I - Constant value: int 24 - -public static final int AXIS_TILT; - Signature: I - Constant value: int 25 - -public static final int AXIS_GENERIC_1; - Signature: I - Constant value: int 32 - -public static final int AXIS_GENERIC_2; - Signature: I - Constant value: int 33 - -public static final int AXIS_GENERIC_3; - Signature: I - Constant value: int 34 - -public static final int AXIS_GENERIC_4; - Signature: I - Constant value: int 35 - -public static final int AXIS_GENERIC_5; - Signature: I - Constant value: int 36 - -public static final int AXIS_GENERIC_6; - Signature: I - Constant value: int 37 - -public static final int AXIS_GENERIC_7; - Signature: I - Constant value: int 38 - -public static final int AXIS_GENERIC_8; - Signature: I - Constant value: int 39 - -public static final int AXIS_GENERIC_9; - Signature: I - Constant value: int 40 - -public static final int AXIS_GENERIC_10; - Signature: I - Constant value: int 41 - -public static final int AXIS_GENERIC_11; - Signature: I - Constant value: int 42 - -public static final int AXIS_GENERIC_12; - Signature: I - Constant value: int 43 - -public static final int AXIS_GENERIC_13; - Signature: I - Constant value: int 44 - -public static final int AXIS_GENERIC_14; - Signature: I - Constant value: int 45 - -public static final int AXIS_GENERIC_15; - Signature: I - Constant value: int 46 - -public static final int AXIS_GENERIC_16; - Signature: I - Constant value: int 47 - -public static final int BUTTON_PRIMARY; - Signature: I - Constant value: int 1 - -public static final int BUTTON_SECONDARY; - Signature: I - Constant value: int 2 - -public static final int BUTTON_TERTIARY; - Signature: I - Constant value: int 4 - -public static final int BUTTON_BACK; - Signature: I - Constant value: int 8 - -public static final int BUTTON_FORWARD; - Signature: I - Constant value: int 16 - -public static final int TOOL_TYPE_UNKNOWN; - Signature: I - Constant value: int 0 - -public static final int TOOL_TYPE_FINGER; - Signature: I - Constant value: int 1 - -public static final int TOOL_TYPE_STYLUS; - Signature: I - Constant value: int 2 - -public static final int TOOL_TYPE_MOUSE; - Signature: I - Constant value: int 3 - -public static final int TOOL_TYPE_ERASER; - Signature: I - Constant value: int 4 - -public static final android.os.Parcelable$Creator CREATOR; - Signature: Landroid/os/Parcelable$Creator; - Signature: length = 0x2 - 00 FFFFFF99 - - -android.view.MotionEvent(); - Signature: ()V - Code: - Stack=3, Locals=1, Args_size=1 - 0: aload_0 - 1: invokespecial #1; //Method android/view/InputEvent."<init>":()V - 4: new #2; //class java/lang/RuntimeException - 7: dup - 8: ldc #3; //String Stub! - 10: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 13: athrow - LineNumberTable: - line 35: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 14 0 this Landroid/view/MotionEvent; - - -protected void finalize() throws java.lang.Throwable; - Signature: ()V - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 36: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - Exceptions: - throws java.lang.Throwable -public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent$PointerProperties[], android.view.MotionEvent$PointerCoords[], int, int, float, float, int, int, int, int); - Signature: (JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=16, Args_size=14 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 37: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 pointerCount I - 0 10 6 pointerProperties [Landroid/view/MotionEvent$PointerProperties; - 0 10 7 pointerCoords [Landroid/view/MotionEvent$PointerCoords; - 0 10 8 metaState I - 0 10 9 buttonState I - 0 10 10 xPrecision F - 0 10 11 yPrecision F - 0 10 12 deviceId I - 0 10 13 edgeFlags I - 0 10 14 source I - 0 10 15 flags I - - -public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent$PointerCoords[], int, float, float, int, int, int, int); - Signature: (JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=15, Args_size=13 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 39: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 pointerCount I - 0 10 6 pointerIds [I - 0 10 7 pointerCoords [Landroid/view/MotionEvent$PointerCoords; - 0 10 8 metaState I - 0 10 9 xPrecision F - 0 10 10 yPrecision F - 0 10 11 deviceId I - 0 10 12 edgeFlags I - 0 10 13 source I - 0 10 14 flags I - - Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - -public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int); - Signature: (JJIFFFFIFFII)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=14, Args_size=12 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 40: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 x F - 0 10 6 y F - 0 10 7 pressure F - 0 10 8 size F - 0 10 9 metaState I - 0 10 10 xPrecision F - 0 10 11 yPrecision F - 0 10 12 deviceId I - 0 10 13 edgeFlags I - - -public static android.view.MotionEvent obtain(long, long, int, int, float, float, float, float, int, float, float, int, int); - Signature: (JJIIFFFFIFFII)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=15, Args_size=13 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 42: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 pointerCount I - 0 10 6 x F - 0 10 7 y F - 0 10 8 pressure F - 0 10 9 size F - 0 10 10 metaState I - 0 10 11 xPrecision F - 0 10 12 yPrecision F - 0 10 13 deviceId I - 0 10 14 edgeFlags I - - Deprecated: true - RuntimeVisibleAnnotations: length = 0x6 - 00 01 00 30 00 00 - -public static android.view.MotionEvent obtain(long, long, int, float, float, int); - Signature: (JJIFFI)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=8, Args_size=6 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 43: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 x F - 0 10 6 y F - 0 10 7 metaState I - - -public static android.view.MotionEvent obtain(android.view.MotionEvent); - Signature: (Landroid/view/MotionEvent;)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 44: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 other Landroid/view/MotionEvent; - - -public static android.view.MotionEvent obtainNoHistory(android.view.MotionEvent); - Signature: (Landroid/view/MotionEvent;)Landroid/view/MotionEvent; - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 45: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 other Landroid/view/MotionEvent; - - -public final void recycle(); - Signature: ()V - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 46: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getDeviceId(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 47: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getSource(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 48: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final void setSource(int); - Signature: (I)V - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 49: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 source I - - -public final int getAction(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 50: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getActionMasked(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 51: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getActionIndex(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 52: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getFlags(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 53: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final long getDownTime(); - Signature: ()J - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 54: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final long getEventTime(); - Signature: ()J - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 55: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getX(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 56: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getY(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 57: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getPressure(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 58: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getSize(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 59: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getTouchMajor(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 60: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getTouchMinor(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 61: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getToolMajor(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 62: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getToolMinor(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 63: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getOrientation(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 64: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getAxisValue(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 65: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - - -public final int getPointerCount(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 66: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getPointerId(int); - Signature: (I)I - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 67: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final int getToolType(int); - Signature: (I)I - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 68: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final int findPointerIndex(int); - Signature: (I)I - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 69: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerId I - - -public final float getX(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 70: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getY(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 71: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getPressure(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 72: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getSize(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 73: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getTouchMajor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 74: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getTouchMinor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 75: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getToolMajor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 76: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getToolMinor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 77: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getOrientation(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 78: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - -public final float getAxisValue(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 79: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - 0 10 2 pointerIndex I - - -public final void getPointerCoords(int, android.view.MotionEvent$PointerCoords); - Signature: (ILandroid/view/MotionEvent$PointerCoords;)V - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 80: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 outPointerCoords Landroid/view/MotionEvent$PointerCoords; - - -public final void getPointerProperties(int, android.view.MotionEvent$PointerProperties); - Signature: (ILandroid/view/MotionEvent$PointerProperties;)V - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 81: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 outPointerProperties Landroid/view/MotionEvent$PointerProperties; - - -public final int getMetaState(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 82: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getButtonState(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 83: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getRawX(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 84: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getRawY(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 85: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getXPrecision(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 86: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final float getYPrecision(); - Signature: ()F - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 87: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final int getHistorySize(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 88: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final long getHistoricalEventTime(int); - Signature: (I)J - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 89: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalX(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 90: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalY(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 91: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalPressure(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 92: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalSize(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 93: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalTouchMajor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 94: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalTouchMinor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 95: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalToolMajor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 96: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalToolMinor(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 97: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalOrientation(int); - Signature: (I)F - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 98: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - -public final float getHistoricalAxisValue(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 99: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - 0 10 2 pos I - - -public final float getHistoricalX(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 100: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalY(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 101: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalPressure(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 102: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalSize(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 103: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalTouchMajor(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 104: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalTouchMinor(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 105: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalToolMajor(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 106: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalToolMinor(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 107: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalOrientation(int, int); - Signature: (II)F - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 108: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - -public final float getHistoricalAxisValue(int, int, int); - Signature: (III)F - Code: - Stack=3, Locals=4, Args_size=4 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 109: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - 0 10 2 pointerIndex I - 0 10 3 pos I - - -public final void getHistoricalPointerCoords(int, int, android.view.MotionEvent$PointerCoords); - Signature: (IILandroid/view/MotionEvent$PointerCoords;)V - Code: - Stack=3, Locals=4, Args_size=4 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 110: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - 0 10 3 outPointerCoords Landroid/view/MotionEvent$PointerCoords; - - -public final int getEdgeFlags(); - Signature: ()I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 111: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public final void setEdgeFlags(int); - Signature: (I)V - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 112: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 flags I - - -public final void setAction(int); - Signature: (I)V - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 113: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 action I - - -public final void offsetLocation(float, float); - Signature: (FF)V - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 114: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 deltaX F - 0 10 2 deltaY F - - -public final void setLocation(float, float); - Signature: (FF)V - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 115: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 x F - 0 10 2 y F - - -public final void transform(android.graphics.Matrix); - Signature: (Landroid/graphics/Matrix;)V - Code: - Stack=3, Locals=2, Args_size=2 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 116: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 matrix Landroid/graphics/Matrix; - - -public final void addBatch(long, float, float, float, float, int); - Signature: (JFFFFI)V - Code: - Stack=3, Locals=8, Args_size=7 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 117: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 eventTime J - 0 10 3 x F - 0 10 4 y F - 0 10 5 pressure F - 0 10 6 size F - 0 10 7 metaState I - - -public final void addBatch(long, android.view.MotionEvent$PointerCoords[], int); - Signature: (J[Landroid/view/MotionEvent$PointerCoords;I)V - Code: - Stack=3, Locals=5, Args_size=4 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 118: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 eventTime J - 0 10 3 pointerCoords [Landroid/view/MotionEvent$PointerCoords; - 0 10 4 metaState I - - -public java.lang.String toString(); - Signature: ()Ljava/lang/String; - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 119: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - -public static java.lang.String actionToString(int); - Signature: (I)Ljava/lang/String; - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 120: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 action I - - -public static java.lang.String axisToString(int); - Signature: (I)Ljava/lang/String; - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 121: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 axis I - - -public static int axisFromString(java.lang.String); - Signature: (Ljava/lang/String;)I - Code: - Stack=3, Locals=1, Args_size=1 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 122: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 symbolicName Ljava/lang/String; - - -public void writeToParcel(android.os.Parcel, int); - Signature: (Landroid/os/Parcel;I)V - Code: - Stack=3, Locals=3, Args_size=3 - 0: new #2; //class java/lang/RuntimeException - 3: dup - 4: ldc #3; //String Stub! - 6: invokespecial #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 123: 0 - - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 out Landroid/os/Parcel; - 0 10 2 flags I - - -static {}; - Signature: ()V - Code: - Stack=1, Locals=0, Args_size=0 - 0: aconst_null - 1: putstatic #5; //Field CREATOR:Landroid/os/Parcelable$Creator; - 4: return - LineNumberTable: - line 213: 0 - - -} - diff --git a/base/android/jni_generator/testMotionEvent.javap7 b/base/android/jni_generator/testMotionEvent.javap7 deleted file mode 100644 index f4f5444..0000000 --- a/base/android/jni_generator/testMotionEvent.javap7 +++ /dev/null @@ -1,2370 +0,0 @@ -Classfile out_android/Debug/gen/content/jni/android/view/MotionEvent.class - Last modified Feb 27, 2014; size 13369 bytes - MD5 checksum 3718d77a994cb8aceb7b35c5df3c4dd1 - Compiled from "MotionEvent.java" -public final class android.view.MotionEvent extends android.view.InputEvent implements android.os.Parcelable - SourceFile: "MotionEvent.java" - InnerClasses: - public static final #10= #9 of #6; //PointerProperties=class android/view/MotionEvent$PointerProperties of class android/view/MotionEvent - public static final #13= #12 of #6; //PointerCoords=class android/view/MotionEvent$PointerCoords of class android/view/MotionEvent - public static #150= #149 of #8; //Creator=class android/os/Parcelable$Creator of class android/os/Parcelable - minor version: 0 - major version: 49 - flags: ACC_PUBLIC, ACC_FINAL, ACC_SUPER -Constant pool: - #1 = Methodref #7.#293 // android/view/InputEvent."<init>":()V - #2 = Class #294 // java/lang/RuntimeException - #3 = String #295 // Stub! - #4 = Methodref #2.#296 // java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - #5 = Fieldref #6.#297 // android/view/MotionEvent.CREATOR:Landroid/os/Parcelable$Creator; - #6 = Class #298 // android/view/MotionEvent - #7 = Class #299 // android/view/InputEvent - #8 = Class #300 // android/os/Parcelable - #9 = Class #301 // android/view/MotionEvent$PointerProperties - #10 = Utf8 PointerProperties - #11 = Utf8 InnerClasses - #12 = Class #302 // android/view/MotionEvent$PointerCoords - #13 = Utf8 PointerCoords - #14 = Utf8 INVALID_POINTER_ID - #15 = Utf8 I - #16 = Utf8 ConstantValue - #17 = Integer -1 - #18 = Utf8 ACTION_MASK - #19 = Integer 255 - #20 = Utf8 ACTION_DOWN - #21 = Integer 0 - #22 = Utf8 ACTION_UP - #23 = Integer 1 - #24 = Utf8 ACTION_MOVE - #25 = Integer 2 - #26 = Utf8 ACTION_CANCEL - #27 = Integer 3 - #28 = Utf8 ACTION_OUTSIDE - #29 = Integer 4 - #30 = Utf8 ACTION_POINTER_DOWN - #31 = Integer 5 - #32 = Utf8 ACTION_POINTER_UP - #33 = Integer 6 - #34 = Utf8 ACTION_HOVER_MOVE - #35 = Integer 7 - #36 = Utf8 ACTION_SCROLL - #37 = Integer 8 - #38 = Utf8 ACTION_HOVER_ENTER - #39 = Integer 9 - #40 = Utf8 ACTION_HOVER_EXIT - #41 = Integer 10 - #42 = Utf8 ACTION_POINTER_INDEX_MASK - #43 = Integer 65280 - #44 = Utf8 ACTION_POINTER_INDEX_SHIFT - #45 = Utf8 ACTION_POINTER_1_DOWN - #46 = Utf8 Deprecated - #47 = Utf8 RuntimeVisibleAnnotations - #48 = Utf8 Ljava/lang/Deprecated; - #49 = Utf8 ACTION_POINTER_2_DOWN - #50 = Integer 261 - #51 = Utf8 ACTION_POINTER_3_DOWN - #52 = Integer 517 - #53 = Utf8 ACTION_POINTER_1_UP - #54 = Utf8 ACTION_POINTER_2_UP - #55 = Integer 262 - #56 = Utf8 ACTION_POINTER_3_UP - #57 = Integer 518 - #58 = Utf8 ACTION_POINTER_ID_MASK - #59 = Utf8 ACTION_POINTER_ID_SHIFT - #60 = Utf8 FLAG_WINDOW_IS_OBSCURED - #61 = Utf8 EDGE_TOP - #62 = Utf8 EDGE_BOTTOM - #63 = Utf8 EDGE_LEFT - #64 = Utf8 EDGE_RIGHT - #65 = Utf8 AXIS_X - #66 = Utf8 AXIS_Y - #67 = Utf8 AXIS_PRESSURE - #68 = Utf8 AXIS_SIZE - #69 = Utf8 AXIS_TOUCH_MAJOR - #70 = Utf8 AXIS_TOUCH_MINOR - #71 = Utf8 AXIS_TOOL_MAJOR - #72 = Utf8 AXIS_TOOL_MINOR - #73 = Utf8 AXIS_ORIENTATION - #74 = Utf8 AXIS_VSCROLL - #75 = Utf8 AXIS_HSCROLL - #76 = Utf8 AXIS_Z - #77 = Integer 11 - #78 = Utf8 AXIS_RX - #79 = Integer 12 - #80 = Utf8 AXIS_RY - #81 = Integer 13 - #82 = Utf8 AXIS_RZ - #83 = Integer 14 - #84 = Utf8 AXIS_HAT_X - #85 = Integer 15 - #86 = Utf8 AXIS_HAT_Y - #87 = Integer 16 - #88 = Utf8 AXIS_LTRIGGER - #89 = Integer 17 - #90 = Utf8 AXIS_RTRIGGER - #91 = Integer 18 - #92 = Utf8 AXIS_THROTTLE - #93 = Integer 19 - #94 = Utf8 AXIS_RUDDER - #95 = Integer 20 - #96 = Utf8 AXIS_WHEEL - #97 = Integer 21 - #98 = Utf8 AXIS_GAS - #99 = Integer 22 - #100 = Utf8 AXIS_BRAKE - #101 = Integer 23 - #102 = Utf8 AXIS_DISTANCE - #103 = Integer 24 - #104 = Utf8 AXIS_TILT - #105 = Integer 25 - #106 = Utf8 AXIS_GENERIC_1 - #107 = Integer 32 - #108 = Utf8 AXIS_GENERIC_2 - #109 = Integer 33 - #110 = Utf8 AXIS_GENERIC_3 - #111 = Integer 34 - #112 = Utf8 AXIS_GENERIC_4 - #113 = Integer 35 - #114 = Utf8 AXIS_GENERIC_5 - #115 = Integer 36 - #116 = Utf8 AXIS_GENERIC_6 - #117 = Integer 37 - #118 = Utf8 AXIS_GENERIC_7 - #119 = Integer 38 - #120 = Utf8 AXIS_GENERIC_8 - #121 = Integer 39 - #122 = Utf8 AXIS_GENERIC_9 - #123 = Integer 40 - #124 = Utf8 AXIS_GENERIC_10 - #125 = Integer 41 - #126 = Utf8 AXIS_GENERIC_11 - #127 = Integer 42 - #128 = Utf8 AXIS_GENERIC_12 - #129 = Integer 43 - #130 = Utf8 AXIS_GENERIC_13 - #131 = Integer 44 - #132 = Utf8 AXIS_GENERIC_14 - #133 = Integer 45 - #134 = Utf8 AXIS_GENERIC_15 - #135 = Integer 46 - #136 = Utf8 AXIS_GENERIC_16 - #137 = Integer 47 - #138 = Utf8 BUTTON_PRIMARY - #139 = Utf8 BUTTON_SECONDARY - #140 = Utf8 BUTTON_TERTIARY - #141 = Utf8 BUTTON_BACK - #142 = Utf8 BUTTON_FORWARD - #143 = Utf8 TOOL_TYPE_UNKNOWN - #144 = Utf8 TOOL_TYPE_FINGER - #145 = Utf8 TOOL_TYPE_STYLUS - #146 = Utf8 TOOL_TYPE_MOUSE - #147 = Utf8 TOOL_TYPE_ERASER - #148 = Utf8 CREATOR - #149 = Class #303 // android/os/Parcelable$Creator - #150 = Utf8 Creator - #151 = Utf8 Landroid/os/Parcelable$Creator; - #152 = Utf8 Signature - #153 = Utf8 Landroid/os/Parcelable$Creator<Landroid/view/MotionEvent;>; - #154 = Utf8 <init> - #155 = Utf8 ()V - #156 = Utf8 Code - #157 = Utf8 LineNumberTable - #158 = Utf8 LocalVariableTable - #159 = Utf8 this - #160 = Utf8 Landroid/view/MotionEvent; - #161 = Utf8 finalize - #162 = Utf8 Exceptions - #163 = Class #304 // java/lang/Throwable - #164 = Utf8 obtain - #165 = Utf8 (JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent; - #166 = Utf8 downTime - #167 = Utf8 J - #168 = Utf8 eventTime - #169 = Utf8 action - #170 = Utf8 pointerCount - #171 = Utf8 pointerProperties - #172 = Utf8 [Landroid/view/MotionEvent$PointerProperties; - #173 = Utf8 pointerCoords - #174 = Utf8 [Landroid/view/MotionEvent$PointerCoords; - #175 = Utf8 metaState - #176 = Utf8 buttonState - #177 = Utf8 xPrecision - #178 = Utf8 F - #179 = Utf8 yPrecision - #180 = Utf8 deviceId - #181 = Utf8 edgeFlags - #182 = Utf8 source - #183 = Utf8 flags - #184 = Utf8 (JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent; - #185 = Utf8 pointerIds - #186 = Utf8 [I - #187 = Utf8 (JJIFFFFIFFII)Landroid/view/MotionEvent; - #188 = Utf8 x - #189 = Utf8 y - #190 = Utf8 pressure - #191 = Utf8 size - #192 = Utf8 (JJIIFFFFIFFII)Landroid/view/MotionEvent; - #193 = Utf8 (JJIFFI)Landroid/view/MotionEvent; - #194 = Utf8 (Landroid/view/MotionEvent;)Landroid/view/MotionEvent; - #195 = Utf8 other - #196 = Utf8 obtainNoHistory - #197 = Utf8 recycle - #198 = Utf8 getDeviceId - #199 = Utf8 ()I - #200 = Utf8 getSource - #201 = Utf8 setSource - #202 = Utf8 (I)V - #203 = Utf8 getAction - #204 = Utf8 getActionMasked - #205 = Utf8 getActionIndex - #206 = Utf8 getFlags - #207 = Utf8 getDownTime - #208 = Utf8 ()J - #209 = Utf8 getEventTime - #210 = Utf8 getX - #211 = Utf8 ()F - #212 = Utf8 getY - #213 = Utf8 getPressure - #214 = Utf8 getSize - #215 = Utf8 getTouchMajor - #216 = Utf8 getTouchMinor - #217 = Utf8 getToolMajor - #218 = Utf8 getToolMinor - #219 = Utf8 getOrientation - #220 = Utf8 getAxisValue - #221 = Utf8 (I)F - #222 = Utf8 axis - #223 = Utf8 getPointerCount - #224 = Utf8 getPointerId - #225 = Utf8 (I)I - #226 = Utf8 pointerIndex - #227 = Utf8 getToolType - #228 = Utf8 findPointerIndex - #229 = Utf8 pointerId - #230 = Utf8 (II)F - #231 = Utf8 getPointerCoords - #232 = Utf8 (ILandroid/view/MotionEvent$PointerCoords;)V - #233 = Utf8 outPointerCoords - #234 = Utf8 Landroid/view/MotionEvent$PointerCoords; - #235 = Utf8 getPointerProperties - #236 = Utf8 (ILandroid/view/MotionEvent$PointerProperties;)V - #237 = Utf8 outPointerProperties - #238 = Utf8 Landroid/view/MotionEvent$PointerProperties; - #239 = Utf8 getMetaState - #240 = Utf8 getButtonState - #241 = Utf8 getRawX - #242 = Utf8 getRawY - #243 = Utf8 getXPrecision - #244 = Utf8 getYPrecision - #245 = Utf8 getHistorySize - #246 = Utf8 getHistoricalEventTime - #247 = Utf8 (I)J - #248 = Utf8 pos - #249 = Utf8 getHistoricalX - #250 = Utf8 getHistoricalY - #251 = Utf8 getHistoricalPressure - #252 = Utf8 getHistoricalSize - #253 = Utf8 getHistoricalTouchMajor - #254 = Utf8 getHistoricalTouchMinor - #255 = Utf8 getHistoricalToolMajor - #256 = Utf8 getHistoricalToolMinor - #257 = Utf8 getHistoricalOrientation - #258 = Utf8 getHistoricalAxisValue - #259 = Utf8 (III)F - #260 = Utf8 getHistoricalPointerCoords - #261 = Utf8 (IILandroid/view/MotionEvent$PointerCoords;)V - #262 = Utf8 getEdgeFlags - #263 = Utf8 setEdgeFlags - #264 = Utf8 setAction - #265 = Utf8 offsetLocation - #266 = Utf8 (FF)V - #267 = Utf8 deltaX - #268 = Utf8 deltaY - #269 = Utf8 setLocation - #270 = Utf8 transform - #271 = Utf8 (Landroid/graphics/Matrix;)V - #272 = Utf8 matrix - #273 = Utf8 Landroid/graphics/Matrix; - #274 = Utf8 addBatch - #275 = Utf8 (JFFFFI)V - #276 = Utf8 (J[Landroid/view/MotionEvent$PointerCoords;I)V - #277 = Utf8 toString - #278 = Utf8 ()Ljava/lang/String; - #279 = Utf8 actionToString - #280 = Utf8 (I)Ljava/lang/String; - #281 = Utf8 axisToString - #282 = Utf8 axisFromString - #283 = Utf8 (Ljava/lang/String;)I - #284 = Utf8 symbolicName - #285 = Utf8 Ljava/lang/String; - #286 = Utf8 writeToParcel - #287 = Utf8 (Landroid/os/Parcel;I)V - #288 = Utf8 out - #289 = Utf8 Landroid/os/Parcel; - #290 = Utf8 <clinit> - #291 = Utf8 SourceFile - #292 = Utf8 MotionEvent.java - #293 = NameAndType #154:#155 // "<init>":()V - #294 = Utf8 java/lang/RuntimeException - #295 = Utf8 Stub! - #296 = NameAndType #154:#305 // "<init>":(Ljava/lang/String;)V - #297 = NameAndType #148:#151 // CREATOR:Landroid/os/Parcelable$Creator; - #298 = Utf8 android/view/MotionEvent - #299 = Utf8 android/view/InputEvent - #300 = Utf8 android/os/Parcelable - #301 = Utf8 android/view/MotionEvent$PointerProperties - #302 = Utf8 android/view/MotionEvent$PointerCoords - #303 = Utf8 android/os/Parcelable$Creator - #304 = Utf8 java/lang/Throwable - #305 = Utf8 (Ljava/lang/String;)V -{ - public static final int INVALID_POINTER_ID; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int -1 - - - public static final int ACTION_MASK; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 255 - - - public static final int ACTION_DOWN; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 0 - - - public static final int ACTION_UP; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 1 - - - public static final int ACTION_MOVE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 2 - - - public static final int ACTION_CANCEL; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 3 - - - public static final int ACTION_OUTSIDE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 4 - - - public static final int ACTION_POINTER_DOWN; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 5 - - - public static final int ACTION_POINTER_UP; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 6 - - - public static final int ACTION_HOVER_MOVE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 7 - - - public static final int ACTION_SCROLL; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 8 - - - public static final int ACTION_HOVER_ENTER; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 9 - - - public static final int ACTION_HOVER_EXIT; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 10 - - - public static final int ACTION_POINTER_INDEX_MASK; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 65280 - - - public static final int ACTION_POINTER_INDEX_SHIFT; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 8 - - - public static final int ACTION_POINTER_1_DOWN; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 5 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_2_DOWN; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 261 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_3_DOWN; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 517 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_1_UP; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 6 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_2_UP; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 262 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_3_UP; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 518 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_ID_MASK; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 65280 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int ACTION_POINTER_ID_SHIFT; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 8 - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - - public static final int FLAG_WINDOW_IS_OBSCURED; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 1 - - - public static final int EDGE_TOP; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 1 - - - public static final int EDGE_BOTTOM; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 2 - - - public static final int EDGE_LEFT; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 4 - - - public static final int EDGE_RIGHT; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 8 - - - public static final int AXIS_X; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 0 - - - public static final int AXIS_Y; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 1 - - - public static final int AXIS_PRESSURE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 2 - - - public static final int AXIS_SIZE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 3 - - - public static final int AXIS_TOUCH_MAJOR; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 4 - - - public static final int AXIS_TOUCH_MINOR; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 5 - - - public static final int AXIS_TOOL_MAJOR; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 6 - - - public static final int AXIS_TOOL_MINOR; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 7 - - - public static final int AXIS_ORIENTATION; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 8 - - - public static final int AXIS_VSCROLL; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 9 - - - public static final int AXIS_HSCROLL; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 10 - - - public static final int AXIS_Z; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 11 - - - public static final int AXIS_RX; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 12 - - - public static final int AXIS_RY; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 13 - - - public static final int AXIS_RZ; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 14 - - - public static final int AXIS_HAT_X; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 15 - - - public static final int AXIS_HAT_Y; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 16 - - - public static final int AXIS_LTRIGGER; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 17 - - - public static final int AXIS_RTRIGGER; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 18 - - - public static final int AXIS_THROTTLE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 19 - - - public static final int AXIS_RUDDER; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 20 - - - public static final int AXIS_WHEEL; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 21 - - - public static final int AXIS_GAS; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 22 - - - public static final int AXIS_BRAKE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 23 - - - public static final int AXIS_DISTANCE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 24 - - - public static final int AXIS_TILT; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 25 - - - public static final int AXIS_GENERIC_1; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 32 - - - public static final int AXIS_GENERIC_2; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 33 - - - public static final int AXIS_GENERIC_3; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 34 - - - public static final int AXIS_GENERIC_4; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 35 - - - public static final int AXIS_GENERIC_5; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 36 - - - public static final int AXIS_GENERIC_6; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 37 - - - public static final int AXIS_GENERIC_7; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 38 - - - public static final int AXIS_GENERIC_8; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 39 - - - public static final int AXIS_GENERIC_9; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 40 - - - public static final int AXIS_GENERIC_10; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 41 - - - public static final int AXIS_GENERIC_11; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 42 - - - public static final int AXIS_GENERIC_12; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 43 - - - public static final int AXIS_GENERIC_13; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 44 - - - public static final int AXIS_GENERIC_14; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 45 - - - public static final int AXIS_GENERIC_15; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 46 - - - public static final int AXIS_GENERIC_16; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 47 - - - public static final int BUTTON_PRIMARY; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 1 - - - public static final int BUTTON_SECONDARY; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 2 - - - public static final int BUTTON_TERTIARY; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 4 - - - public static final int BUTTON_BACK; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 8 - - - public static final int BUTTON_FORWARD; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 16 - - - public static final int TOOL_TYPE_UNKNOWN; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 0 - - - public static final int TOOL_TYPE_FINGER; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 1 - - - public static final int TOOL_TYPE_STYLUS; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 2 - - - public static final int TOOL_TYPE_MOUSE; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 3 - - - public static final int TOOL_TYPE_ERASER; - Signature: I - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - ConstantValue: int 4 - - - public static final android.os.Parcelable$Creator<android.view.MotionEvent> CREATOR; - Signature: Landroid/os/Parcelable$Creator; - flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL - Signature: #153 // Landroid/os/Parcelable$Creator<Landroid/view/MotionEvent;>; - - - android.view.MotionEvent(); - Signature: ()V - flags: - Code: - stack=3, locals=1, args_size=1 - 0: aload_0 - 1: invokespecial #1 // Method android/view/InputEvent."<init>":()V - 4: new #2 // class java/lang/RuntimeException - 7: dup - 8: ldc #3 // String Stub! - 10: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 13: athrow - LineNumberTable: - line 35: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 14 0 this Landroid/view/MotionEvent; - - protected void finalize() throws java.lang.Throwable; - Signature: ()V - flags: ACC_PROTECTED - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 36: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - Exceptions: - throws java.lang.Throwable - - public static android.view.MotionEvent obtain(long, long, int, int, android.view.MotionEvent$PointerProperties[], android.view.MotionEvent$PointerCoords[], int, int, float, float, int, int, int, int); - Signature: (JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=16, args_size=14 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 37: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 pointerCount I - 0 10 6 pointerProperties [Landroid/view/MotionEvent$PointerProperties; - 0 10 7 pointerCoords [Landroid/view/MotionEvent$PointerCoords; - 0 10 8 metaState I - 0 10 9 buttonState I - 0 10 10 xPrecision F - 0 10 11 yPrecision F - 0 10 12 deviceId I - 0 10 13 edgeFlags I - 0 10 14 source I - 0 10 15 flags I - - public static android.view.MotionEvent obtain(long, long, int, int, int[], android.view.MotionEvent$PointerCoords[], int, float, float, int, int, int, int); - Signature: (JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=15, args_size=13 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 39: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 pointerCount I - 0 10 6 pointerIds [I - 0 10 7 pointerCoords [Landroid/view/MotionEvent$PointerCoords; - 0 10 8 metaState I - 0 10 9 xPrecision F - 0 10 10 yPrecision F - 0 10 11 deviceId I - 0 10 12 edgeFlags I - 0 10 13 source I - 0 10 14 flags I - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - public static android.view.MotionEvent obtain(long, long, int, float, float, float, float, int, float, float, int, int); - Signature: (JJIFFFFIFFII)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=14, args_size=12 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 40: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 x F - 0 10 6 y F - 0 10 7 pressure F - 0 10 8 size F - 0 10 9 metaState I - 0 10 10 xPrecision F - 0 10 11 yPrecision F - 0 10 12 deviceId I - 0 10 13 edgeFlags I - - public static android.view.MotionEvent obtain(long, long, int, int, float, float, float, float, int, float, float, int, int); - Signature: (JJIIFFFFIFFII)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=15, args_size=13 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 42: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 pointerCount I - 0 10 6 x F - 0 10 7 y F - 0 10 8 pressure F - 0 10 9 size F - 0 10 10 metaState I - 0 10 11 xPrecision F - 0 10 12 yPrecision F - 0 10 13 deviceId I - 0 10 14 edgeFlags I - Deprecated: true - RuntimeVisibleAnnotations: - 0: #48() - - public static android.view.MotionEvent obtain(long, long, int, float, float, int); - Signature: (JJIFFI)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=8, args_size=6 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 43: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 downTime J - 0 10 2 eventTime J - 0 10 4 action I - 0 10 5 x F - 0 10 6 y F - 0 10 7 metaState I - - public static android.view.MotionEvent obtain(android.view.MotionEvent); - Signature: (Landroid/view/MotionEvent;)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 44: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 other Landroid/view/MotionEvent; - - public static android.view.MotionEvent obtainNoHistory(android.view.MotionEvent); - Signature: (Landroid/view/MotionEvent;)Landroid/view/MotionEvent; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 45: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 other Landroid/view/MotionEvent; - - public final void recycle(); - Signature: ()V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 46: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getDeviceId(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 47: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getSource(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 48: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final void setSource(int); - Signature: (I)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 49: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 source I - - public final int getAction(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 50: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getActionMasked(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 51: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getActionIndex(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 52: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getFlags(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 53: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final long getDownTime(); - Signature: ()J - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 54: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final long getEventTime(); - Signature: ()J - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 55: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getX(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 56: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getY(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 57: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getPressure(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 58: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getSize(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 59: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getTouchMajor(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 60: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getTouchMinor(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 61: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getToolMajor(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 62: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getToolMinor(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 63: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getOrientation(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 64: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getAxisValue(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 65: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - - public final int getPointerCount(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 66: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getPointerId(int); - Signature: (I)I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 67: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final int getToolType(int); - Signature: (I)I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 68: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final int findPointerIndex(int); - Signature: (I)I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 69: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerId I - - public final float getX(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 70: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getY(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 71: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getPressure(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 72: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getSize(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 73: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getTouchMajor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 74: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getTouchMinor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 75: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getToolMajor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 76: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getToolMinor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 77: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getOrientation(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 78: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - - public final float getAxisValue(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 79: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - 0 10 2 pointerIndex I - - public final void getPointerCoords(int, android.view.MotionEvent$PointerCoords); - Signature: (ILandroid/view/MotionEvent$PointerCoords;)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 80: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 outPointerCoords Landroid/view/MotionEvent$PointerCoords; - - public final void getPointerProperties(int, android.view.MotionEvent$PointerProperties); - Signature: (ILandroid/view/MotionEvent$PointerProperties;)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 81: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 outPointerProperties Landroid/view/MotionEvent$PointerProperties; - - public final int getMetaState(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 82: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getButtonState(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 83: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getRawX(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 84: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getRawY(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 85: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getXPrecision(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 86: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final float getYPrecision(); - Signature: ()F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 87: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final int getHistorySize(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 88: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final long getHistoricalEventTime(int); - Signature: (I)J - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 89: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalX(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 90: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalY(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 91: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalPressure(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 92: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalSize(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 93: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalTouchMajor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 94: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalTouchMinor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 95: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalToolMajor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 96: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalToolMinor(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 97: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalOrientation(int); - Signature: (I)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 98: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pos I - - public final float getHistoricalAxisValue(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 99: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - 0 10 2 pos I - - public final float getHistoricalX(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 100: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalY(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 101: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalPressure(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 102: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalSize(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 103: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalTouchMajor(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 104: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalTouchMinor(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 105: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalToolMajor(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 106: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalToolMinor(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 107: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalOrientation(int, int); - Signature: (II)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 108: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - - public final float getHistoricalAxisValue(int, int, int); - Signature: (III)F - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=4, args_size=4 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 109: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 axis I - 0 10 2 pointerIndex I - 0 10 3 pos I - - public final void getHistoricalPointerCoords(int, int, android.view.MotionEvent$PointerCoords); - Signature: (IILandroid/view/MotionEvent$PointerCoords;)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=4, args_size=4 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 110: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 pointerIndex I - 0 10 2 pos I - 0 10 3 outPointerCoords Landroid/view/MotionEvent$PointerCoords; - - public final int getEdgeFlags(); - Signature: ()I - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 111: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public final void setEdgeFlags(int); - Signature: (I)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 112: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 flags I - - public final void setAction(int); - Signature: (I)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 113: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 action I - - public final void offsetLocation(float, float); - Signature: (FF)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 114: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 deltaX F - 0 10 2 deltaY F - - public final void setLocation(float, float); - Signature: (FF)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 115: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 x F - 0 10 2 y F - - public final void transform(android.graphics.Matrix); - Signature: (Landroid/graphics/Matrix;)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=2, args_size=2 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 116: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 matrix Landroid/graphics/Matrix; - - public final void addBatch(long, float, float, float, float, int); - Signature: (JFFFFI)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=8, args_size=7 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 117: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 eventTime J - 0 10 3 x F - 0 10 4 y F - 0 10 5 pressure F - 0 10 6 size F - 0 10 7 metaState I - - public final void addBatch(long, android.view.MotionEvent$PointerCoords[], int); - Signature: (J[Landroid/view/MotionEvent$PointerCoords;I)V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=3, locals=5, args_size=4 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 118: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 eventTime J - 0 10 3 pointerCoords [Landroid/view/MotionEvent$PointerCoords; - 0 10 4 metaState I - - public java.lang.String toString(); - Signature: ()Ljava/lang/String; - flags: ACC_PUBLIC - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 119: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - - public static java.lang.String actionToString(int); - Signature: (I)Ljava/lang/String; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 120: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 action I - - public static java.lang.String axisToString(int); - Signature: (I)Ljava/lang/String; - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 121: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 axis I - - public static int axisFromString(java.lang.String); - Signature: (Ljava/lang/String;)I - flags: ACC_PUBLIC, ACC_STATIC - Code: - stack=3, locals=1, args_size=1 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 122: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 symbolicName Ljava/lang/String; - - public void writeToParcel(android.os.Parcel, int); - Signature: (Landroid/os/Parcel;I)V - flags: ACC_PUBLIC - Code: - stack=3, locals=3, args_size=3 - 0: new #2 // class java/lang/RuntimeException - 3: dup - 4: ldc #3 // String Stub! - 6: invokespecial #4 // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V - 9: athrow - LineNumberTable: - line 123: 0 - LocalVariableTable: - Start Length Slot Name Signature - 0 10 0 this Landroid/view/MotionEvent; - 0 10 1 out Landroid/os/Parcel; - 0 10 2 flags I - - static {}; - Signature: ()V - flags: ACC_STATIC - Code: - stack=1, locals=0, args_size=0 - 0: aconst_null - 1: putstatic #5 // Field CREATOR:Landroid/os/Parcelable$Creator; - 4: return - LineNumberTable: - line 213: 0 -} diff --git a/base/android/jni_generator/testMultipleJNIAdditionalImport.golden b/base/android/jni_generator/testMultipleJNIAdditionalImport.golden deleted file mode 100644 index 0eecb5a..0000000 --- a/base/android/jni_generator/testMultipleJNIAdditionalImport.golden +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/foo/Foo - -#ifndef org_chromium_foo_Foo_JNI -#define org_chromium_foo_Foo_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kFooClassPath[] = "org/chromium/foo/Foo"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_Foo_clazz __attribute__((unused)) = 0; -#define Foo_clazz(env) base::android::LazyGetClass(env, kFooClassPath, &g_Foo_clazz) - -} // namespace - -// Step 2: method stubs. - -static void DoSomething(JNIEnv* env, const base::android::JavaParamRef<jclass>& - jcaller, - const base::android::JavaParamRef<jobject>& callback1, - const base::android::JavaParamRef<jobject>& callback2); - -JNI_GENERATOR_EXPORT void Java_org_chromium_foo_Foo_nativeDoSomething(JNIEnv* - env, jclass jcaller, - jobject callback1, - jobject callback2) { - return DoSomething(env, base::android::JavaParamRef<jclass>(env, jcaller), - base::android::JavaParamRef<jobject>(env, callback1), - base::android::JavaParamRef<jobject>(env, callback2)); -} - -static base::subtle::AtomicWord g_Foo_calledByNative = 0; -static void Java_Foo_calledByNative(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& callback1, - const base::android::JavaRefOrBare<jobject>& callback2) { - CHECK_CLAZZ(env, Foo_clazz(env), - Foo_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, Foo_clazz(env), - "calledByNative", -"(" -"Lorg/chromium/foo/Bar1$Callback;" -"Lorg/chromium/foo/Bar2$Callback;" -")" -"V", - &g_Foo_calledByNative); - - env->CallStaticVoidMethod(Foo_clazz(env), - method_id, callback1.obj(), callback2.obj()); - jni_generator::CheckException(env); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsFoo[] = { - { "nativeDoSomething", -"(" -"Lorg/chromium/foo/Bar1$Callback;" -"Lorg/chromium/foo/Bar2$Callback;" -")" -"V", reinterpret_cast<void*>(Java_org_chromium_foo_Foo_nativeDoSomething) }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsFooSize = arraysize(kMethodsFoo); - - if (env->RegisterNatives(Foo_clazz(env), - kMethodsFoo, - kMethodsFooSize) < 0) { - jni_generator::HandleRegistrationError( - env, Foo_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_foo_Foo_JNI diff --git a/base/android/jni_generator/testNatives.golden b/base/android/jni_generator/testNatives.golden deleted file mode 100644 index 3362c92..0000000 --- a/base/android/jni_generator/testNatives.golden +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/TestJni - -#ifndef org_chromium_TestJni_JNI -#define org_chromium_TestJni_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kTestJniClassPath[] = "org/chromium/TestJni"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; -#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) - -} // namespace - -// Step 2: method stubs. - -static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller); - -JNI_GENERATOR_EXPORT jint Java_org_chromium_TestJni_nativeInit(JNIEnv* env, - jobject jcaller) { - return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); -} - -JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeDestroy(JNIEnv* env, - jobject jcaller, - jint nativeChromeBrowserProvider) { - ChromeBrowserProvider* native = - reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider); - CHECK_NATIVE_PTR(env, jcaller, native, "Destroy"); - return native->Destroy(env, base::android::JavaParamRef<jobject>(env, - jcaller)); -} - -JNI_GENERATOR_EXPORT jlong Java_org_chromium_TestJni_nativeAddBookmark(JNIEnv* - env, jobject jcaller, - jint nativeChromeBrowserProvider, - jstring url, - jstring title, - jboolean isFolder, - jlong parentId) { - ChromeBrowserProvider* native = - reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider); - CHECK_NATIVE_PTR(env, jcaller, native, "AddBookmark", 0); - return native->AddBookmark(env, base::android::JavaParamRef<jobject>(env, - jcaller), base::android::JavaParamRef<jstring>(env, url), - base::android::JavaParamRef<jstring>(env, title), isFolder, parentId); -} - -static base::android::ScopedJavaLocalRef<jstring> GetDomainAndRegistry(JNIEnv* - env, const base::android::JavaParamRef<jclass>& jcaller, - const base::android::JavaParamRef<jstring>& url); - -JNI_GENERATOR_EXPORT jstring - Java_org_chromium_TestJni_nativeGetDomainAndRegistry(JNIEnv* env, jclass - jcaller, - jstring url) { - return GetDomainAndRegistry(env, base::android::JavaParamRef<jclass>(env, - jcaller), base::android::JavaParamRef<jstring>(env, url)).Release(); -} - -static void CreateHistoricalTabFromState(JNIEnv* env, const - base::android::JavaParamRef<jclass>& jcaller, - const base::android::JavaParamRef<jbyteArray>& state, - jint tab_index); - -JNI_GENERATOR_EXPORT void - Java_org_chromium_TestJni_nativeCreateHistoricalTabFromState(JNIEnv* env, - jclass jcaller, - jbyteArray state, - jint tab_index) { - return CreateHistoricalTabFromState(env, - base::android::JavaParamRef<jclass>(env, jcaller), - base::android::JavaParamRef<jbyteArray>(env, state), tab_index); -} - -static base::android::ScopedJavaLocalRef<jbyteArray> GetStateAsByteArray(JNIEnv* - env, const base::android::JavaParamRef<jobject>& jcaller, - const base::android::JavaParamRef<jobject>& view); - -JNI_GENERATOR_EXPORT jbyteArray - Java_org_chromium_TestJni_nativeGetStateAsByteArray(JNIEnv* env, jobject - jcaller, - jobject view) { - return GetStateAsByteArray(env, base::android::JavaParamRef<jobject>(env, - jcaller), base::android::JavaParamRef<jobject>(env, view)).Release(); -} - -static base::android::ScopedJavaLocalRef<jobjectArray> - GetAutofillProfileGUIDs(JNIEnv* env, const - base::android::JavaParamRef<jclass>& jcaller); - -JNI_GENERATOR_EXPORT jobjectArray - Java_org_chromium_TestJni_nativeGetAutofillProfileGUIDs(JNIEnv* env, jclass - jcaller) { - return GetAutofillProfileGUIDs(env, base::android::JavaParamRef<jclass>(env, - jcaller)).Release(); -} - -static void SetRecognitionResults(JNIEnv* env, const - base::android::JavaParamRef<jobject>& jcaller, - jint sessionId, - const base::android::JavaParamRef<jobjectArray>& results); - -JNI_GENERATOR_EXPORT void - Java_org_chromium_TestJni_nativeSetRecognitionResults(JNIEnv* env, jobject - jcaller, - jint sessionId, - jobjectArray results) { - return SetRecognitionResults(env, base::android::JavaParamRef<jobject>(env, - jcaller), sessionId, base::android::JavaParamRef<jobjectArray>(env, - results)); -} - -JNI_GENERATOR_EXPORT jlong - Java_org_chromium_TestJni_nativeAddBookmarkFromAPI(JNIEnv* env, jobject - jcaller, - jint nativeChromeBrowserProvider, - jstring url, - jobject created, - jobject isBookmark, - jobject date, - jbyteArray favicon, - jstring title, - jobject visits) { - ChromeBrowserProvider* native = - reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider); - CHECK_NATIVE_PTR(env, jcaller, native, "AddBookmarkFromAPI", 0); - return native->AddBookmarkFromAPI(env, - base::android::JavaParamRef<jobject>(env, jcaller), - base::android::JavaParamRef<jstring>(env, url), - base::android::JavaParamRef<jobject>(env, created), - base::android::JavaParamRef<jobject>(env, isBookmark), - base::android::JavaParamRef<jobject>(env, date), - base::android::JavaParamRef<jbyteArray>(env, favicon), - base::android::JavaParamRef<jstring>(env, title), - base::android::JavaParamRef<jobject>(env, visits)); -} - -static jint FindAll(JNIEnv* env, const base::android::JavaParamRef<jobject>& - jcaller, - const base::android::JavaParamRef<jstring>& find); - -JNI_GENERATOR_EXPORT jint Java_org_chromium_TestJni_nativeFindAll(JNIEnv* env, - jobject jcaller, - jstring find) { - return FindAll(env, base::android::JavaParamRef<jobject>(env, jcaller), - base::android::JavaParamRef<jstring>(env, find)); -} - -static base::android::ScopedJavaLocalRef<jobject> GetInnerClass(JNIEnv* env, - const base::android::JavaParamRef<jclass>& jcaller); - -JNI_GENERATOR_EXPORT jobject - Java_org_chromium_TestJni_nativeGetInnerClass(JNIEnv* env, jclass jcaller) { - return GetInnerClass(env, base::android::JavaParamRef<jclass>(env, - jcaller)).Release(); -} - -JNI_GENERATOR_EXPORT jobject Java_org_chromium_TestJni_nativeQueryBitmap(JNIEnv* - env, jobject jcaller, - jint nativeChromeBrowserProvider, - jobjectArray projection, - jstring selection, - jobjectArray selectionArgs, - jstring sortOrder) { - ChromeBrowserProvider* native = - reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider); - CHECK_NATIVE_PTR(env, jcaller, native, "QueryBitmap", NULL); - return native->QueryBitmap(env, base::android::JavaParamRef<jobject>(env, - jcaller), base::android::JavaParamRef<jobjectArray>(env, projection), - base::android::JavaParamRef<jstring>(env, selection), - base::android::JavaParamRef<jobjectArray>(env, selectionArgs), - base::android::JavaParamRef<jstring>(env, sortOrder)).Release(); -} - -JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeGotOrientation(JNIEnv* - env, jobject jcaller, - jint nativeDataFetcherImplAndroid, - jdouble alpha, - jdouble beta, - jdouble gamma) { - DataFetcherImplAndroid* native = - reinterpret_cast<DataFetcherImplAndroid*>(nativeDataFetcherImplAndroid); - CHECK_NATIVE_PTR(env, jcaller, native, "GotOrientation"); - return native->GotOrientation(env, base::android::JavaParamRef<jobject>(env, - jcaller), alpha, beta, gamma); -} - -static base::android::ScopedJavaLocalRef<jthrowable> - MessWithJavaException(JNIEnv* env, const - base::android::JavaParamRef<jclass>& jcaller, - const base::android::JavaParamRef<jthrowable>& e); - -JNI_GENERATOR_EXPORT jthrowable - Java_org_chromium_TestJni_nativeMessWithJavaException(JNIEnv* env, jclass - jcaller, - jthrowable e) { - return MessWithJavaException(env, base::android::JavaParamRef<jclass>(env, - jcaller), base::android::JavaParamRef<jthrowable>(env, e)).Release(); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsTestJni[] = { - { "nativeInit", -"(" -")" -"I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeInit) }, - { "nativeDestroy", -"(" -"I" -")" -"V", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeDestroy) }, - { "nativeAddBookmark", -"(" -"I" -"Ljava/lang/String;" -"Ljava/lang/String;" -"Z" -"J" -")" -"J", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeAddBookmark) }, - { "nativeGetDomainAndRegistry", -"(" -"Ljava/lang/String;" -")" -"Ljava/lang/String;", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetDomainAndRegistry) - }, - { "nativeCreateHistoricalTabFromState", -"(" -"[B" -"I" -")" -"V", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeCreateHistoricalTabFromState) - }, - { "nativeGetStateAsByteArray", -"(" -"Landroid/view/View;" -")" -"[B", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetStateAsByteArray) - }, - { "nativeGetAutofillProfileGUIDs", -"(" -")" -"[Ljava/lang/String;", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetAutofillProfileGUIDs) - }, - { "nativeSetRecognitionResults", -"(" -"I" -"[Ljava/lang/String;" -")" -"V", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeSetRecognitionResults) - }, - { "nativeAddBookmarkFromAPI", -"(" -"I" -"Ljava/lang/String;" -"Ljava/lang/Long;" -"Ljava/lang/Boolean;" -"Ljava/lang/Long;" -"[B" -"Ljava/lang/String;" -"Ljava/lang/Integer;" -")" -"J", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeAddBookmarkFromAPI) - }, - { "nativeFindAll", -"(" -"Ljava/lang/String;" -")" -"I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeFindAll) }, - { "nativeGetInnerClass", -"(" -")" -"Lorg/chromium/example/jni_generator/SampleForTests$OnFrameAvailableListener;", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetInnerClass) }, - { "nativeQueryBitmap", -"(" -"I" -"[Ljava/lang/String;" -"Ljava/lang/String;" -"[Ljava/lang/String;" -"Ljava/lang/String;" -")" -"Landroid/graphics/Bitmap;", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeQueryBitmap) }, - { "nativeGotOrientation", -"(" -"I" -"D" -"D" -"D" -")" -"V", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGotOrientation) }, - { "nativeMessWithJavaException", -"(" -"Ljava/lang/Throwable;" -")" -"Ljava/lang/Throwable;", - reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeMessWithJavaException) - }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsTestJniSize = arraysize(kMethodsTestJni); - - if (env->RegisterNatives(TestJni_clazz(env), - kMethodsTestJni, - kMethodsTestJniSize) < 0) { - jni_generator::HandleRegistrationError( - env, TestJni_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_TestJni_JNI diff --git a/base/android/jni_generator/testNativesLong.golden b/base/android/jni_generator/testNativesLong.golden deleted file mode 100644 index ec029ce..0000000 --- a/base/android/jni_generator/testNativesLong.golden +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/TestJni - -#ifndef org_chromium_TestJni_JNI -#define org_chromium_TestJni_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kTestJniClassPath[] = "org/chromium/TestJni"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_TestJni_clazz __attribute__((unused)) = 0; -#define TestJni_clazz(env) base::android::LazyGetClass(env, kTestJniClassPath, &g_TestJni_clazz) - -} // namespace - -// Step 2: method stubs. -JNI_GENERATOR_EXPORT void Java_org_chromium_TestJni_nativeDestroy(JNIEnv* env, - jobject jcaller, - jlong nativeChromeBrowserProvider) { - ChromeBrowserProvider* native = - reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider); - CHECK_NATIVE_PTR(env, jcaller, native, "Destroy"); - return native->Destroy(env, base::android::JavaParamRef<jobject>(env, - jcaller)); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsTestJni[] = { - { "nativeDestroy", -"(" -"J" -")" -"V", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeDestroy) }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsTestJniSize = arraysize(kMethodsTestJni); - - if (env->RegisterNatives(TestJni_clazz(env), - kMethodsTestJni, - kMethodsTestJniSize) < 0) { - jni_generator::HandleRegistrationError( - env, TestJni_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_TestJni_JNI diff --git a/base/android/jni_generator/testSingleJNIAdditionalImport.golden b/base/android/jni_generator/testSingleJNIAdditionalImport.golden deleted file mode 100644 index ef618da..0000000 --- a/base/android/jni_generator/testSingleJNIAdditionalImport.golden +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is autogenerated by -// base/android/jni_generator/jni_generator.py -// For -// org/chromium/foo/Foo - -#ifndef org_chromium_foo_Foo_JNI -#define org_chromium_foo_Foo_JNI - -#include <jni.h> - -#include "base/android/jni_generator/jni_generator_helper.h" - -#include "base/android/jni_int_wrapper.h" - -// Step 1: forward declarations. -namespace { -const char kFooClassPath[] = "org/chromium/foo/Foo"; -// Leaking this jclass as we cannot use LazyInstance from some threads. -base::subtle::AtomicWord g_Foo_clazz __attribute__((unused)) = 0; -#define Foo_clazz(env) base::android::LazyGetClass(env, kFooClassPath, &g_Foo_clazz) - -} // namespace - -// Step 2: method stubs. - -static void DoSomething(JNIEnv* env, const base::android::JavaParamRef<jclass>& - jcaller, - const base::android::JavaParamRef<jobject>& callback); - -JNI_GENERATOR_EXPORT void Java_org_chromium_foo_Foo_nativeDoSomething(JNIEnv* - env, jclass jcaller, - jobject callback) { - return DoSomething(env, base::android::JavaParamRef<jclass>(env, jcaller), - base::android::JavaParamRef<jobject>(env, callback)); -} - -static base::subtle::AtomicWord g_Foo_calledByNative = 0; -static void Java_Foo_calledByNative(JNIEnv* env, const - base::android::JavaRefOrBare<jobject>& callback) { - CHECK_CLAZZ(env, Foo_clazz(env), - Foo_clazz(env)); - jmethodID method_id = - base::android::MethodID::LazyGet< - base::android::MethodID::TYPE_STATIC>( - env, Foo_clazz(env), - "calledByNative", -"(" -"Lorg/chromium/foo/Bar$Callback;" -")" -"V", - &g_Foo_calledByNative); - - env->CallStaticVoidMethod(Foo_clazz(env), - method_id, callback.obj()); - jni_generator::CheckException(env); -} - -// Step 3: RegisterNatives. - -static const JNINativeMethod kMethodsFoo[] = { - { "nativeDoSomething", -"(" -"Lorg/chromium/foo/Bar$Callback;" -")" -"V", reinterpret_cast<void*>(Java_org_chromium_foo_Foo_nativeDoSomething) }, -}; - -static bool RegisterNativesImpl(JNIEnv* env) { - if (jni_generator::ShouldSkipJniRegistration(false)) - return true; - - const int kMethodsFooSize = arraysize(kMethodsFoo); - - if (env->RegisterNatives(Foo_clazz(env), - kMethodsFoo, - kMethodsFooSize) < 0) { - jni_generator::HandleRegistrationError( - env, Foo_clazz(env), __FILE__); - return false; - } - - return true; -} - -#endif // org_chromium_foo_Foo_JNI diff --git a/base/android/jni_int_wrapper.h b/base/android/jni_int_wrapper.h deleted file mode 100644 index fa0f3d5..0000000 --- a/base/android/jni_int_wrapper.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_JNI_INT_WRAPPER_H_ -#define BASE_ANDROID_JNI_INT_WRAPPER_H_ - -// Wrapper used to receive int when calling Java from native. -// The wrapper disallows automatic conversion of long to int. -// This is to avoid a common anti-pattern where a Java int is used -// to receive a native pointer. Please use a Java long to receive -// native pointers, so that the code works on both 32-bit and 64-bit -// platforms. Note the wrapper allows other lossy conversions into -// jint that could be consider anti-patterns, such as from size_t. - -// Checking is only done in debugging builds. - -#ifdef NDEBUG - -typedef jint JniIntWrapper; - -// This inline is sufficiently trivial that it does not change the -// final code generated by g++. -inline jint as_jint(JniIntWrapper wrapper) { - return wrapper; -} - -#else - -class JniIntWrapper { - public: - JniIntWrapper() : i_(0) {} - JniIntWrapper(int i) : i_(i) {} - JniIntWrapper(const JniIntWrapper& ji) : i_(ji.i_) {} - template <class T> JniIntWrapper(const T& t) : i_(t) {} - jint as_jint() const { return i_; } - private: - // If you get an "is private" error at the line below it is because you used - // an implicit conversion to convert a long to an int when calling Java. - // We disallow this, as a common anti-pattern allows converting a native - // pointer (intptr_t) to a Java int. Please use a Java long to represent - // a native pointer. If you want a lossy conversion, please use an - // explicit conversion in your C++ code. Note an error is only seen when - // compiling on a 64-bit platform, as intptr_t is indistinguishable from - // int on 32-bit platforms. - JniIntWrapper(long); - jint i_; -}; - -inline jint as_jint(const JniIntWrapper& wrapper) { - return wrapper.as_jint(); -} - -#endif // NDEBUG - -#endif // BASE_ANDROID_JNI_INT_WRAPPER_H_ diff --git a/base/android/jni_string.cc b/base/android/jni_string.cc deleted file mode 100644 index f28f649..0000000 --- a/base/android/jni_string.cc +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/jni_string.h" - -#include "base/android/jni_android.h" -#include "base/logging.h" -#include "base/strings/utf_string_conversions.h" - -namespace { - -// Internal version that does not use a scoped local pointer. -jstring ConvertUTF16ToJavaStringImpl(JNIEnv* env, - const base::StringPiece16& str) { - jstring result = env->NewString(str.data(), str.length()); - base::android::CheckException(env); - return result; -} - -} // namespace - -namespace base { -namespace android { - -void ConvertJavaStringToUTF8(JNIEnv* env, jstring str, std::string* result) { - DCHECK(str); - if (!str) { - LOG(WARNING) << "ConvertJavaStringToUTF8 called with null string."; - result->clear(); - return; - } - const jsize length = env->GetStringLength(str); - if (!length) { - result->clear(); - CheckException(env); - return; - } - // JNI's GetStringUTFChars() returns strings in Java "modified" UTF8, so - // instead get the String in UTF16 and convert using chromium's conversion - // function that yields plain (non Java-modified) UTF8. - const jchar* chars = env->GetStringChars(str, NULL); - DCHECK(chars); - UTF16ToUTF8(chars, length, result); - env->ReleaseStringChars(str, chars); - CheckException(env); -} - -std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str) { - std::string result; - ConvertJavaStringToUTF8(env, str, &result); - return result; -} - -std::string ConvertJavaStringToUTF8(const JavaRef<jstring>& str) { - return ConvertJavaStringToUTF8(AttachCurrentThread(), str.obj()); -} - -std::string ConvertJavaStringToUTF8(JNIEnv* env, const JavaRef<jstring>& str) { - return ConvertJavaStringToUTF8(env, str.obj()); -} - -ScopedJavaLocalRef<jstring> ConvertUTF8ToJavaString( - JNIEnv* env, - const base::StringPiece& str) { - // JNI's NewStringUTF expects "modified" UTF8 so instead create the string - // via our own UTF16 conversion utility. - // Further, Dalvik requires the string passed into NewStringUTF() to come from - // a trusted source. We can't guarantee that all UTF8 will be sanitized before - // it gets here, so constructing via UTF16 side-steps this issue. - // (Dalvik stores strings internally as UTF16 anyway, so there shouldn't be - // a significant performance hit by doing it this way). - return ScopedJavaLocalRef<jstring>(env, ConvertUTF16ToJavaStringImpl( - env, UTF8ToUTF16(str))); -} - -void ConvertJavaStringToUTF16(JNIEnv* env, jstring str, string16* result) { - DCHECK(str); - if (!str) { - LOG(WARNING) << "ConvertJavaStringToUTF16 called with null string."; - result->clear(); - return; - } - const jsize length = env->GetStringLength(str); - if (!length) { - result->clear(); - CheckException(env); - return; - } - const jchar* chars = env->GetStringChars(str, NULL); - DCHECK(chars); - // GetStringChars isn't required to NULL-terminate the strings - // it returns, so the length must be explicitly checked. - result->assign(chars, length); - env->ReleaseStringChars(str, chars); - CheckException(env); -} - -string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str) { - string16 result; - ConvertJavaStringToUTF16(env, str, &result); - return result; -} - -string16 ConvertJavaStringToUTF16(const JavaRef<jstring>& str) { - return ConvertJavaStringToUTF16(AttachCurrentThread(), str.obj()); -} - -string16 ConvertJavaStringToUTF16(JNIEnv* env, const JavaRef<jstring>& str) { - return ConvertJavaStringToUTF16(env, str.obj()); -} - -ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString( - JNIEnv* env, - const base::StringPiece16& str) { - return ScopedJavaLocalRef<jstring>(env, - ConvertUTF16ToJavaStringImpl(env, str)); -} - -} // namespace android -} // namespace base diff --git a/base/android/jni_string.h b/base/android/jni_string.h deleted file mode 100644 index 09e85f3..0000000 --- a/base/android/jni_string.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_JNI_STRING_H_ -#define BASE_ANDROID_JNI_STRING_H_ - -#include <jni.h> -#include <string> - -#include "base/android/scoped_java_ref.h" -#include "base/base_export.h" -#include "base/strings/string_piece.h" - -namespace base { -namespace android { - -// Convert a Java string to UTF8. Returns a std string. -BASE_EXPORT void ConvertJavaStringToUTF8(JNIEnv* env, - jstring str, - std::string* result); -BASE_EXPORT std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str); -BASE_EXPORT std::string ConvertJavaStringToUTF8(const JavaRef<jstring>& str); -BASE_EXPORT std::string ConvertJavaStringToUTF8(JNIEnv* env, - const JavaRef<jstring>& str); - -// Convert a std string to Java string. -BASE_EXPORT ScopedJavaLocalRef<jstring> ConvertUTF8ToJavaString( - JNIEnv* env, - const base::StringPiece& str); - -// Convert a Java string to UTF16. Returns a string16. -BASE_EXPORT void ConvertJavaStringToUTF16(JNIEnv* env, - jstring str, - string16* result); -BASE_EXPORT string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str); -BASE_EXPORT string16 ConvertJavaStringToUTF16(const JavaRef<jstring>& str); -BASE_EXPORT string16 ConvertJavaStringToUTF16(JNIEnv* env, - const JavaRef<jstring>& str); - -// Convert a string16 to a Java string. -BASE_EXPORT ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString( - JNIEnv* env, - const base::StringPiece16& str); - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_JNI_STRING_H_ diff --git a/base/android/jni_string_unittest.cc b/base/android/jni_string_unittest.cc deleted file mode 100644 index 3da8b87..0000000 --- a/base/android/jni_string_unittest.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/jni_string.h" - -#include "base/android/jni_android.h" -#include "base/android/scoped_java_ref.h" -#include "base/strings/utf_string_conversions.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace base { -namespace android { - -TEST(JniString, BasicConversionsUTF8) { - const std::string kSimpleString = "SimpleTest8"; - JNIEnv* env = AttachCurrentThread(); - std::string result = - ConvertJavaStringToUTF8(ConvertUTF8ToJavaString(env, kSimpleString)); - EXPECT_EQ(kSimpleString, result); -} - -TEST(JniString, BasicConversionsUTF16) { - const string16 kSimpleString = UTF8ToUTF16("SimpleTest16"); - JNIEnv* env = AttachCurrentThread(); - string16 result = - ConvertJavaStringToUTF16(ConvertUTF16ToJavaString(env, kSimpleString)); - EXPECT_EQ(kSimpleString, result); -} - -TEST(JniString, EmptyConversionUTF8) { - const std::string kEmptyString = ""; - JNIEnv* env = AttachCurrentThread(); - std::string result = - ConvertJavaStringToUTF8(ConvertUTF8ToJavaString(env, kEmptyString)); - EXPECT_EQ(kEmptyString, result); -} - -TEST(JniString, EmptyConversionUTF16) { - const string16 kEmptyString = UTF8ToUTF16(""); - JNIEnv* env = AttachCurrentThread(); - string16 result = - ConvertJavaStringToUTF16(ConvertUTF16ToJavaString(env, kEmptyString)); - EXPECT_EQ(kEmptyString, result); -} - -} // namespace android -} // namespace base diff --git a/base/android/scoped_java_ref.cc b/base/android/scoped_java_ref.cc deleted file mode 100644 index 7d31a75..0000000 --- a/base/android/scoped_java_ref.cc +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/scoped_java_ref.h" - -#include "base/android/jni_android.h" -#include "base/logging.h" - -namespace base { -namespace android { -namespace { - -const int kDefaultLocalFrameCapacity = 16; - -} // namespace - -ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env) : env_(env) { - int failed = env_->PushLocalFrame(kDefaultLocalFrameCapacity); - DCHECK(!failed); -} - -ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity) - : env_(env) { - int failed = env_->PushLocalFrame(capacity); - DCHECK(!failed); -} - -ScopedJavaLocalFrame::~ScopedJavaLocalFrame() { - env_->PopLocalFrame(nullptr); -} - -#if DCHECK_IS_ON() -// This constructor is inlined when DCHECKs are disabled; don't add anything -// else here. -JavaRef<jobject>::JavaRef(JNIEnv* env, jobject obj) : obj_(obj) { - if (obj) { - DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType); - } -} -#endif - -JNIEnv* JavaRef<jobject>::SetNewLocalRef(JNIEnv* env, jobject obj) { - if (!env) { - env = AttachCurrentThread(); - } else { - DCHECK_EQ(env, AttachCurrentThread()); // Is |env| on correct thread. - } - if (obj) - obj = env->NewLocalRef(obj); - if (obj_) - env->DeleteLocalRef(obj_); - obj_ = obj; - return env; -} - -void JavaRef<jobject>::SetNewGlobalRef(JNIEnv* env, jobject obj) { - if (!env) { - env = AttachCurrentThread(); - } else { - DCHECK_EQ(env, AttachCurrentThread()); // Is |env| on correct thread. - } - if (obj) - obj = env->NewGlobalRef(obj); - if (obj_) - env->DeleteGlobalRef(obj_); - obj_ = obj; -} - -void JavaRef<jobject>::ResetLocalRef(JNIEnv* env) { - if (obj_) { - DCHECK_EQ(env, AttachCurrentThread()); // Is |env| on correct thread. - env->DeleteLocalRef(obj_); - obj_ = nullptr; - } -} - -void JavaRef<jobject>::ResetGlobalRef() { - if (obj_) { - AttachCurrentThread()->DeleteGlobalRef(obj_); - obj_ = nullptr; - } -} - -jobject JavaRef<jobject>::ReleaseInternal() { - jobject obj = obj_; - obj_ = nullptr; - return obj; -} - -} // namespace android -} // namespace base diff --git a/base/android/scoped_java_ref.h b/base/android/scoped_java_ref.h deleted file mode 100644 index 6d728e9..0000000 --- a/base/android/scoped_java_ref.h +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_ANDROID_SCOPED_JAVA_REF_H_ -#define BASE_ANDROID_SCOPED_JAVA_REF_H_ - -#include <jni.h> -#include <stddef.h> - -#include <type_traits> -#include <utility> - -#include "base/base_export.h" -#include "base/logging.h" -#include "base/macros.h" - -namespace base { -namespace android { - -// Creates a new local reference frame, in which at least a given number of -// local references can be created. Note that local references already created -// in previous local frames are still valid in the current local frame. -class BASE_EXPORT ScopedJavaLocalFrame { - public: - explicit ScopedJavaLocalFrame(JNIEnv* env); - ScopedJavaLocalFrame(JNIEnv* env, int capacity); - ~ScopedJavaLocalFrame(); - - private: - // This class is only good for use on the thread it was created on so - // it's safe to cache the non-threadsafe JNIEnv* inside this object. - JNIEnv* env_; - - DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame); -}; - -// Forward declare the generic java reference template class. -template<typename T> class JavaRef; - -// Template specialization of JavaRef, which acts as the base class for all -// other JavaRef<> template types. This allows you to e.g. pass -// ScopedJavaLocalRef<jstring> into a function taking const JavaRef<jobject>& -template<> -class BASE_EXPORT JavaRef<jobject> { - public: - // Initializes a null reference. Don't add anything else here; it's inlined. - JavaRef() : obj_(nullptr) {} - - // Allow nullptr to be converted to JavaRef. This avoids having to declare an - // empty JavaRef just to pass null to a function, and makes C++ "nullptr" and - // Java "null" equivalent. - JavaRef(std::nullptr_t) : JavaRef() {} - - // Public to allow destruction of null JavaRef objects. - // Don't add anything else here; it's inlined. - ~JavaRef() {} - - jobject obj() const { return obj_; } - - bool is_null() const { return obj_ == nullptr; } - - protected: - // Takes ownership of the |obj| reference passed; requires it to be a local - // reference type. -#if DCHECK_IS_ON() - // Implementation contains a DCHECK; implement out-of-line when DCHECK_IS_ON. - JavaRef(JNIEnv* env, jobject obj); -#else - // Don't add anything else here; it's inlined. - JavaRef(JNIEnv* env, jobject obj) : obj_(obj) {} -#endif - - void swap(JavaRef& other) { std::swap(obj_, other.obj_); } - - // The following are implementation detail convenience methods, for - // use by the sub-classes. - JNIEnv* SetNewLocalRef(JNIEnv* env, jobject obj); - void SetNewGlobalRef(JNIEnv* env, jobject obj); - void ResetLocalRef(JNIEnv* env); - void ResetGlobalRef(); - jobject ReleaseInternal(); - - private: - jobject obj_; - - DISALLOW_COPY_AND_ASSIGN(JavaRef); -}; - -// Generic base class for ScopedJavaLocalRef and ScopedJavaGlobalRef. Useful -// for allowing functions to accept a reference without having to mandate -// whether it is a local or global type. -template<typename T> -class JavaRef : public JavaRef<jobject> { - public: - JavaRef() {} - JavaRef(std::nullptr_t) : JavaRef<jobject>(nullptr) {} - ~JavaRef() {} - - T obj() const { return static_cast<T>(JavaRef<jobject>::obj()); } - - protected: - JavaRef(JNIEnv* env, T obj) : JavaRef<jobject>(env, obj) {} - - private: - DISALLOW_COPY_AND_ASSIGN(JavaRef); -}; - -// Holds a local reference to a JNI method parameter. -// Method parameters should not be deleted, and so this class exists purely to -// wrap them as a JavaRef<T> in the JNI binding generator. Do not create -// instances manually. -template<typename T> -class JavaParamRef : public JavaRef<T> { - public: - // Assumes that |obj| is a parameter passed to a JNI method from Java. - // Does not assume ownership as parameters should not be deleted. - JavaParamRef(JNIEnv* env, T obj) : JavaRef<T>(env, obj) {} - - // Allow nullptr to be converted to JavaParamRef. Some unit tests call JNI - // methods directly from C++ and pass null for objects which are not actually - // used by the implementation (e.g. the caller object); allow this to keep - // working. - JavaParamRef(std::nullptr_t) : JavaRef<T>(nullptr) {} - - ~JavaParamRef() {} - - // TODO(torne): remove this cast once we're using JavaRef consistently. - // http://crbug.com/506850 - operator T() const { return JavaRef<T>::obj(); } - - private: - DISALLOW_COPY_AND_ASSIGN(JavaParamRef); -}; - -// Holds a local reference to a Java object. The local reference is scoped -// to the lifetime of this object. -// Instances of this class may hold onto any JNIEnv passed into it until -// destroyed. Therefore, since a JNIEnv is only suitable for use on a single -// thread, objects of this class must be created, used, and destroyed, on a -// single thread. -// Therefore, this class should only be used as a stack-based object and from a -// single thread. If you wish to have the reference outlive the current -// callstack (e.g. as a class member) or you wish to pass it across threads, -// use a ScopedJavaGlobalRef instead. -template<typename T> -class ScopedJavaLocalRef : public JavaRef<T> { - public: - ScopedJavaLocalRef() : env_(nullptr) {} - ScopedJavaLocalRef(std::nullptr_t) : env_(nullptr) {} - - // Non-explicit copy constructor, to allow ScopedJavaLocalRef to be returned - // by value as this is the normal usage pattern. - ScopedJavaLocalRef(const ScopedJavaLocalRef<T>& other) - : env_(other.env_) { - this->SetNewLocalRef(env_, other.obj()); - } - - ScopedJavaLocalRef(ScopedJavaLocalRef<T>&& other) : env_(other.env_) { - this->swap(other); - } - - explicit ScopedJavaLocalRef(const JavaRef<T>& other) : env_(nullptr) { - this->Reset(other); - } - - // Assumes that |obj| is a local reference to a Java object and takes - // ownership of this local reference. - // TODO(torne): this shouldn't be used outside of JNI helper functions but - // there are currently some cases where there aren't helpers for things. - ScopedJavaLocalRef(JNIEnv* env, T obj) : JavaRef<T>(env, obj), env_(env) {} - - ~ScopedJavaLocalRef() { - this->Reset(); - } - - // Overloaded assignment operator defined for consistency with the implicit - // copy constructor. - void operator=(const ScopedJavaLocalRef<T>& other) { - this->Reset(other); - } - - void operator=(ScopedJavaLocalRef<T>&& other) { - env_ = other.env_; - this->swap(other); - } - - void Reset() { - this->ResetLocalRef(env_); - } - - void Reset(const ScopedJavaLocalRef<T>& other) { - // We can copy over env_ here as |other| instance must be from the same - // thread as |this| local ref. (See class comment for multi-threading - // limitations, and alternatives). - this->Reset(other.env_, other.obj()); - } - - void Reset(const JavaRef<T>& other) { - // If |env_| was not yet set (is still null) it will be attached to the - // current thread in SetNewLocalRef(). - this->Reset(env_, other.obj()); - } - - // Creates a new local reference to the Java object, unlike the constructor - // with the same parameters that takes ownership of the existing reference. - // TODO(torne): these should match as this is confusing. - void Reset(JNIEnv* env, T obj) { env_ = this->SetNewLocalRef(env, obj); } - - // Releases the local reference to the caller. The caller *must* delete the - // local reference when it is done with it. Note that calling a Java method - // is *not* a transfer of ownership and Release() should not be used. - T Release() { - return static_cast<T>(this->ReleaseInternal()); - } - - private: - // This class is only good for use on the thread it was created on so - // it's safe to cache the non-threadsafe JNIEnv* inside this object. - JNIEnv* env_; - - // Prevent ScopedJavaLocalRef(JNIEnv*, T obj) from being used to take - // ownership of a JavaParamRef's underlying object - parameters are not - // allowed to be deleted and so should not be owned by ScopedJavaLocalRef. - // TODO(torne): this can be removed once JavaParamRef no longer has an - // implicit conversion back to T. - ScopedJavaLocalRef(JNIEnv* env, const JavaParamRef<T>& other); -}; - -// Holds a global reference to a Java object. The global reference is scoped -// to the lifetime of this object. This class does not hold onto any JNIEnv* -// passed to it, hence it is safe to use across threads (within the constraints -// imposed by the underlying Java object that it references). -template<typename T> -class ScopedJavaGlobalRef : public JavaRef<T> { - public: - ScopedJavaGlobalRef() {} - ScopedJavaGlobalRef(std::nullptr_t) {} - - ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) { - this->Reset(other); - } - - ScopedJavaGlobalRef(ScopedJavaGlobalRef<T>&& other) { this->swap(other); } - - ScopedJavaGlobalRef(JNIEnv* env, T obj) { this->Reset(env, obj); } - - explicit ScopedJavaGlobalRef(const JavaRef<T>& other) { this->Reset(other); } - - ~ScopedJavaGlobalRef() { - this->Reset(); - } - - // Overloaded assignment operator defined for consistency with the implicit - // copy constructor. - void operator=(const ScopedJavaGlobalRef<T>& other) { - this->Reset(other); - } - - void operator=(ScopedJavaGlobalRef<T>&& other) { this->swap(other); } - - void Reset() { - this->ResetGlobalRef(); - } - - void Reset(const JavaRef<T>& other) { this->Reset(nullptr, other.obj()); } - - void Reset(JNIEnv* env, const JavaParamRef<T>& other) { - this->Reset(env, other.obj()); - } - - void Reset(JNIEnv* env, T obj) { this->SetNewGlobalRef(env, obj); } - - // Releases the global reference to the caller. The caller *must* delete the - // global reference when it is done with it. Note that calling a Java method - // is *not* a transfer of ownership and Release() should not be used. - T Release() { - return static_cast<T>(this->ReleaseInternal()); - } -}; - -// Temporary type for parameters to Java functions, to allow incremental -// migration from bare jobject to JavaRef. Don't use outside JNI generator. -template <typename T> -class JavaRefOrBare { - public: - JavaRefOrBare(std::nullptr_t) : obj_(nullptr) {} - JavaRefOrBare(const JavaRef<T>& ref) : obj_(ref.obj()) {} - JavaRefOrBare(T obj) : obj_(obj) {} - T obj() const { return obj_; } - - private: - T obj_; - - DISALLOW_COPY_AND_ASSIGN(JavaRefOrBare); -}; - -} // namespace android -} // namespace base - -#endif // BASE_ANDROID_SCOPED_JAVA_REF_H_ diff --git a/base/android/scoped_java_ref_unittest.cc b/base/android/scoped_java_ref_unittest.cc deleted file mode 100644 index 99d035b..0000000 --- a/base/android/scoped_java_ref_unittest.cc +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/android/scoped_java_ref.h" - -#include "base/android/jni_android.h" -#include "base/android/jni_string.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace base { -namespace android { - -namespace { -int g_local_refs = 0; -int g_global_refs = 0; - -const JNINativeInterface* g_previous_functions; - -jobject NewGlobalRef(JNIEnv* env, jobject obj) { - ++g_global_refs; - return g_previous_functions->NewGlobalRef(env, obj); -} - -void DeleteGlobalRef(JNIEnv* env, jobject obj) { - --g_global_refs; - return g_previous_functions->DeleteGlobalRef(env, obj); -} - -jobject NewLocalRef(JNIEnv* env, jobject obj) { - ++g_local_refs; - return g_previous_functions->NewLocalRef(env, obj); -} - -void DeleteLocalRef(JNIEnv* env, jobject obj) { - --g_local_refs; - return g_previous_functions->DeleteLocalRef(env, obj); -} -} // namespace - -class ScopedJavaRefTest : public testing::Test { - protected: - void SetUp() override { - g_local_refs = 0; - g_global_refs = 0; - JNIEnv* env = AttachCurrentThread(); - g_previous_functions = env->functions; - hooked_functions = *g_previous_functions; - env->functions = &hooked_functions; - // We inject our own functions in JNINativeInterface so we can keep track - // of the reference counting ourselves. - hooked_functions.NewGlobalRef = &NewGlobalRef; - hooked_functions.DeleteGlobalRef = &DeleteGlobalRef; - hooked_functions.NewLocalRef = &NewLocalRef; - hooked_functions.DeleteLocalRef = &DeleteLocalRef; - } - - void TearDown() override { - JNIEnv* env = AttachCurrentThread(); - env->functions = g_previous_functions; - } - // From JellyBean release, the instance of this struct provided in JNIEnv is - // read-only, so we deep copy it to allow individual functions to be hooked. - JNINativeInterface hooked_functions; -}; - -// The main purpose of this is testing the various conversions compile. -TEST_F(ScopedJavaRefTest, Conversions) { - JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jstring> str = ConvertUTF8ToJavaString(env, "string"); - ScopedJavaGlobalRef<jstring> global(str); - { - ScopedJavaGlobalRef<jobject> global_obj(str); - ScopedJavaLocalRef<jobject> local_obj(global); - const JavaRef<jobject>& obj_ref1(str); - const JavaRef<jobject>& obj_ref2(global); - EXPECT_TRUE(env->IsSameObject(obj_ref1.obj(), obj_ref2.obj())); - EXPECT_TRUE(env->IsSameObject(global_obj.obj(), obj_ref2.obj())); - } - global.Reset(str); - const JavaRef<jstring>& str_ref = str; - EXPECT_EQ("string", ConvertJavaStringToUTF8(str_ref)); - str.Reset(); -} - -TEST_F(ScopedJavaRefTest, RefCounts) { - JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jstring> str; - // The ConvertJavaStringToUTF8 below creates a new string that would normally - // return a local ref. We simulate that by starting the g_local_refs count at - // 1. - g_local_refs = 1; - str.Reset(ConvertUTF8ToJavaString(env, "string")); - EXPECT_EQ(1, g_local_refs); - EXPECT_EQ(0, g_global_refs); - { - ScopedJavaGlobalRef<jstring> global_str(str); - ScopedJavaGlobalRef<jobject> global_obj(global_str); - EXPECT_EQ(1, g_local_refs); - EXPECT_EQ(2, g_global_refs); - - ScopedJavaLocalRef<jstring> str2(env, str.Release()); - EXPECT_EQ(1, g_local_refs); - { - ScopedJavaLocalRef<jstring> str3(str2); - EXPECT_EQ(2, g_local_refs); - } - EXPECT_EQ(1, g_local_refs); - { - ScopedJavaLocalRef<jstring> str4((ScopedJavaLocalRef<jstring>(str2))); - EXPECT_EQ(2, g_local_refs); - } - EXPECT_EQ(1, g_local_refs); - { - ScopedJavaLocalRef<jstring> str5; - str5 = ScopedJavaLocalRef<jstring>(str2); - EXPECT_EQ(2, g_local_refs); - } - EXPECT_EQ(1, g_local_refs); - str2.Reset(); - EXPECT_EQ(0, g_local_refs); - global_str.Reset(); - EXPECT_EQ(1, g_global_refs); - ScopedJavaGlobalRef<jobject> global_obj2(global_obj); - EXPECT_EQ(2, g_global_refs); - } - - EXPECT_EQ(0, g_local_refs); - EXPECT_EQ(0, g_global_refs); -} - -} // namespace android -} // namespace base |