use of org.altbeacon.beacon.service.SettingsData in project android-beacon-library by AltBeacon.
the class BeaconManager method applyChangesToServices.
@TargetApi(18)
private void applyChangesToServices(int type, Region region) throws RemoteException {
if (!isAnyConsumerBound()) {
LogManager.w(TAG, "The BeaconManager is not bound to the service. Call beaconManager.bind(BeaconConsumer consumer) and wait for a callback to onBeaconServiceConnect()");
return;
}
if (mIntentScanStrategyCoordinator != null) {
mIntentScanStrategyCoordinator.applySettings();
return;
}
if (mScheduledScanJobsEnabled) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ScanJobScheduler.getInstance().applySettingsToScheduledJob(mContext, this);
}
return;
}
Message msg = Message.obtain(null, type, 0, 0);
if (type == BeaconService.MSG_SET_SCAN_PERIODS) {
msg.setData(new StartRMData(this.getScanPeriod(), this.getBetweenScanPeriod(), this.mBackgroundMode).toBundle());
} else if (type == BeaconService.MSG_SYNC_SETTINGS) {
msg.setData(new SettingsData().collect(mContext).toBundle());
} else {
msg.setData(new StartRMData(region, callbackPackageName(), getScanPeriod(), getBetweenScanPeriod(), mBackgroundMode).toBundle());
}
serviceMessenger.send(msg);
}
Aggregations