aboutsummaryrefslogtreecommitdiff
path: root/nativeruntime/cpp/jni/AndroidRuntime.cpp
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-14 14:44:21 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-14 14:44:21 +0000
commitf11789c7532131b05ba5d7c86ee5b432f49ba099 (patch)
tree2aba65167e81ebf211f1503a64fa3f5ccc08c537 /nativeruntime/cpp/jni/AndroidRuntime.cpp
parent70ae854c1a5a6d161490f4f6a700ea24cbea3fae (diff)
parent669bd7c87aad3fc72259b08e79aeacf34e9ebced (diff)
downloadrobolectric-android13-qpr3-c-s8-release.tar.gz
Change-Id: Iaf1372b35245ad3745bae61ebfafc7624856de14
Diffstat (limited to 'nativeruntime/cpp/jni/AndroidRuntime.cpp')
-rw-r--r--nativeruntime/cpp/jni/AndroidRuntime.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/nativeruntime/cpp/jni/AndroidRuntime.cpp b/nativeruntime/cpp/jni/AndroidRuntime.cpp
deleted file mode 100644
index e22381c17..000000000
--- a/nativeruntime/cpp/jni/AndroidRuntime.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2005 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.
- */
-
-// Derived from
-// https://cs.android.com/android/platform/superproject/+/android-11.0.0_r1:frameworks/base/core/jni/AndroidRuntime.cpp
-
-#include "AndroidRuntime.h"
-
-#include <assert.h>
-
-#include "jni.h"
-
-using namespace android;
-
-/*static*/ JavaVM* AndroidRuntime::mJavaVM = nullptr;
-
-/*static*/ JavaVM* AndroidRuntime::getJavaVM() {
- return AndroidRuntime::mJavaVM;
-}
-
-/*
- * 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 != nullptr);
-
- if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_4) != JNI_OK)
- return nullptr;
- return env;
-}