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

Commit d58efd38 authored by Bjorn Bringert's avatar Bjorn Bringert Committed by Android (Google) Code Review
Browse files

Merge "Check for exceptions before calling back into Java"

parents e04074a3 9013ccd9
Loading
Loading
Loading
Loading
+15 −7
Original line number Original line Diff line number Diff line
@@ -282,6 +282,16 @@ protected:
            code, (int32_t)&data, (int32_t)reply, flags);
            code, (int32_t)&data, (int32_t)reply, flags);
        jthrowable excep = env->ExceptionOccurred();
        jthrowable excep = env->ExceptionOccurred();


        if (excep) {
            report_exception(env, excep,
                "*** Uncaught remote exception!  "
                "(Exceptions are not yet supported across processes.)");
            res = JNI_FALSE;

            /* clean up JNI local ref -- we don't return to Java code */
            env->DeleteLocalRef(excep);
        }

        // Restore the Java binder thread's state if it changed while
        // Restore the Java binder thread's state if it changed while
        // processing a call (as it would if the Parcel's header had a
        // processing a call (as it would if the Parcel's header had a
        // new policy mask and Parcel.enforceInterface() changed
        // new policy mask and Parcel.enforceInterface() changed
@@ -294,14 +304,12 @@ protected:
            set_dalvik_blockguard_policy(env, strict_policy_before);
            set_dalvik_blockguard_policy(env, strict_policy_before);
        }
        }


        if (excep) {
        jthrowable excep2 = env->ExceptionOccurred();
            report_exception(env, excep,
        if (excep2) {
                "*** Uncaught remote exception!  "
            report_exception(env, excep2,
                "(Exceptions are not yet supported across processes.)");
                "*** Uncaught exception in onBinderStrictModePolicyChange");
            res = JNI_FALSE;

            /* clean up JNI local ref -- we don't return to Java code */
            /* clean up JNI local ref -- we don't return to Java code */
            env->DeleteLocalRef(excep);
            env->DeleteLocalRef(excep2);
        }
        }


        //aout << "onTransact to Java code; result=" << res << endl
        //aout << "onTransact to Java code; result=" << res << endl