FileDocCategorySizeDatePackage
FusedLocationHardwareSecure.javaAPI DocAndroid 5.1 API3897Thu Mar 12 22:22:42 GMT 2015com.android.server.location

FusedLocationHardwareSecure

public class FusedLocationHardwareSecure extends IFusedLocationHardware.Stub
FusedLocationHardware decorator that adds permission checking.
hide

Fields Summary
private final android.hardware.location.IFusedLocationHardware
mLocationHardware
private final android.content.Context
mContext
private final String
mPermissionId
Constructors Summary
public FusedLocationHardwareSecure(android.hardware.location.IFusedLocationHardware locationHardware, android.content.Context context, String permissionId)

        mLocationHardware = locationHardware;
        mContext = context;
        mPermissionId = permissionId;
    
Methods Summary
private voidcheckPermissions()

        mContext.enforceCallingPermission(
                mPermissionId,
                String.format(
                        "Permission '%s' not granted to access FusedLocationHardware",
                        mPermissionId));
    
public intgetSupportedBatchSize()

        checkPermissions();
        return mLocationHardware.getSupportedBatchSize();
    
public voidinjectDeviceContext(int deviceEnabledContext)

        checkPermissions();
        mLocationHardware.injectDeviceContext(deviceEnabledContext);
    
public voidinjectDiagnosticData(java.lang.String data)

        checkPermissions();
        mLocationHardware.injectDiagnosticData(data);
    
public voidregisterSink(android.hardware.location.IFusedLocationHardwareSink eventSink)

        checkPermissions();
        mLocationHardware.registerSink(eventSink);
    
public voidrequestBatchOfLocations(int batchSizeRequested)

        checkPermissions();
        mLocationHardware.requestBatchOfLocations(batchSizeRequested);
    
public voidstartBatching(int id, android.location.FusedBatchOptions batchOptions)

        checkPermissions();
        mLocationHardware.startBatching(id, batchOptions);
    
public voidstopBatching(int id)

        checkPermissions();
        mLocationHardware.stopBatching(id);
    
public booleansupportsDeviceContextInjection()

        checkPermissions();
        return mLocationHardware.supportsDeviceContextInjection();
    
public booleansupportsDiagnosticDataInjection()

        checkPermissions();
        return mLocationHardware.supportsDiagnosticDataInjection();
    
public voidunregisterSink(android.hardware.location.IFusedLocationHardwareSink eventSink)

        checkPermissions();
        mLocationHardware.unregisterSink(eventSink);
    
public voidupdateBatchingOptions(int id, android.location.FusedBatchOptions batchoOptions)

        checkPermissions();
        mLocationHardware.updateBatchingOptions(id, batchoOptions);