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

Commit 5c3f7236 authored by Colin Cross's avatar Colin Cross Committed by Android (Google) Code Review
Browse files

Merge "MediaHTTPConnection: use jlong to store native pointer"

parents 7d9a8ffd 5e8ff02e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -269,6 +269,6 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
        native_init();
    }

    private int mNativeContext;
    private long mNativeContext;

}
+3 −3
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ static fields_t gFields;
static sp<JMediaHTTPConnection> setObject(
        JNIEnv *env, jobject thiz, const sp<JMediaHTTPConnection> &conn) {
    sp<JMediaHTTPConnection> old =
        (JMediaHTTPConnection *)env->GetIntField(thiz, gFields.context);
        (JMediaHTTPConnection *)env->GetLongField(thiz, gFields.context);

    if (conn != NULL) {
        conn->incStrong(thiz);
@@ -92,13 +92,13 @@ static sp<JMediaHTTPConnection> setObject(
    if (old != NULL) {
        old->decStrong(thiz);
    }
    env->SetIntField(thiz, gFields.context, (int)conn.get());
    env->SetLongField(thiz, gFields.context, (jlong)conn.get());

    return old;
}

static sp<JMediaHTTPConnection> getObject(JNIEnv *env, jobject thiz) {
    return (JMediaHTTPConnection *)env->GetIntField(thiz, gFields.context);
    return (JMediaHTTPConnection *)env->GetLongField(thiz, gFields.context);
}

static void android_media_MediaHTTPConnection_native_init(JNIEnv *env) {