Skip to content

Commit 2e51acd

Browse files
committed
Fix bug in Android 14 check with older devices
1 parent 92753c1 commit 2e51acd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/main/java/tech/httptoolkit/android/MainActivity.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
106106
Log.i(TAG, "Main activity created")
107107

108108
if (
109-
// Should the real value later on
109+
// Should be the real value later on
110110
Build.VERSION.RELEASE == "14" ||
111111
Build.VERSION.RELEASE == "15" || // Reasonable guess for the future
112-
// Or, while it's still in beta:
113-
Build.VERSION.RELEASE_OR_CODENAME == "UpsideDownCake"
112+
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
113+
// Or, while it's still in beta:
114+
Build.VERSION.RELEASE_OR_CODENAME == "UpsideDownCake"
115+
)
114116
) {
115117
val hasSeenWarningAlready = app.popAndroid14WarningState()
116118
if (!hasSeenWarningAlready) showAndroid14Alert()

0 commit comments

Comments
 (0)