Fix check IBO resut

This commit is contained in:
世界 2024-12-03 12:17:04 +08:00
parent 95401743e9
commit 6c1f49a00e
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -1,7 +1,6 @@
package io.nekohasekai.sfa.ui.main package io.nekohasekai.sfa.ui.main
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
@ -48,8 +47,8 @@ class SettingsFragment : Fragment() {
private val requestIgnoreBatteryOptimizations = registerForActivityResult( private val requestIgnoreBatteryOptimizations = registerForActivityResult(
ActivityResultContracts.StartActivityForResult() ActivityResultContracts.StartActivityForResult()
) { result -> ) { result ->
if (result.resultCode == Activity.RESULT_OK) { if (Application.powerManager.isIgnoringBatteryOptimizations(Application.application.packageName)) {
binding.backgroundPermissionCard.isVisible = false binding.backgroundPermissionCard.isGone = true
} }
} }