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

Commit f7864f3e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Handle getExtension returning nullptr"

parents 9ffdecce cd873ea8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -63,6 +63,18 @@ jboolean checkHidlReturn(hardware::Return<T>& result, const char* errorMessage)
    }
}

template <class T>
jboolean checkHidlReturn(hardware::Return<sp<T>>& result, const char* errorMessage) {
    if (!result.isOk()) {
        logHidlError(result, errorMessage);
        return JNI_FALSE;
    } else if ((sp<T>)result == nullptr) {
        return JNI_FALSE;
    } else {
        return JNI_TRUE;
    }
}

template <class T>
class JavaMethodHelper {
public: