Skip to content

Commit 61d7fac

Browse files
Merge pull request #151 from RADAR-base/target-sdk-34
Updated Radar-prmt to Target SDK 34 (Android 14)
2 parents 7ddc94e + 74680a7 commit 61d7fac

7 files changed

Lines changed: 37 additions & 11 deletions

File tree

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ android {
1010
defaultConfig {
1111
applicationId "org.radarcns.detail"
1212
minSdkVersion 26
13-
targetSdkVersion 33
14-
versionCode 62
15-
versionName "1.2.1"
13+
targetSdkVersion 34
14+
versionCode 69
15+
versionName "1.2.7"
1616
manifestPlaceholders = ["appAuthRedirectScheme": "org.radarbase.passive.app"]
1717
multiDexEnabled true
1818
ndkVersion "25.2.9519653"
@@ -101,7 +101,7 @@ dependencies {
101101
implementation "org.radarbase:radar-android-weather:$radar_commons_android_version"
102102
implementation "org.radarbase:radar-android-audio:$radar_commons_android_version"
103103
implementation "org.radarbase:radar-android-faros:$radar_commons_android_version"
104-
implementation "org.radarbase:radar-android-polar:$radar_commons_android_version"
104+
// implementation "org.radarbase:radar-android-polar:$radar_commons_android_version"
105105
implementation "org.radarbase:radar-android-google-sleep:$radar_commons_android_version"
106106
implementation "org.radarbase:radar-android-google-activity:$radar_commons_android_version"
107107
implementation "org.radarbase:radar-android-google-places:$radar_commons_android_version"

app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
1919
<uses-permission android:name="android.permission.WAKE_LOCK" />
2020

21+
<!-- Foreground service types permissions (for targeting devices running on android 14 and above) -->
22+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
23+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
24+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />
25+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
26+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
27+
2128
<supports-screens android:largeScreens="true"
2229
android:xlargeScreens="true" />
2330

@@ -117,7 +124,13 @@
117124
android:name=".SettingsActivity"
118125
android:screenOrientation="userPortrait"
119126
android:parentActivityName=".MainActivityImpl" />
120-
<service android:name=".RadarServiceImpl" />
127+
128+
<service
129+
android:name=".RadarServiceImpl"
130+
android:exported="false"
131+
android:foregroundServiceType="dataSync|health|location|microphone|connectedDevice" >
132+
</service>
133+
121134
<service android:name=".AuthServiceImpl" />
122135

123136
<!--

app/src/main/java/org/radarcns/detail/PrivacyPolicyFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class PrivacyPolicyFragment : Fragment() {
3838
projectId = args.getString(PROJECT_ID_KEY)
3939
userId = args.getString(USER_ID_KEY)
4040
baseUrl = args.getString(BASE_URL_PROPERTY)
41-
privacyPolicyUrl = args.getString(PRIVACY_POLICY_URL_PROPERTY)
42-
dataCollectionUrl = args.getString(PRIVACY_POLICY)
41+
privacyPolicyUrl = args.getString(PRIVACY_POLICY) //args.getString(PRIVACY_POLICY_URL_PROPERTY)
42+
dataCollectionUrl = "https://radar-base.org/docs/4048-2/"
4343
}
4444

4545
override fun onCreateView(

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,5 @@
152152
<string name="reject_privacy_policy_button">Reject</string>
153153
<string name="consent">Consent</string>
154154
<string name="filter_split_regex">,</string>
155+
<string name="special_fgs_explanation">RadarService operates with plugins and modules that may need permissions beyond standard foreground service types. Defining a special use subtype ensures compliance with Android’s requirements for permissions that may vary dynamically based on active plugins</string>
155156
</resources>

app/src/playStore/java/org/radarcns/detail/RadarServiceImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import org.radarbase.passive.phone.PhoneContactListProvider
3535
import org.radarbase.passive.phone.PhoneLocationProvider
3636
import org.radarbase.passive.phone.PhoneSensorProvider
3737
import org.radarbase.passive.phone.audio.input.PhoneAudioInputProvider
38-
import org.radarbase.passive.polar.PolarProvider
38+
//import org.radarbase.passive.polar.PolarProvider
3939
import org.radarbase.passive.phone.usage.PhoneUsageProvider
4040
import org.radarbase.passive.weather.WeatherApiProvider
4141

@@ -45,7 +45,7 @@ class RadarServiceImpl : RadarService() {
4545
OpenSmileAudioProvider(this),
4646
E4Provider(this),
4747
FarosProvider(this),
48-
PolarProvider(this),
48+
// PolarProvider(this),
4949
PhoneBluetoothProvider(this),
5050
PhoneContactListProvider(this),
5151
PhoneLocationProvider(this),

app/src/selfRelease/AndroidManifest.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
<!-- TODO: Check if necessary -->
2323
<uses-permission android:name="android.permission.SET_ALARM"/>
2424

25+
<!-- Foreground service types permissions (for targeting devices running on android 14 and above) -->
26+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
27+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
28+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />
29+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
30+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
31+
2532
<supports-screens android:largeScreens="true"
2633
android:xlargeScreens="true" />
2734

@@ -121,7 +128,12 @@
121128
android:screenOrientation="userPortrait"
122129
android:parentActivityName=".MainActivityImpl" />
123130

124-
<service android:name=".RadarServiceImpl" />
131+
<service
132+
android:name=".RadarServiceImpl"
133+
android:exported="false"
134+
android:foregroundServiceType="dataSync|health|location|microphone|connectedDevice" >
135+
</service>
136+
125137
<service android:name=".AuthServiceImpl" />
126138

127139
<receiver android:name=".UpdateAlarmReceiver" />

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ android.defaults.buildfeatures.buildconfig=true
2121
android.useAndroidX=true
2222
android.enableJetifier=true
2323

24-
radar_commons_android_version=1.2.5
24+
radar_commons_android_version=1.4.1-SNAPSHOT
2525

2626
kotlin_version=1.9.24
2727
gradle_version=8.6

0 commit comments

Comments
 (0)