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

Commit b1a97523 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 5739 into donut

* changes:
  Check to make sure the Java camera object is still valid on the callback from native. Omitted from previous fix. Bug 1936850.
parents b7d7d5f6 d0cbb1a5
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -171,6 +171,10 @@ void JNICameraContext::postData(int32_t msgType, const sp<IMemory>& dataPtr)
    // VM pointer will be NULL if object is released
    // VM pointer will be NULL if object is released
    Mutex::Autolock _l(mLock);
    Mutex::Autolock _l(mLock);
    JNIEnv *env = AndroidRuntime::getJNIEnv();
    JNIEnv *env = AndroidRuntime::getJNIEnv();
    if (mCameraJObjectWeak == NULL) {
        LOGW("callback on dead camera object");
        return;
    }


    // return data based on callback type
    // return data based on callback type
    switch(msgType) {
    switch(msgType) {