Skip to content

Commit

Permalink
Bump up the compileSdk version to 31 and add the android corex plugin
Browse files Browse the repository at this point in the history
This will enable us to call methods in the androidx compat libraries
that give users the option to turn off "auto-reset" of permissions for apps
that are not used very often.

Auto-reset permission background:
https://developer.android.com/topic/performance/app-hibernation

The most recent version of the androidx libraries requires API 31
e-mission/e-mission-docs#680 (comment)

This is a workaround to use API 31 in cordova now
apache/cordova-android#1373
  • Loading branch information
shankari committed Oct 30, 2021
1 parent 55f366a commit 300336c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
<framework src="com.google.code.gson:gson:2.8.8"/>
<framework src="com.google.android.gms:play-services-location:$LOCATION_VERSION"/>
<preference name="LOCATION_VERSION" default="18.0.0"/>
<framework src="androidx.core:core:$ANDROIDX_CORE_VERSION"/>
<preference name="ANDROIDX_CORE_VERSION" default="1.7.0"/>

<framework src="src/android/enable_api_31.gradle" custom="true" type="gradleReference" />

<source-file src="src/android/DataCollectionPlugin.java" target-dir="src/edu/berkeley/eecs/emission/cordova/tracker"/>
<source-file src="src/android/BootReceiver.java" target-dir="src/edu/berkeley/eecs/emission/cordova/tracker"/>
Expand Down
7 changes: 7 additions & 0 deletions src/android/enable_api_31.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ext.postBuildExtras = {
android {
defaultConfig {
compileSdkVersion 31
}
}
}

0 comments on commit 300336c

Please sign in to comment.