Skip to content

Commit

Permalink
Merge pull request #305 from 'CorvexConnectedSafety-lib2.11' into v3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
petermetz committed Aug 23, 2017
2 parents be63d3b + 1f4b83b commit a1ecd80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Binary file modified libs/android/altbeacon.jar
Binary file not shown.
1 change: 1 addition & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
android:isolatedProcess="false"
android:label="iBeacon"
android:name="org.altbeacon.beacon.service.BeaconService">
<meta-data android:name="longScanForcingEnabled" android:value="true" />
</service>
<service android:enabled="true"
android:name="org.altbeacon.beacon.BeaconIntentProcessor">
Expand Down
10 changes: 8 additions & 2 deletions src/android/LocationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class LocationManager extends CordovaPlugin implements BeaconConsumer {
private static final int DEFAULT_FOREGROUND_BETWEEN_SCAN_PERIOD = 0;
private static final String SAMPLE_EXPIRATION_MILLISECOND = "com.unarin.cordova.beacon.android.altbeacon.SampleExpirationMilliseconds";
private static final int DEFAULT_SAMPLE_EXPIRATION_MILLISECOND = 20000;
private static final int DEFAULT_FOREGROUND_SCAN_PERIOD = 200;
private static final int DEFAULT_FOREGROUND_SCAN_PERIOD = 1100;
private static int CDV_LOCATION_MANAGER_DOM_DELEGATE_TIMEOUT = 30;
private static final int BUILD_VERSION_CODES_M = 23;

Expand Down Expand Up @@ -123,6 +123,12 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
Log.i(TAG, "Determined config value FOREGROUND_BETWEEN_SCAN_PERIOD: " +
String.valueOf(foregroundBetweenScanPeriod));

final int foregroundScanPeriod = this.preferences.getInteger(
FOREGROUND_SCAN_PERIOD_NAME, DEFAULT_FOREGROUND_SCAN_PERIOD);

Log.i(TAG, "Determined config value FOREGROUND_SCAN_PERIOD: " +
String.valueOf(foregroundScanPeriod));

iBeaconManager = BeaconManager.getInstanceForApplication(cordovaActivity);
iBeaconManager.setForegroundBetweenScanPeriod(foregroundBetweenScanPeriod);
iBeaconManager.setForegroundScanPeriod(foregroundScanPeriod);
Expand All @@ -133,7 +139,7 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
Log.i(TAG, "Determined config value SAMPLE_EXPIRATION_MILLISECOND: " +
String.valueOf(sampleExpirationMilliseconds));

iBeaconManager.setRssiFilterImplClass(RunningAverageRssiFilter.class);
iBeaconManager.setRssiFilterImplClass(RunningAverageRssiFilter.class);
RunningAverageRssiFilter.setSampleExpirationMilliseconds(sampleExpirationMilliseconds);
RangedBeacon.setSampleExpirationMilliseconds(sampleExpirationMilliseconds);

Expand Down

2 comments on commit a1ecd80

@Ponsen
Copy link

@Ponsen Ponsen commented on a1ecd80 Aug 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build now throws the following error: Error:(126, 19) error: variable foregroundScanPeriod is already defined in method initialize(CordovaInterface,CordovaWebView)

@petermetz
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ponsen Try with v3.5.1
3bb2600

Please sign in to comment.