diff options
author | Andreas Huber <andih@google.com> | 2014-02-13 17:22:33 +0000 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2014-02-13 17:22:33 +0000 |
commit | 9ae000ca8c05ad6f700ad7bf119bbc92fb964b57 (patch) | |
tree | 39535e468bacaef05410d512d0794c41d27f8181 /include/android_runtime | |
parent | 7825334929b098b36e1144872200e75ba6d24b13 (diff) | |
download | frameworks_base-9ae000ca8c05ad6f700ad7bf119bbc92fb964b57.zip frameworks_base-9ae000ca8c05ad6f700ad7bf119bbc92fb964b57.tar.gz frameworks_base-9ae000ca8c05ad6f700ad7bf119bbc92fb964b57.tar.bz2 |
Revert "Split AndroidRuntime into AndroidRuntimeBase base-class and the rest."
This reverts commit 7825334929b098b36e1144872200e75ba6d24b13.
Change-Id: I1702eb3ff9d7192d64039c8bf4bc3fc5d8e458c4
Diffstat (limited to 'include/android_runtime')
-rw-r--r-- | include/android_runtime/AndroidRuntime.h | 19 | ||||
-rw-r--r-- | include/android_runtime/AndroidRuntimeBase.h | 50 |
2 files changed, 16 insertions, 53 deletions
diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h index efd92bb..0b3ce9a 100644 --- a/include/android_runtime/AndroidRuntime.h +++ b/include/android_runtime/AndroidRuntime.h @@ -19,8 +19,6 @@ #ifndef _RUNTIME_ANDROID_RUNTIME_H #define _RUNTIME_ANDROID_RUNTIME_H -#include "AndroidRuntimeBase.h" - #include <utils/Errors.h> #include <binder/IBinder.h> #include <utils/String8.h> @@ -33,7 +31,7 @@ namespace android { -class AndroidRuntime : public AndroidRuntimeBase +class AndroidRuntime { public: AndroidRuntime(); @@ -47,6 +45,12 @@ public: }; /** + * Register a set of methods in the specified class. + */ + static int registerNativeMethods(JNIEnv* env, + const char* className, const JNINativeMethod* gMethods, int numMethods); + + /** * Call a class's static main method with the given arguments, */ status_t callMain(const char* className, jclass clazz, int argc, @@ -100,6 +104,12 @@ public: static android_thread_id_t createJavaThread(const char* name, void (*start)(void *), void* arg); + /** return a pointer to the VM running in this process */ + static JavaVM* getJavaVM() { return mJavaVM; } + + /** return a pointer to the JNIEnv pointer for this thread */ + static JNIEnv* getJNIEnv(); + /** return a new string corresponding to 'className' with all '.'s replaced by '/'s. */ static char* toSlashClassName(const char* className); @@ -111,6 +121,9 @@ private: Vector<JavaVMOption> mOptions; bool mExitWithoutCleanup; + /* JNI JavaVM pointer */ + static JavaVM* mJavaVM; + /* * Thread creation helpers. */ diff --git a/include/android_runtime/AndroidRuntimeBase.h b/include/android_runtime/AndroidRuntimeBase.h deleted file mode 100644 index 2b14987..0000000 --- a/include/android_runtime/AndroidRuntimeBase.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _RUNTIME_ANDROID_RUNTIME_BASE_H -#define _RUNTIME_ANDROID_RUNTIME_BASE_H - -#include <nativehelper/jni.h> - -namespace android { - -struct AndroidRuntimeBase { - /** return a pointer to the VM running in this process */ - static JavaVM* getJavaVM() { return mJavaVM; } - - /** return a pointer to the JNIEnv pointer for this thread */ - static JNIEnv* getJNIEnv(); - - /** - * Register a set of methods in the specified class. - */ - static int registerNativeMethods(JNIEnv* env, - const char* className, const JNINativeMethod* gMethods, int numMethods); - -protected: - /* JNI JavaVM pointer */ - static JavaVM* mJavaVM; - - AndroidRuntimeBase() {} - virtual ~AndroidRuntimeBase() {} - - AndroidRuntimeBase(const AndroidRuntimeBase &); - AndroidRuntimeBase &operator=(const AndroidRuntimeBase &); -}; - -} // namespace android - -#endif // _RUNTIME_ANDROID_RUNTIME_BASE_H |