Skip to content

Commit

Permalink
Merge branch 'master' into settings-api
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgyoung committed Oct 17, 2024
2 parents 4c66a41 + de166a0 commit a510e22
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
### 2.21.0-beta1 / 2024-09-01

- Add new Settings API

### 2.20.6 / 2024 04-27
### 2.20.7 / 2024-10-09

- Fix intermittent screen off detection failures on Andorid 14 (#1205, David G. Young)

### 2.20.6 / 2024-04-27

- Fix distance calculator overwrite, (#1191, David G. Young)
- Fix bad model distance config url, (#1190, David G. Young)
Expand Down
7 changes: 5 additions & 2 deletions gradle/publish-mavencentral.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ ext["signing.password"] = project.hasProperty('signing.password') ? project.getP
ext["signing.secretKeyRingFile"] = project.hasProperty('signing.secretKeyRingFile') ? project.getProperty('signing.secretKeyRingFile') : System.getenv('SIGNING_SECRET_KEY_RING_FILE')
ext["ossrhUsername"] = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
ext["ossrhToken"] = project.hasProperty('ossrhToken') ? project.getProperty('ossrhToken') : System.getenv('OSSRH_TOKEN')
ext["ossrhTokenPassword"] = project.hasProperty('ossrhTokenPassword') ? project.getProperty('ossrhTokenPassword') : System.getenv('OSSRH_TOKEN_PASSWORD')

ext["sonatypeStagingProfileId"] = project.hasProperty('sonatypeStagingProfileId') ? project.getProperty('sonatypeStagingProfileId') : System.getenv('SONATYPE_STAGING_PROFILE_ID')


Expand Down Expand Up @@ -106,8 +109,8 @@ afterEvaluate {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username ossrhUsername
password ossrhPassword
username ossrhToken
password ossrhTokenPassword
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class CycledLeScannerForLollipop extends CycledLeScanner {
private boolean mMainScanCycleActive = false;
private final BeaconManager mBeaconManager;
private final PowerManager mPowerManager;
private boolean mScanningStarted = false;

public CycledLeScannerForLollipop(Context context, long scanPeriod, long betweenScanPeriod, boolean backgroundFlag, CycledLeScanCallback cycledLeScanCallback, BluetoothCrashResolver crashResolver) {
super(context, scanPeriod, betweenScanPeriod, backgroundFlag, cycledLeScanCallback, crashResolver);
Expand Down Expand Up @@ -252,7 +253,13 @@ private void postStartLeScan(final List<ScanFilter> filters, final ScanSettings
@Override
public void run() {
try {
if (mScanningStarted) {
LogManager.d(TAG, "Scanning already started stopping to avoid start failure.");
scanner.stopScan(scanCallback);
mScanningStarted = false;
}
scanner.startScan(filters, settings, scanCallback);
mScanningStarted = true;
} catch (IllegalStateException e) {
LogManager.w(TAG, "Cannot start scan. Bluetooth may be turned off.");
} catch (NullPointerException npe) {
Expand All @@ -269,6 +276,7 @@ public void run() {

private void postStopLeScan() {
if (!isBluetoothOn() && Build.VERSION.SDK_INT < Build.VERSION_CODES.P){
mScanningStarted = false;
LogManager.d(TAG, "Not stopping scan because bluetooth is off");
return;
}
Expand All @@ -284,6 +292,7 @@ private void postStopLeScan() {
public void run() {
try {
LogManager.d(TAG, "Stopping LE scan on scan handler");
mScanningStarted = false;
scanner.stopScan(scanCallback);
} catch (IllegalStateException e) {
LogManager.w(TAG, "Cannot stop scan. Bluetooth may be turned off.");
Expand Down

0 comments on commit a510e22

Please sign in to comment.