Skip to content

Commit

Permalink
Fix InlinedApi lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sabercodic committed Oct 4, 2023
1 parent 53b7f1c commit d36ce06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
11 changes: 0 additions & 11 deletions android/app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,6 @@
column="74"/>
</issue>

<issue
id="InlinedApi"
message="Field requires API level 33 (current min is 26): `android.Manifest.permission#POST_NOTIFICATIONS`"
errorLine1=" requestNotificationPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt"
line="359"
column="58"/>
</issue>

<issue
id="RedundantLabel"
message="Redundant label can be removed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.content.Intent
import android.content.pm.ActivityInfo
import android.content.res.Configuration
import android.net.VpnService
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.WindowManager
Expand Down Expand Up @@ -351,8 +352,10 @@ open class MainActivity : FragmentActivity() {
}

private fun checkForNotificationPermission() {
if (isNotificationPermissionGranted().not()) {
requestNotificationPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)
if (!isNotificationPermissionGranted().not()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
requestNotificationPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)
}
}
}

Expand Down

0 comments on commit d36ce06

Please sign in to comment.