Skip to content

Commit

Permalink
🛂 Manifest-related changes to support the foreground service in andro…
Browse files Browse the repository at this point in the history
…id 14

This addresses a couple of the issues in
e-mission/e-mission-docs#1079 (comment)

❌ If apps that target Android 14 use a foreground service, they must declare a
specific permission, based on the foreground service type, that Android 14
introduces.

**FIXed by**

✔️  Added `FOREGROUND_SERVICE_HEALTH` and `FOREGROUND_SERVICE_LOCATION` permissions

❌ ACTIVITY_RECOGNITION permission seems to imply health as part of the foreground service as well

**FIXed by**

✔️  Changed the type to `android:foregroundServiceType="location|health"`

Bumped up the plugin version as well
  • Loading branch information
shankari committed Aug 26, 2024
1 parent 68d7f83 commit 271bfc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="cordova-plugin-em-datacollection"
version="1.8.8">
version="1.8.9">

<name>DataCollection</name>
<description>Background data collection FTW! This is the part that I really
Expand Down Expand Up @@ -54,6 +54,8 @@
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<!-- COARSE_LOCATION obfuscates the location to a city block, change to FINE_LOCATION for accuracy -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
Expand Down Expand Up @@ -109,7 +111,7 @@
<service
android:name="edu.berkeley.eecs.emission.cordova.tracker.location.TripDiaryStateMachineForegroundService"
android:enabled="true"
android:foregroundServiceType="location"
android:foregroundServiceType="location|health"
android:exported="false">
</service>
<service
Expand Down

0 comments on commit 271bfc3

Please sign in to comment.