Modern Apps git

← Modern-Apps.git

games-pipes: fix all lint findings

Commit
789492b550a970e9f45756f3b97798846f191bd2
Author
Vayun Mathur <[email protected]>
When
2026-11-17 04:45 UTC (19 days ago)
Parents
19025bd
Fix the sole own-module lint finding in games/pipes: an
InlinedApi warning at SettingsScreen.kt:30 for referencing
Manifest.permission.POST_NOTIFICATIONS (added in API 33)
while minSdk is 31.

Apply the flashcards SettingsPage.kt pattern: resolve the
permission name behind a Build.VERSION.SDK_INT >=
TIRAMISU guard, falling back to an empty string below
API 33. POST_NOTIFICATIONS is a String constant inlined
at compile time, so the guarded reference is safe, and
the permission is only actually requested on API 33+
in setReminderEnabled, which already has the same guard.
No behaviour change on any API level. No lint config,
baseline or suppression was added.

Verification:
- Baseline :games:pipes:lintDev: 0 errors, 67 warnings,
  3 hints total, of which 1 own (games/pipes) warning:
  InlinedApi at SettingsScreen.kt:30. The remaining
  findings were all in library/** and are out of scope.
- After: :games:pipes:lintDev passes with 0 errors,
  66 warnings, 3 hints total, and 0/0/0 errors/warnings/
  hints in games/pipes/** (all remaining findings are
  in library/**, ignored per task scope).
- :games:pipes:testDevUnitTest passes: 134 tests,
  0 failures, 0 errors, 0 skipped (24 suites). The
  first two attempts were aborted by a shared Gradle
  daemon stop from other work on this box, so the
  passing run used --no-daemon via the wrapper script.

Diff

games/pipes/src/main/java/com/vayunmathur/games/pipes/ui/SettingsScreen.kt
diff --git a/games/pipes/src/main/java/com/vayunmathur/games/pipes/ui/SettingsScreen.kt b/games/pipes/src/main/java/com/vayunmathur/games/pipes/ui/SettingsScreen.ktindex 9a46679952..94893ab8b8 100644--- a/games/pipes/src/main/java/com/vayunmathur/games/pipes/ui/SettingsScreen.kt+++ b/games/pipes/src/main/java/com/vayunmathur/games/pipes/ui/SettingsScreen.kt@@ -27,7 +27,14 @@ fun SettingsPage(backStack: NavBackStack<Route>, viewModel: PipesViewModel) {     val reminderEnabled by viewModel.reminderEnabled.collectAsState()     val reminderMinutes by viewModel.reminderMinutesOfDay.collectAsState() -    val requestNotifications = rememberPermissionRequest(Manifest.permission.POST_NOTIFICATIONS)+    // POST_NOTIFICATIONS is a String constant inlined at compile time, so referencing+    // it below API 33 is safe; it is only requested on API 33+ (see setReminderEnabled).+    val notificationPermission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {+        Manifest.permission.POST_NOTIFICATIONS+    } else {+        ""+    }+    val requestNotifications = rememberPermissionRequest(notificationPermission)      SettingsScreen(         state = SettingsUiState(