I’m working on an Android app that was previously targeting Android 14 (API level 34) and utilized BOOT_COMPLETED broadcast receivers to launch certain foreground services.
With the update to Android 15 (API level 35), I’m encountering errors due to the new restrictions on foreground service launches.
Any guidance or code examples on addressing these challenges would be greatly appreciated!
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
...
<service
android:name=".NetworkSpeedService"
android:foregroundServiceType="dataSync"
android:process=":network_speed_service" />
<receiver android:name=".BootReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
it’s now throwing ForegroundServiceStartNotAllowedException