Use JobScheduler to make the "WiFi-only" feature work properly newer Android versions.

I'm considering dropping support for KitKat, as we have now double the code for the same feature.
This commit is contained in:
2017-08-19 08:17:52 +02:00
parent 858651e808
commit 852e38b97d
14 changed files with 211 additions and 93 deletions

View File

@ -174,11 +174,20 @@
android:exported="false"/>
<!-- Receive Wi-Fi connection state changes -->
<receiver android:name=".listener.WifiReceiver">
<receiver android:name=".listener.WifiReceiver" android:enabled="@bool/is_pre_api_21">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<receiver android:name=".service.StartServiceReceiver" android:enabled="@bool/is_post_api_21">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name=".service.StartupNodeOnWifiService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="true"/>
<activity
android:name=".StatusActivity"