Modern Apps git

← Modern-Apps.git

games-solitaire: fix all lint findings

Commit
1607b933e4ad7fcfbd79cc2609d5613195be0489
Author
Vayun Mathur <[email protected]>
When
2026-11-17 04:43 UTC (19 days ago)
Parents
789492b
Fix the two lint findings owned by games/solitaire so the
module reports 0 errors and 0 warnings/hints in its own
sources (library findings remain out of scope and unchanged).

- AndroidManifest.xml: add android.permission.POST_NOTIFICATIONS.
  The app posts notifications via the shared MaNotifications
  helper, and lint NotificationPermission requires the
  POST_NOTIFICATIONS permission when targeting Android 13+.
  This matches the declaration already used by sibling game
  modules.
- GameConfigDialog.kt: use mutableIntStateOf(4) for spiderSuits
  instead of mutableStateOf(4), fixing the AutoboxingStateCreation
  hint. spiderSuits is an Int (1/2/4) delegated property read as
  Int and passed straight to GameConfig(spiderSuits: Int), so
  the primitive state type is a drop-in replacement; the other
  dialog states keep mutableStateOf as their types are enums
  and Boolean.

Verification:
- Baseline :games:solitaire:lintDev: 2 own findings
  (1 Warning NotificationPermission, 1 Hint
  AutoboxingStateCreation); all other findings under library/.
- After: /tmp/run-gradle-f-solitaire.sh --no-daemon
  :games:solitaire:lintDev :games:solitaire:testDevUnitTest
  BUILD SUCCESSFUL. Parsed lint-results-dev.xml: 69 total
  findings (66 Warning, 3 Hint, all under library/), 0 in
  games/solitaire/** (0 errors, 0 warnings, 0 hints own).
- testDevUnitTest: 175 tests, 0 failures, 0 errors, 0 skipped.
  (First two combined runs were interrupted by the shared
  Gradle daemon receiving a stop command from other work on
  this box, so the final verification used --no-daemon; no
  code/config changes were needed for that.)
- No lint config, baseline, or suppression changes; code and
  manifest only, scoped to games/solitaire/.

Diff

games/solitaire/src/main/AndroidManifest.xml
diff --git a/games/solitaire/src/main/AndroidManifest.xml b/games/solitaire/src/main/AndroidManifest.xmlindex 5e8eab6e8f..bf283aa6e5 100644--- a/games/solitaire/src/main/AndroidManifest.xml+++ b/games/solitaire/src/main/AndroidManifest.xml@@ -6,6 +6,8 @@     <!-- Sensors permission at install instead of auto-granting it. -->     <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" /> +    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />+     <uses-permission android:name="com.vayunmathur.games.hub.permission.READ_GAME_DATA" />     <uses-permission android:name="com.vayunmathur.games.hub.permission.WRITE_GAME_DATA" /> 
games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt
diff --git a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.ktindex 672746e7ac..4541bf2c89 100644--- a/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt+++ b/games/solitaire/src/main/java/com/vayunmathur/games/solitaire/ui/dialogs/GameConfigDialog.kt@@ -12,6 +12,7 @@ import com.vayunmathur.library.ui.SingleChoiceSegmentedButtonRow import com.vayunmathur.library.ui.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue@@ -40,7 +41,7 @@ fun GameConfigDialog(mode: GameMode, onStart: (GameConfig) -> Unit, onDismiss: (     var drawMode by remember { mutableStateOf(DrawMode.DRAW_ONE) }     var klondikeDifficulty by remember { mutableStateOf(KlondikeDifficulty.REGULAR) }     var relaxed by remember { mutableStateOf(false) }-    var spiderSuits by remember { mutableStateOf(4) }+    var spiderSuits by remember { mutableIntStateOf(4) }     AlertDialog(         onDismissRequest = onDismiss,         title = { Text(mode.displayName()) },