Skip to content

Commit

Permalink
IDE-264 Migrate targetSDKVersion 34 (#5026)
Browse files Browse the repository at this point in the history
* IDE-264 Migrate targetSDKVersion 34

* IDE-264 Set ForegroundServiceType for project upload and download
  • Loading branch information
reichli authored Sep 25, 2024
1 parent f4f0115 commit 960df48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion catroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ android {
}

defaultConfig {

minSdkVersion 28
targetSdkVersion 34
applicationId appId
Expand Down
13 changes: 10 additions & 3 deletions catroid/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />

Expand Down Expand Up @@ -83,6 +82,10 @@
android:name="android.hardware.camera"
android:required="false" />

<!-- foreground services -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<application
android:name=".CatroidApplication"
android:allowBackup="false"
Expand Down Expand Up @@ -249,8 +252,12 @@
<activity
android:name=".ui.filepicker.FilePickerActivity" />

<service android:name=".transfers.project.ProjectUploadService" />
<service android:name=".transfers.project.ProjectDownloadService" />
<service
android:name=".transfers.project.ProjectUploadService"
android:foregroundServiceType="dataSync" />
<service
android:name=".transfers.project.ProjectDownloadService"
android:foregroundServiceType="dataSync" />
<service android:name=".transfers.MediaDownloadService" />
<service android:name=".utils.notifications.StatusBarNotificationManager$NotificationActionService" />
<service android:name=".cast.CastService"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class ProjectDownloadService : IntentService("ProjectDownloadService") {
val zipFileString = File(File(CACHE_DIRECTORY, TMP_DIRECTORY_NAME), DOWNLOAD_FILE_NAME).absolutePath
val destinationFile = File(zipFileString)

if ((destinationFile.parentFile.isDirectory or destinationFile.parentFile.mkdirs()).not()) {
if (((destinationFile.parentFile?.isDirectory ?: false) or
(destinationFile.parentFile?.mkdirs() ?: false)).not()) {
ToastUtil.showError(this, R.string.error_project_download)
return
}
Expand Down

0 comments on commit 960df48

Please sign in to comment.