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

Commit adcc5763 authored by Zhentao Sun's avatar Zhentao Sun Committed by Android (Google) Code Review
Browse files

Merge "Make sure nativeInit is called on an object."

parents 0b38f08e a4dfc2c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -427,7 +427,7 @@ public class LocationManagerService extends ILocationManager.Stub {
        }
        }


        // bind to fused provider if supported
        // bind to fused provider if supported
        if (FlpHardwareProvider.isSupported()) {
        if (FlpHardwareProvider.getInstance(mContext).isSupported()) {
          FlpHardwareProvider flpHardwareProvider = FlpHardwareProvider.getInstance(mContext);
          FlpHardwareProvider flpHardwareProvider = FlpHardwareProvider.getInstance(mContext);
          FusedProxy fusedProxy = FusedProxy.createAndBind(
          FusedProxy fusedProxy = FusedProxy.createAndBind(
                  mContext,
                  mContext,
+3 −4
Original line number Original line Diff line number Diff line
@@ -67,9 +67,9 @@ public class FlpHardwareProvider {
    public static FlpHardwareProvider getInstance(Context context) {
    public static FlpHardwareProvider getInstance(Context context) {
        if (sSingletonInstance == null) {
        if (sSingletonInstance == null) {
            sSingletonInstance = new FlpHardwareProvider(context);
            sSingletonInstance = new FlpHardwareProvider(context);
            sSingletonInstance.nativeInit();
        }
        }


        nativeInit();
        return sSingletonInstance;
        return sSingletonInstance;
    }
    }


@@ -96,8 +96,7 @@ public class FlpHardwareProvider {
                Looper.myLooper());
                Looper.myLooper());
    }
    }


    public static boolean isSupported() {
    public boolean isSupported() {
        nativeInit();
        return nativeIsSupported();
        return nativeIsSupported();
    }
    }


@@ -218,9 +217,9 @@ public class FlpHardwareProvider {
    // Core members
    // Core members
    private static native void nativeClassInit();
    private static native void nativeClassInit();
    private static native boolean nativeIsSupported();
    private static native boolean nativeIsSupported();
    private static native void nativeInit();


    // FlpLocationInterface members
    // FlpLocationInterface members
    private native void nativeInit();
    private native int nativeGetBatchSize();
    private native int nativeGetBatchSize();
    private native void nativeStartBatching(int requestId, FusedBatchOptions options);
    private native void nativeStartBatching(int requestId, FusedBatchOptions options);
    private native void nativeUpdateBatchingOptions(int requestId, FusedBatchOptions optionsObject);
    private native void nativeUpdateBatchingOptions(int requestId, FusedBatchOptions optionsObject);