@Override public void start() { this.getGroupContextManager().log(LOG_NAME, this.getContextType() + " Provider Started"); if (!gcm.getBluewaveManager().isScanning()) { startedScan = true; } gcm.getBluewaveManager().startScan(scanInterval); context.registerReceiver(intentReceiver, filter); }
@Override public void sendContext() { sendContext( this.getSubscriptionDeviceIDs(), new String[] { "DEVICES=" + new Gson().toJson(gcm.getBluewaveManager().getNearbyDevices(getRefreshRate())) }); }
@Override public void stop() { if (startedScan) { startedScan = false; gcm.stopBluewaveScan(); } if (this.isInUse()) { context.unregisterReceiver(intentReceiver); } this.getGroupContextManager().log(LOG_NAME, this.getContextType() + " Provider Stopped"); }