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 /core/jni | |
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 'core/jni')
-rw-r--r-- | core/jni/Android.mk | 24 | ||||
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 28 | ||||
-rw-r--r-- | core/jni/AndroidRuntimeBase.cpp | 56 |
3 files changed, 31 insertions, 77 deletions
diff --git a/core/jni/Android.mk b/core/jni/Android.mk index cc1081a..f8d96e3 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -1,25 +1,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES:= \ - AndroidRuntimeBase.cpp \ - android_os_Parcel.cpp \ - android_util_Binder.cpp - -LOCAL_SHARED_LIBRARIES:= \ - libbinder \ - libcutils \ - libnativehelper \ - libutils \ - -LOCAL_MODULE := libandroid_runtime - -include $(BUILD_SHARED_LIBRARY) - -################################################################################ - -include $(CLEAR_VARS) - LOCAL_CFLAGS += -DHAVE_CONFIG_H -DKHTML_NO_EXCEPTIONS -DGKWQ_NO_JAVA LOCAL_CFLAGS += -DNO_SUPPORT_JS_BINDING -DQT_NO_WHEELEVENT -DKHTML_NO_XBL LOCAL_CFLAGS += -U__APPLE__ @@ -85,6 +66,7 @@ LOCAL_SRC_FILES:= \ android_os_Debug.cpp \ android_os_MemoryFile.cpp \ android_os_MessageQueue.cpp \ + android_os_Parcel.cpp \ android_os_SELinux.cpp \ android_os_SystemClock.cpp \ android_os_SystemProperties.cpp \ @@ -96,6 +78,7 @@ LOCAL_SRC_FILES:= \ android_nio_utils.cpp \ android_text_format_Time.cpp \ android_util_AssetManager.cpp \ + android_util_Binder.cpp \ android_util_EventLog.cpp \ android_util_Log.cpp \ android_util_FloatMath.cpp \ @@ -199,7 +182,6 @@ LOCAL_C_INCLUDES += \ LOCAL_SHARED_LIBRARIES := \ libmemtrack \ - libandroid_runtime \ libandroidfw \ libexpat \ libnativehelper \ @@ -259,7 +241,7 @@ ifeq ($(WITH_MALLOC_LEAK_CHECK),true) LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK endif -LOCAL_MODULE:= libandroid_runtime_derived +LOCAL_MODULE:= libandroid_runtime include external/stlport/libstlport.mk include $(BUILD_SHARED_LIBRARY) diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 77be9ec..7ed6641 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -226,6 +226,9 @@ int register_com_android_internal_os_RuntimeInit(JNIEnv* env) // ---------------------------------------------------------------------- +/*static*/ JavaVM* AndroidRuntime::mJavaVM = NULL; + + AndroidRuntime::AndroidRuntime() : mExitWithoutCleanup(false) { @@ -253,6 +256,15 @@ AndroidRuntime::~AndroidRuntime() SkGraphics::Term(); } +/* + * Register native methods using JNI. + */ +/*static*/ int AndroidRuntime::registerNativeMethods(JNIEnv* env, + const char* className, const JNINativeMethod* gMethods, int numMethods) +{ + return jniRegisterNativeMethods(env, className, gMethods, numMethods); +} + status_t AndroidRuntime::callMain(const char* className, jclass clazz, int argc, const char* const argv[]) { @@ -915,6 +927,22 @@ void AndroidRuntime::onVmCreated(JNIEnv* env) } /* + * Get the JNIEnv pointer for this thread. + * + * Returns NULL if the slot wasn't allocated or populated. + */ +/*static*/ JNIEnv* AndroidRuntime::getJNIEnv() +{ + JNIEnv* env; + JavaVM* vm = AndroidRuntime::getJavaVM(); + assert(vm != NULL); + + if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) + return NULL; + return env; +} + +/* * Makes the current thread visible to the VM. * * The JNIEnv pointer returned is only valid for the current thread, and diff --git a/core/jni/AndroidRuntimeBase.cpp b/core/jni/AndroidRuntimeBase.cpp deleted file mode 100644 index 38afc49..0000000 --- a/core/jni/AndroidRuntimeBase.cpp +++ /dev/null @@ -1,56 +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. - */ - -#define LOG_TAG "AndroidRuntimeBase" -//#define LOG_NDEBUG 0 -#include <utils/Log.h> - -#include <android_runtime/AndroidRuntime.h> - -#include "jni.h" -#include "JNIHelp.h" - -namespace android { - -/*static*/ JavaVM* AndroidRuntimeBase::mJavaVM = NULL; - -/* - * Get the JNIEnv pointer for this thread. - * - * Returns NULL if the slot wasn't allocated or populated. - */ -/*static*/ JNIEnv* AndroidRuntimeBase::getJNIEnv() -{ - JNIEnv* env; - JavaVM* vm = AndroidRuntimeBase::getJavaVM(); - assert(vm != NULL); - - if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) - return NULL; - return env; -} - -/* - * Register native methods using JNI. - */ -/*static*/ int AndroidRuntimeBase::registerNativeMethods(JNIEnv* env, - const char* className, const JNINativeMethod* gMethods, int numMethods) -{ - return jniRegisterNativeMethods(env, className, gMethods, numMethods); -} - -} // namespace android - |