Search in sources :

Example 6 with IFusedLocationHardwareSink

use of android.hardware.location.IFusedLocationHardwareSink in project platform_frameworks_base by android.

the class FlpHardwareProvider method onLocationReport.

/**
     * Private callback functions used by FLP HAL.
     */
// FlpCallbacks members
private void onLocationReport(Location[] locations) {
    for (Location location : locations) {
        location.setProvider(LocationManager.FUSED_PROVIDER);
        // set the elapsed time-stamp just as GPS provider does
        location.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());
    }
    IFusedLocationHardwareSink sink;
    synchronized (mLocationSinkLock) {
        sink = mLocationSink;
    }
    try {
        if (sink != null) {
            sink.onLocationAvailable(locations);
        }
    } catch (RemoteException e) {
        Log.e(TAG, "RemoteException calling onLocationAvailable");
    }
}
Also used : RemoteException(android.os.RemoteException) Location(android.location.Location) IFusedLocationHardwareSink(android.hardware.location.IFusedLocationHardwareSink)

Example 7 with IFusedLocationHardwareSink

use of android.hardware.location.IFusedLocationHardwareSink in project platform_frameworks_base by android.

the class FlpHardwareProvider method maybeSendCapabilities.

private void maybeSendCapabilities() {
    IFusedLocationHardwareSink sink;
    boolean haveBatchingCapabilities;
    int batchingCapabilities;
    synchronized (mLocationSinkLock) {
        sink = mLocationSink;
        haveBatchingCapabilities = mHaveBatchingCapabilities;
        batchingCapabilities = mBatchingCapabilities;
    }
    try {
        if (sink != null && haveBatchingCapabilities) {
            sink.onCapabilities(batchingCapabilities);
        }
    } catch (RemoteException e) {
        Log.e(TAG, "RemoteException calling onLocationAvailable");
    }
}
Also used : RemoteException(android.os.RemoteException) IFusedLocationHardwareSink(android.hardware.location.IFusedLocationHardwareSink)

Example 8 with IFusedLocationHardwareSink

use of android.hardware.location.IFusedLocationHardwareSink in project android_frameworks_base by AOSPA.

the class FlpHardwareProvider method onLocationReport.

/**
     * Private callback functions used by FLP HAL.
     */
// FlpCallbacks members
private void onLocationReport(Location[] locations) {
    for (Location location : locations) {
        location.setProvider(LocationManager.FUSED_PROVIDER);
        // set the elapsed time-stamp just as GPS provider does
        location.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());
    }
    IFusedLocationHardwareSink sink;
    synchronized (mLocationSinkLock) {
        sink = mLocationSink;
    }
    try {
        if (sink != null) {
            sink.onLocationAvailable(locations);
        }
    } catch (RemoteException e) {
        Log.e(TAG, "RemoteException calling onLocationAvailable");
    }
}
Also used : RemoteException(android.os.RemoteException) Location(android.location.Location) IFusedLocationHardwareSink(android.hardware.location.IFusedLocationHardwareSink)

Example 9 with IFusedLocationHardwareSink

use of android.hardware.location.IFusedLocationHardwareSink in project android_frameworks_base by AOSPA.

the class FlpHardwareProvider method maybeSendCapabilities.

private void maybeSendCapabilities() {
    IFusedLocationHardwareSink sink;
    boolean haveBatchingCapabilities;
    int batchingCapabilities;
    synchronized (mLocationSinkLock) {
        sink = mLocationSink;
        haveBatchingCapabilities = mHaveBatchingCapabilities;
        batchingCapabilities = mBatchingCapabilities;
    }
    try {
        if (sink != null && haveBatchingCapabilities) {
            sink.onCapabilities(batchingCapabilities);
        }
    } catch (RemoteException e) {
        Log.e(TAG, "RemoteException calling onLocationAvailable");
    }
}
Also used : RemoteException(android.os.RemoteException) IFusedLocationHardwareSink(android.hardware.location.IFusedLocationHardwareSink)

Example 10 with IFusedLocationHardwareSink

use of android.hardware.location.IFusedLocationHardwareSink in project android_frameworks_base by ResurrectionRemix.

the class FlpHardwareProvider method onLocationReport.

/**
     * Private callback functions used by FLP HAL.
     */
// FlpCallbacks members
private void onLocationReport(Location[] locations) {
    for (Location location : locations) {
        location.setProvider(LocationManager.FUSED_PROVIDER);
        // set the elapsed time-stamp just as GPS provider does
        location.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());
    }
    IFusedLocationHardwareSink sink;
    synchronized (mLocationSinkLock) {
        sink = mLocationSink;
    }
    try {
        if (sink != null) {
            sink.onLocationAvailable(locations);
        }
    } catch (RemoteException e) {
        Log.e(TAG, "RemoteException calling onLocationAvailable");
    }
}
Also used : RemoteException(android.os.RemoteException) Location(android.location.Location) IFusedLocationHardwareSink(android.hardware.location.IFusedLocationHardwareSink)

Aggregations

IFusedLocationHardwareSink (android.hardware.location.IFusedLocationHardwareSink)10 RemoteException (android.os.RemoteException)10 Location (android.location.Location)5