Skip to content

Commit

Permalink
Fix bug in Android 14 check with older devices
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Aug 9, 2023
1 parent 92753c1 commit 2e51acd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/main/java/tech/httptoolkit/android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
Log.i(TAG, "Main activity created")

if (
// Should the real value later on
// Should be the real value later on
Build.VERSION.RELEASE == "14" ||
Build.VERSION.RELEASE == "15" || // Reasonable guess for the future
// Or, while it's still in beta:
Build.VERSION.RELEASE_OR_CODENAME == "UpsideDownCake"
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
// Or, while it's still in beta:
Build.VERSION.RELEASE_OR_CODENAME == "UpsideDownCake"
)
) {
val hasSeenWarningAlready = app.popAndroid14WarningState()
if (!hasSeenWarningAlready) showAndroid14Alert()
Expand Down

0 comments on commit 2e51acd

Please sign in to comment.