Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ android {
defaultConfig {
applicationId = "app.grapheneos.apps"
minSdk = 31
targetSdk = 34
targetSdk = 35
versionCode = 27
versionName = versionCode.toString()
resourceConfigurations.add("en")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,9 @@ class PackageDownloadFgService : Service() {
}

override fun onBind(intent: Intent?): IBinder? = null

override fun onTimeout(startId: Int, fgsType: Int) {
super.onTimeout(startId, fgsType)
stopSelf()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior doesn't fit with the service's purpose

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onTimeout is called after 6 hours of background activity, so would it be best to allow it to throw an exception then?
It's probably fair to assume that this service shouldn't be running for very long right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://developer.android.com/about/versions/15/behavior-changes-15#datasync-timeout

We can change the service type from dataSync to specialUse to avoid this API 35 requirement for dataSync. We can't publish this app on the Play Store and it wouldn't make sense to do it since it should update itself, so we don't need to deal with specialUse being approved.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use specialUse in System Updater already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled with 4959168.

}
}
3 changes: 2 additions & 1 deletion app/src/main/java/app/grapheneos/apps/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.content.pm.PackageManager.PERMISSION_GRANTED
import android.os.Build
import android.os.Bundle
import android.view.ViewGroup
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -36,7 +37,7 @@ class MainActivity : AppCompatActivity() {
val views = MainActivityBinding.inflate(layoutInflater)
this.views = views

window.setDecorFitsSystemWindows(false)
enableEdgeToEdge()

ViewCompat.setOnApplyWindowInsetsListener(views.root) { v, insets ->
val paddingInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
Expand Down
Loading