Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b14f1824 authored by James Dong's avatar James Dong Committed by Android (Google) Code Review
Browse files

Merge "Removed code related to simulator build in TimedEventQueue to get rid...

Merge "Removed code related to simulator build in TimedEventQueue to get rid of the dependency on jni.h"
parents 48a98a55 6eb463b1
Loading
Loading
Loading
Loading
+0 −21
Original line number Original line Diff line number Diff line
@@ -31,10 +31,6 @@


#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ADebug.h>


#ifdef ANDROID_SIMULATOR
#include <jni.h>
#endif

namespace android {
namespace android {


TimedEventQueue::TimedEventQueue()
TimedEventQueue::TimedEventQueue()
@@ -193,27 +189,10 @@ int64_t TimedEventQueue::getRealTimeUs() {
// static
// static
void *TimedEventQueue::ThreadWrapper(void *me) {
void *TimedEventQueue::ThreadWrapper(void *me) {


#ifdef ANDROID_SIMULATOR
    // The simulator runs everything as one process, so any
    // Binder calls happen on this thread instead of a thread
    // in another process. We therefore need to make sure that
    // this thread can do calls into interpreted code.
    // On the device this is not an issue because the remote
    // thread will already be set up correctly for this.
    JavaVM *vm;
    int numvms;
    JNI_GetCreatedJavaVMs(&vm, 1, &numvms);
    JNIEnv *env;
    vm->AttachCurrentThread(&env, NULL);
#endif

    androidSetThreadPriority(0, ANDROID_PRIORITY_FOREGROUND);
    androidSetThreadPriority(0, ANDROID_PRIORITY_FOREGROUND);


    static_cast<TimedEventQueue *>(me)->threadEntry();
    static_cast<TimedEventQueue *>(me)->threadEntry();


#ifdef ANDROID_SIMULATOR
    vm->DetachCurrentThread();
#endif
    return NULL;
    return NULL;
}
}