Skip to content

Commit

Permalink
修复可能导致背景扫描失败的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
qwe7002 committed Nov 30, 2021
1 parent 3eea801 commit bb7eebd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@

<activity android:name=".logcat_activity" />
<!-- uncomment the following to enable scanning for over 30 minutes on Android 7+ -->
<!-- <service
<service
android:name="org.altbeacon.beacon.service.BeaconService"
android:foregroundServiceType="location"
tools:node="replace">
<meta-data
android:name="longScanForcingEnabled"
android:value="true" />
</service>-->
</service>
<service
android:name=".battery_service"
android:enabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public void onCreate() {
beacon_manager.setEnableScheduledScanJobs(false);
beacon_manager.enableForegroundServiceScanning(notification, com.qwe7002.telegram_rc.notify_id.BEACON_SERVICE);
startForeground(com.qwe7002.telegram_rc.notify_id.BEACON_SERVICE, notification);
//noinspection deprecation
BeaconManager.setAndroidLScanningDisabled(false);
beacon_manager.setForegroundScanPeriod(config.delay);
beacon_manager.setForegroundBetweenScanPeriod(2000);
Expand Down

0 comments on commit bb7eebd

Please sign in to comment.