Skip to content

Commit

Permalink
don't show battery exemption notif when GmsCore doesn't have INTERNET
Browse files Browse the repository at this point in the history
  • Loading branch information
muhomorr authored and thestinger committed Nov 27, 2024
1 parent a3b9630 commit 268bd7c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/grapheneos/gmscompat/Notifications.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.app.NotificationManager
import android.app.NotificationManager.IMPORTANCE_HIGH
import android.app.compat.gms.GmsCompat
import android.content.Intent
import android.content.pm.PackageManager
import android.ext.PackageId
import android.net.Uri
import android.os.PowerManager
import android.provider.Settings
Expand Down Expand Up @@ -98,6 +100,11 @@ object Notifications {

val ctx = App.ctx()

if (ctx.packageManager.checkPermission(android.Manifest.permission.INTERNET,
PackageId.GMS_CORE_NAME) != PackageManager.PERMISSION_GRANTED) {
return
}

if (App.preferences().getBoolean(MainProcessPrefs.GmsCore_POWER_EXEMPTION_PROMPT_DISMISSED, false)) {
return
}
Expand Down

0 comments on commit 268bd7c

Please sign in to comment.