Upgrade to kotlin 2.1.0

This commit is contained in:
Greyson Parrelli
2024-12-20 11:23:57 -05:00
parent 859eabe3d3
commit 7b101e13fb
22 changed files with 297 additions and 25 deletions

View File

@@ -19,7 +19,6 @@ import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.IOException
import java.util.Optional
import javax.annotation.meta.Exhaustive
/**
* Renders Avatar objects into Media objects. This can involve creating a Bitmap, depending on the
@@ -39,7 +38,6 @@ object AvatarRenderer {
}
fun renderAvatar(context: Context, avatar: Avatar, onAvatarRendered: (Media) -> Unit, onRenderFailed: (Throwable?) -> Unit) {
@Exhaustive
when (avatar) {
is Avatar.Resource -> renderResource(context, avatar, onAvatarRendered, onRenderFailed)
is Avatar.Vector -> renderVector(context, avatar, onAvatarRendered, onRenderFailed)

View File

@@ -24,7 +24,6 @@ import androidx.navigation.Navigation
import androidx.navigation.fragment.navArgs
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import app.cash.exhaustive.Exhaustive
import com.google.android.flexbox.FlexboxLayoutManager
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
@@ -286,7 +285,6 @@ class ConversationSettingsFragment : DSLSettingsFragment(
lifecycleDisposable.bindTo(viewLifecycleOwner)
lifecycleDisposable += viewModel.events.subscribe { event ->
@Exhaustive
when (event) {
is ConversationSettingsEvent.AddToAGroup -> handleAddToAGroup(event)
is ConversationSettingsEvent.AddMembersToGroup -> handleAddMembersToGroup(event)

View File

@@ -1,6 +1,5 @@
package org.thoughtcrime.securesms.database
import app.cash.exhaustive.Exhaustive
import org.thoughtcrime.securesms.database.model.RecipientRecord
import org.thoughtcrime.securesms.recipients.RecipientId
import org.whispersystems.signalservice.api.push.ServiceId
@@ -49,7 +48,6 @@ data class PnpDataSet(
val records: MutableSet<RecipientRecord> = listOfNotNull(e164Record, pniRecord, aciRecord).toMutableSet()
for (operation in operations) {
@Exhaustive
when (operation) {
is PnpOperation.RemoveE164 -> {
records.replace(operation.recipientId) { it.copy(e164 = null) }

View File

@@ -8,7 +8,6 @@ import android.net.Uri
import android.text.TextUtils
import androidx.annotation.VisibleForTesting
import androidx.core.content.contentValuesOf
import app.cash.exhaustive.Exhaustive
import okio.ByteString.Companion.toByteString
import org.signal.core.util.Base64
import org.signal.core.util.Bitmask
@@ -2470,7 +2469,6 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
var changedNumberId: RecipientId? = null
for (operation in changeSet.operations) {
@Exhaustive
when (operation) {
is PnpOperation.RemoveE164,
is PnpOperation.RemovePni,
@@ -2507,7 +2505,6 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
fun writePnpChangeSetToDisk(changeSet: PnpChangeSet, inputPni: PNI?, pniVerified: Boolean): RecipientId {
var hadThreadMerge = false
for (operation in changeSet.operations) {
@Exhaustive
when (operation) {
is PnpOperation.RemoveE164 -> {
writableDatabase

View File

@@ -7,7 +7,6 @@ import androidx.activity.OnBackPressedCallback
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import app.cash.exhaustive.Exhaustive
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import io.reactivex.rxjava3.core.Flowable
import org.signal.core.util.concurrent.LifecycleDisposable
@@ -62,7 +61,6 @@ class MediaCaptureFragment : Fragment(R.layout.fragment_container), CameraFragme
.commitNowAllowingStateLoss()
lifecycleDisposable += viewModel.events.subscribe { event ->
@Exhaustive
when (event) {
MediaCaptureEvent.MediaCaptureRenderFailed -> {
Log.w(TAG, "Failed to render captured media.")

View File

@@ -8,7 +8,6 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.ItemTouchHelper
import app.cash.exhaustive.Exhaustive
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import org.signal.core.util.concurrent.LifecycleDisposable
import org.thoughtcrime.securesms.R
@@ -72,7 +71,6 @@ class MediaSelectionGalleryFragment : Fragment(R.layout.fragment_container), Med
}
private fun handleError(error: MediaValidator.FilterError) {
@Exhaustive
when (error) {
MediaValidator.FilterError.None -> return
MediaValidator.FilterError.ItemTooLarge -> Toast.makeText(requireContext(), R.string.MediaReviewFragment__one_or_more_items_were_too_large, Toast.LENGTH_SHORT).show()

View File

@@ -29,7 +29,6 @@ import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import app.cash.exhaustive.Exhaustive
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.imageview.ShapeableImageView
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
@@ -443,7 +442,6 @@ class MediaReviewFragment : Fragment(R.layout.v2_media_review_fragment), Schedul
}
private fun handleMediaValidatorFilterError(error: MediaValidator.FilterError) {
@Exhaustive
when (error) {
MediaValidator.FilterError.None -> return
MediaValidator.FilterError.ItemTooLarge -> Toast.makeText(requireContext(), R.string.MediaReviewFragment__one_or_more_items_were_too_large, Toast.LENGTH_SHORT).show()