Skip to content

Commit

Permalink
properly check notification permissions pre 31
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Mar 27, 2024
1 parent 33550d0 commit 1b5cac1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import android.os.Environment
import android.os.PowerManager
import android.provider.Settings
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityCompat.startActivityForResult
import androidx.core.app.NotificationManagerCompat
import ca.pkay.rcloneexplorer.BuildConfig


Expand Down Expand Up @@ -77,7 +77,7 @@ class PermissionManager(private var mContext: Context) {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
ActivityCompat.checkSelfPermission(mContext, Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED
} else {
true
NotificationManagerCompat.from(mContext).areNotificationsEnabled()
}
}

Expand Down

0 comments on commit 1b5cac1

Please sign in to comment.