Methods Summary |
---|
private void | dispatchDiagnosticData(java.lang.String data)
HashMap<FusedLocationHardwareSink, DispatcherHandler> sinks;
synchronized(mSinkList) {
sinks = mSinkList;
}
for(Map.Entry<FusedLocationHardwareSink, DispatcherHandler> entry : sinks.entrySet()) {
Message message = Message.obtain(
entry.getValue(),
DispatcherHandler.DISPATCH_DIAGNOSTIC_DATA,
new MessageCommand(entry.getKey(), null /*locations*/, data));
message.sendToTarget();
}
|
private void | dispatchLocations(android.location.Location[] locations)
HashMap<FusedLocationHardwareSink, DispatcherHandler> sinks;
synchronized (mSinkList) {
sinks = mSinkList;
}
for(Map.Entry<FusedLocationHardwareSink, DispatcherHandler> entry : sinks.entrySet()) {
Message message = Message.obtain(
entry.getValue(),
DispatcherHandler.DISPATCH_LOCATION,
new MessageCommand(entry.getKey(), locations, null /*data*/));
message.sendToTarget();
}
|
public int | getSupportedBatchSize()
try {
return mLocationHardware.getSupportedBatchSize();
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at getSupportedBatchSize");
return 0;
}
|
public void | injectDeviceContext(int deviceEnabledContext)
try {
mLocationHardware.injectDeviceContext(deviceEnabledContext);
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at injectDeviceContext");
}
|
public void | injectDiagnosticData(java.lang.String data)
try {
mLocationHardware.injectDiagnosticData(data);
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at injectDiagnosticData");
}
|
public void | registerSink(FusedLocationHardwareSink sink, android.os.Looper looper)
if(sink == null || looper == null) {
throw new IllegalArgumentException("Parameter sink and looper cannot be null.");
}
boolean registerSink;
synchronized (mSinkList) {
// register only on first insertion
registerSink = mSinkList.size() == 0;
// guarantee uniqueness
if(mSinkList.containsKey(sink)) {
return;
}
HashMap<FusedLocationHardwareSink, DispatcherHandler> newSinkList =
new HashMap<FusedLocationHardwareSink, DispatcherHandler>(mSinkList);
newSinkList.put(sink, new DispatcherHandler(looper));
mSinkList = newSinkList;
}
if(registerSink) {
try {
mLocationHardware.registerSink(mInternalSink);
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at registerSink");
}
}
|
public void | requestBatchOfLocations(int batchSizeRequest)
try {
mLocationHardware.requestBatchOfLocations(batchSizeRequest);
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at requestBatchOfLocations");
}
|
public void | startBatching(int id, GmsFusedBatchOptions batchOptions)
try {
mLocationHardware.startBatching(id, batchOptions.getParcelableOptions());
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at startBatching");
}
|
public void | stopBatching(int id)
try {
mLocationHardware.stopBatching(id);
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at stopBatching");
}
|
public boolean | supportsDeviceContextInjection()
try {
return mLocationHardware.supportsDeviceContextInjection();
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at supportsDeviceContextInjection");
return false;
}
|
public boolean | supportsDiagnosticDataInjection()
try {
return mLocationHardware.supportsDiagnosticDataInjection();
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at supportsDiagnisticDataInjection");
return false;
}
|
public void | unregisterSink(FusedLocationHardwareSink sink)
if(sink == null) {
throw new IllegalArgumentException("Parameter sink cannot be null.");
}
boolean unregisterSink;
synchronized(mSinkList) {
if(!mSinkList.containsKey(sink)) {
//done
return;
}
HashMap<FusedLocationHardwareSink, DispatcherHandler> newSinkList =
new HashMap<FusedLocationHardwareSink, DispatcherHandler>(mSinkList);
newSinkList.remove(sink);
//unregister after the last sink
unregisterSink = newSinkList.size() == 0;
mSinkList = newSinkList;
}
if(unregisterSink) {
try {
mLocationHardware.unregisterSink(mInternalSink);
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at unregisterSink");
}
}
|
public void | updateBatchingOptions(int id, GmsFusedBatchOptions batchOptions)
try {
mLocationHardware.updateBatchingOptions(id, batchOptions.getParcelableOptions());
} catch(RemoteException e) {
Log.e(TAG, "RemoteException at updateBatchingOptions");
}
|