madeveloper: fix all lint findings
- Commit
4d99426c57d8cd309fdde6f8b65aebeed596f027- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 04:50 UTC (19 days ago)
- Parents
8b4f2cd
Fix every lint warning reported for the madeveloper module's own sources by :madeveloper:lintDev, now 0 errors / 0 warnings for madeveloper/** (remaining report entries are transitive library findings owned by other clusters).
UseKtx (3): PairingStore now uses the SharedPreferences.edit {} KTX extension instead of edit().putString(...).apply() chains.
No @SuppressLint added; no lint config or baseline changed.
Verified: ./gradlew :madeveloper:lintDev (0 own-module errors/warnings) and :madeveloper:testDevUnitTest green.Diff
madeveloper/src/main/java/com/vayunmathur/madeveloper/platform/PairingStore.kt
diff --git a/madeveloper/src/main/java/com/vayunmathur/madeveloper/platform/PairingStore.kt b/madeveloper/src/main/java/com/vayunmathur/madeveloper/platform/PairingStore.ktindex df0cc56032..17a3787091 100644--- a/madeveloper/src/main/java/com/vayunmathur/madeveloper/platform/PairingStore.kt+++ b/madeveloper/src/main/java/com/vayunmathur/madeveloper/platform/PairingStore.kt@@ -1,6 +1,7 @@ package com.vayunmathur.madeveloper.platform import android.content.Context+import androidx.core.content.edit import com.vayunmathur.madeveloper.domain.DevProtocol /** Persists the pairing code and the server-issued push token for this device. */@@ -9,7 +10,7 @@ class PairingStore(context: Context) { /** The pairing code shown until the server pairs this device. */ fun pairingCode(): String = prefs.getString(KEY_CODE, null) ?: DevProtocol.newPairingCode().also {- prefs.edit().putString(KEY_CODE, it).apply()+ prefs.edit { putString(KEY_CODE, it) } } /** The durable push token, or null while unpaired. */@@ -20,11 +21,11 @@ class PairingStore(context: Context) { /** Stores the credentials from a paired message. */ fun savePaired(token: String, deviceId: String) {- prefs.edit().putString(KEY_TOKEN, token).putString(KEY_DEVICE, deviceId).apply()+ prefs.edit { putString(KEY_TOKEN, token); putString(KEY_DEVICE, deviceId) } } /** Clears pairing so a new code is generated on next launch. */- fun clear() { prefs.edit().clear().apply() }+ fun clear() { prefs.edit { clear() } } private companion object { const val PREFS = "dev_push"