Skip to content

Commit 75afa44

Browse files
authored
ci(lint): lint library modules from the app's lintDebug (#1743)
* fix(chat): guard MediaStore.getPickImagesMaxLimit on older pickers rememberChatPhotoPicker called getPickImagesMaxLimit() during composition with no version check. The method exists only on API 33+, or on API 30-32 with SDK extension R 2+, so an Android 12 device without the MediaProvider update threw NoSuchMethodError every time a chat opened (Bugsnag 6ac91865991833fd09984195, Samsung SM-N976V). Only call it where the system picker provides it. Elsewhere androidx falls back to a picker with no cap of its own, and the result callback already trims the selection to the remaining slots. * fix(chat): cap the fallback photo picker at the open slots Int.MAX_VALUE never reached the picker, since the clamp came out to remaining anyway, but it read as no cap. Fall back to remaining directly. * ci(lint): lint library modules from the app's lintDebug CI runs :apps:flipcash:app:lintDebug, but checkDependencies defaults to false, so lint only looked at the app module. The unguarded MediaStore.getPickImagesMaxLimit() call in chat-ui (#1741) shipped because no lint run ever saw it; with checkDependencies on, lint fails on it with NewApi. Turning it on surfaces three other existing errors, which go in the baseline so the check gates new issues only: WrongConstant in AppSettingsMapper, UnspecifiedRegisterReceiverFlag in SmsOtpAutofill (the pre-34 branch, where the flag isn't available), and UnrememberedMutableState in Flippable.
1 parent 59fc672 commit 75afa44

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

‎apps/flipcash/app/build.gradle.kts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ android {
115115

116116
lint {
117117
checkReleaseBuilds = false
118+
checkDependencies = true
118119
baseline = file("lint-baseline.xml")
119120
}
120121

‎apps/flipcash/app/lint-baseline.xml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,4 +377,37 @@
377377
column="31"/>
378378
</issue>
379379

380+
<issue
381+
id="WrongConstant"
382+
message="Must be one or more of: Authenticators.BIOMETRIC_STRONG, Authenticators.BIOMETRIC_WEAK, Authenticators.DEVICE_CREDENTIAL, Authenticators.IDENTITY_CHECK"
383+
errorLine1=" val biometricsState = biometricManager.canAuthenticate(Biometrics.TEST_AUTH)"
384+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
385+
<location
386+
file="src/main/kotlin/com/flipcash/app/appsettings/internal/AppSettingsMapper.kt"
387+
line="18"
388+
column="72"/>
389+
</issue>
390+
391+
<issue
392+
id="UnspecifiedRegisterReceiverFlag"
393+
message="`receiver` is missing `RECEIVER_EXPORTED` or `RECEIVER_NOT_EXPORTED` flag for unprotected broadcasts registered for com.google.android.gms.auth.api.phone.SMS_RETRIEVED"
394+
errorLine1=" context.registerReceiver(receiver, filter, SmsRetriever.SEND_PERMISSION, null)"
395+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
396+
<location
397+
file="src/main/kotlin/com/flipcash/app/phone/components/SmsOtpAutofill.kt"
398+
line="104"
399+
column="13"/>
400+
</issue>
401+
402+
<issue
403+
id="UnrememberedMutableState"
404+
message="Creating a state object during composition without using `remember`"
405+
errorLine1=" object : State&lt;Float> {"
406+
errorLine2=" ^">
407+
<location
408+
file="src/main/kotlin/com/getcode/ui/components/Flippable.kt"
409+
line="57"
410+
column="9"/>
411+
</issue>
412+
380413
</issues>

0 commit comments

Comments
 (0)