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

Commit 53acc7ae authored by Narayan Kamath's avatar Narayan Kamath Committed by Android Git Automerger
Browse files

am f5598210: Merge "AArch64: Use long for pointers in hardware classes"

* commit 'f5598210':
  AArch64: Use long for pointers in hardware classes
parents ab169215 f5598210
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ public class Camera {
    private static final int CAMERA_MSG_PREVIEW_METADATA = 0x400;
    private static final int CAMERA_MSG_FOCUS_MOVE       = 0x800;

    private int mNativeContext; // accessed by native methods
    private long mNativeContext; // accessed by native methods
    private EventHandler mEventHandler;
    private ShutterCallback mShutterCallback;
    private PictureCallback mRawImageCallback;
+6 −6
Original line number Diff line number Diff line
@@ -222,14 +222,14 @@ public class SystemSensorManager extends SensorManager {
     * the queues and the listeners.
     */
    private static abstract class BaseEventQueue {
        private native int nativeInitBaseEventQueue(BaseEventQueue eventQ, MessageQueue msgQ,
        private native long nativeInitBaseEventQueue(BaseEventQueue eventQ, MessageQueue msgQ,
                float[] scratch);
        private static native int nativeEnableSensor(int eventQ, int handle, int rateUs,
        private static native int nativeEnableSensor(long eventQ, int handle, int rateUs,
                int maxBatchReportLatencyUs, int reservedFlags);
        private static native int nativeDisableSensor(int eventQ, int handle);
        private static native void nativeDestroySensorEventQueue(int eventQ);
        private static native int nativeFlushSensor(int eventQ);
        private int nSensorEventQueue;
        private static native int nativeDisableSensor(long eventQ, int handle);
        private static native void nativeDestroySensorEventQueue(long eventQ);
        private static native int nativeFlushSensor(long eventQ);
        private long nSensorEventQueue;
        private final SparseBooleanArray mActiveSensors = new SparseBooleanArray();
        protected final SparseIntArray mSensorAccuracies = new SparseIntArray();
        protected final SparseBooleanArray mFirstEvent = new SparseBooleanArray();
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public class UsbDeviceConnection {
    private final UsbDevice mDevice;

    // used by the JNI code
    private int mNativeContext;
    private long mNativeContext;

    /**
     * UsbDevice should only be instantiated by UsbService implementation
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public class UsbRequest {
    private static final String TAG = "UsbRequest";

    // used by the JNI code
    private int mNativeContext;
    private long mNativeContext;

    private UsbEndpoint mEndpoint;

+11 −11
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ sp<Camera> get_native_camera(JNIEnv *env, jobject thiz, JNICameraContext** pCont
{
    sp<Camera> camera;
    Mutex::Autolock _l(sLock);
    JNICameraContext* context = reinterpret_cast<JNICameraContext*>(env->GetIntField(thiz, fields.context));
    JNICameraContext* context = reinterpret_cast<JNICameraContext*>(env->GetLongField(thiz, fields.context));
    if (context != NULL) {
        camera = context->getCamera();
    }
@@ -500,7 +500,7 @@ static void android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz,
    camera->setListener(context);

    // save context in opaque field
    env->SetIntField(thiz, fields.context, (int)context.get());
    env->SetLongField(thiz, fields.context, (jlong)context.get());
}

// disconnect from camera service
@@ -515,10 +515,10 @@ static void android_hardware_Camera_release(JNIEnv *env, jobject thiz)
    sp<Camera> camera;
    {
        Mutex::Autolock _l(sLock);
        context = reinterpret_cast<JNICameraContext*>(env->GetIntField(thiz, fields.context));
        context = reinterpret_cast<JNICameraContext*>(env->GetLongField(thiz, fields.context));

        // Make sure we do not attempt to callback on a deleted Java object.
        env->SetIntField(thiz, fields.context, 0);
        env->SetLongField(thiz, fields.context, 0);
    }

    // clean up if release has not been called before
@@ -627,13 +627,13 @@ static void android_hardware_Camera_stopPreview(JNIEnv *env, jobject thiz)
    c->stopPreview();
}

static bool android_hardware_Camera_previewEnabled(JNIEnv *env, jobject thiz)
static jboolean android_hardware_Camera_previewEnabled(JNIEnv *env, jobject thiz)
{
    ALOGV("previewEnabled");
    sp<Camera> c = get_native_camera(env, thiz, NULL);
    if (c == 0) return false;
    if (c == 0) return JNI_FALSE;

    return c->previewEnabled();
    return c->previewEnabled() ? JNI_TRUE : JNI_FALSE;
}

static void android_hardware_Camera_setHasPreviewCallback(JNIEnv *env, jobject thiz, jboolean installed, jboolean manualBuffer)
@@ -651,10 +651,10 @@ static void android_hardware_Camera_setHasPreviewCallback(JNIEnv *env, jobject t
    context->setCallbackMode(env, installed, manualBuffer);
}

static void android_hardware_Camera_addCallbackBuffer(JNIEnv *env, jobject thiz, jbyteArray bytes, int msgType) {
static void android_hardware_Camera_addCallbackBuffer(JNIEnv *env, jobject thiz, jbyteArray bytes, jint msgType) {
    ALOGV("addCallbackBuffer: 0x%x", msgType);

    JNICameraContext* context = reinterpret_cast<JNICameraContext*>(env->GetIntField(thiz, fields.context));
    JNICameraContext* context = reinterpret_cast<JNICameraContext*>(env->GetLongField(thiz, fields.context));

    if (context != NULL) {
        context->addCallbackBuffer(env, bytes, msgType);
@@ -685,7 +685,7 @@ static void android_hardware_Camera_cancelAutoFocus(JNIEnv *env, jobject thiz)
    }
}

static void android_hardware_Camera_takePicture(JNIEnv *env, jobject thiz, int msgType)
static void android_hardware_Camera_takePicture(JNIEnv *env, jobject thiz, jint msgType)
{
    ALOGV("takePicture");
    JNICameraContext* context;
@@ -999,7 +999,7 @@ static int find_fields(JNIEnv *env, field *fields, int count)
int register_android_hardware_Camera(JNIEnv *env)
{
    field fields_to_find[] = {
        { "android/hardware/Camera", "mNativeContext",   "I", &fields.context },
        { "android/hardware/Camera", "mNativeContext",   "J", &fields.context },
        { "android/hardware/Camera$CameraInfo", "facing",   "I", &fields.facing },
        { "android/hardware/Camera$CameraInfo", "orientation",   "I", &fields.orientation },
        { "android/hardware/Camera$CameraInfo", "canDisableShutterSound",   "Z",
Loading