Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/flipcash/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ android {

lint {
checkReleaseBuilds = false
checkDependencies = true
baseline = file("lint-baseline.xml")
}

Expand Down
33 changes: 33 additions & 0 deletions apps/flipcash/app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,37 @@
column="31"/>
</issue>

<issue
id="WrongConstant"
message="Must be one or more of: Authenticators.BIOMETRIC_STRONG, Authenticators.BIOMETRIC_WEAK, Authenticators.DEVICE_CREDENTIAL, Authenticators.IDENTITY_CHECK"
errorLine1=" val biometricsState = biometricManager.canAuthenticate(Biometrics.TEST_AUTH)"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/flipcash/app/appsettings/internal/AppSettingsMapper.kt"
line="18"
column="72"/>
</issue>

<issue
id="UnspecifiedRegisterReceiverFlag"
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"
errorLine1=" context.registerReceiver(receiver, filter, SmsRetriever.SEND_PERMISSION, null)"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/flipcash/app/phone/components/SmsOtpAutofill.kt"
line="104"
column="13"/>
</issue>

<issue
id="UnrememberedMutableState"
message="Creating a state object during composition without using `remember`"
errorLine1=" object : State&lt;Float> {"
errorLine2=" ^">
<location
file="src/main/kotlin/com/getcode/ui/components/Flippable.kt"
line="57"
column="9"/>
</issue>

</issues>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.flipcash.shared.chat.ui.media

import android.net.Uri
import android.os.Build
import android.os.ext.SdkExtensions
import android.provider.MediaStore
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.PickVisualMediaRequest
Expand Down Expand Up @@ -30,7 +32,19 @@ fun rememberChatPhotoPicker(
val single = rememberLauncherForActivityResult(ActivityResultContracts.PickVisualMedia()) { uri ->
if (uri != null) currentOnPicked(listOf(uri))
}
val max = remaining.coerceIn(2, maxOf(2, MediaStore.getPickImagesMaxLimit()))
// getPickImagesMaxLimit() only exists where the system picker does (API 33+, or SDK
// extension R 2+). Without it, the open slots are the only cap.
val systemMax = remember {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU ||
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R &&
SdkExtensions.getExtensionVersion(Build.VERSION_CODES.R) >= 2)
) {
MediaStore.getPickImagesMaxLimit()
} else {
null
}
}
val max = maxOf(2, systemMax?.let { minOf(remaining, it) } ?: remaining)
val multiple = rememberLauncherForActivityResult(
ActivityResultContracts.PickMultipleVisualMedia(max),
) { uris ->
Expand Down
Loading