Replace deprecated getParcelable* methods with compat versions (#3633)

This commit is contained in:
Konrad Pozniak 2023-06-11 12:58:55 +02:00 committed by GitHub
parent 8e87b5d465
commit 85b7caa887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 148 additions and 219 deletions

View file

@ -1,39 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.4.2" type="baseline" client="gradle" dependencies="false" name="AGP (7.4.2)" variant="all" version="7.4.2">
<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
errorLine1=" notificationManager.notify(notificationId, builder.build());"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="263"
column="9"/>
</issue>
<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
errorLine1=" notificationManager.notify((int) account.getId(), builder.setGroupSummary(true).build());"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="265"
column="13"/>
</issue>
<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
errorLine1=" notificationManager.notify((int) account.getId(), summaryBuilder.build());"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="267"
column="13"/>
</issue>
<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
@ -403,17 +370,6 @@
column="5"/>
</issue>
<issue
id="MissingQuantity"
message="For locale &quot;fr&quot; (French) the following quantities should also be defined: `many` (e.g. &quot;1000000 de jours&quot;), `one` (e.g. &quot;1 jour&quot;)"
errorLine1=" &lt;plurals name=&quot;hint_describe_for_visually_impaired&quot;>"
errorLine2=" ^">
<location
file="src/main/res/values-fr/strings.xml"
line="288"
column="5"/>
</issue>
<issue
id="MissingQuantity"
message="For locale &quot;ga&quot; (Irish) the following quantities should also be defined: `few` (e.g. &quot;3 cinn, 3 huaire, 3 chat, 3 éan, 3 bhróg&quot;), `many` (e.g. &quot;7 gcinn, 7 n-uaire, 7 gcat, 7 n-éan, 7 mbróg&quot;), `one` (e.g. &quot;1 cheann, 1 uair, 1 chat, 1 éan, 1 bhróg&quot;), `two` (e.g. &quot;2 cheann, 2 uair, 2 chat, 2 éan, 2 bhróig&quot;)"
@ -828,7 +784,7 @@
errorLine2=" ^">
<location
file="src/main/res/values-tr/strings.xml"
line="581"
line="579"
column="293"/>
</issue>
@ -1697,7 +1653,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="745"
line="826"
column="57"/>
</issue>
@ -2258,7 +2214,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/donottranslate.xml"
line="260"
line="262"
column="19"/>
</issue>
@ -2269,7 +2225,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/donottranslate.xml"
line="265"
line="267"
column="19"/>
</issue>
@ -2973,7 +2929,7 @@
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/accountlist/AccountListFragment.kt"
line="125"
line="133"
column="17"/>
</issue>
@ -3160,7 +3116,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt"
line="544"
line="552"
column="21"/>
</issue>
@ -3171,7 +3127,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt"
line="553"
line="561"
column="17"/>
</issue>
@ -3182,7 +3138,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/compose/ComposeActivity.kt"
line="553"
line="561"
column="17"/>
</issue>
@ -3270,7 +3226,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/filters/EditFilterActivity.kt"
line="106"
line="107"
column="17"/>
</issue>
@ -3281,7 +3237,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/filters/EditFilterActivity.kt"
line="106"
line="107"
column="17"/>
</issue>
@ -3292,7 +3248,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/filters/EditFilterActivity.kt"
line="116"
line="117"
column="17"/>
</issue>
@ -3303,7 +3259,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/filters/EditFilterActivity.kt"
line="116"
line="117"
column="17"/>
</issue>
@ -3666,7 +3622,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="143"
line="146"
column="17"/>
</issue>
@ -3677,7 +3633,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="143"
line="146"
column="17"/>
</issue>
@ -3688,7 +3644,7 @@
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="152"
line="155"
column="17"/>
</issue>
@ -3699,7 +3655,7 @@
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="152"
line="155"
column="17"/>
</issue>
@ -3710,7 +3666,7 @@
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="173"
line="176"
column="25"/>
</issue>
@ -3719,17 +3675,6 @@
message="Access to `private` method `sendResult` of class `LoginWebViewActivity` requires synthetic accessor"
errorLine1=" sendResult(LoginResult.Err(error))"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="173"
column="25"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `sendResult` of class `LoginWebViewActivity` requires synthetic accessor"
errorLine1=" sendResult(LoginResult.Ok(code))"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="176"
@ -3743,7 +3688,18 @@
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="176"
line="179"
column="25"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `sendResult` of class `LoginWebViewActivity` requires synthetic accessor"
errorLine1=" sendResult(LoginResult.Ok(code))"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/login/LoginWebViewActivity.kt"
line="179"
column="25"/>
</issue>
@ -4469,7 +4425,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt"
line="185"
line="186"
column="26"/>
</issue>
@ -4480,7 +4436,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt"
line="213"
line="227"
column="21"/>
</issue>
@ -4491,7 +4447,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt"
line="215"
line="229"
column="29"/>
</issue>
@ -4579,7 +4535,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/timeline/TimelineFragment.kt"
line="267"
line="266"
column="21"/>
</issue>
@ -4590,7 +4546,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/timeline/TimelineFragment.kt"
line="270"
line="269"
column="33"/>
</issue>
@ -4601,7 +4557,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/timeline/TimelineFragment.kt"
line="272"
line="271"
column="33"/>
</issue>
@ -4612,7 +4568,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/timeline/TimelineFragment.kt"
line="278"
line="277"
column="21"/>
</issue>
@ -4638,50 +4594,6 @@
column="29"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `formatNumber` of class `Companion` requires synthetic accessor"
errorLine1=" binding.totalUsage.text = formatNumber(tagViewData.usage.sum())"
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/trending/TrendingTagViewHolder.kt"
line="40"
column="35"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `formatNumber` of class `Companion` requires synthetic accessor"
errorLine1=" binding.totalUsage.text = formatNumber(tagViewData.usage.sum())"
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/trending/TrendingTagViewHolder.kt"
line="40"
column="35"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `formatNumber` of class `Companion` requires synthetic accessor"
errorLine1=" binding.totalAccounts.text = formatNumber(totalAccounts)"
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/trending/TrendingTagViewHolder.kt"
line="43"
column="38"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `formatNumber` of class `Companion` requires synthetic accessor"
errorLine1=" binding.totalAccounts.text = formatNumber(totalAccounts)"
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/trending/TrendingTagViewHolder.kt"
line="43"
column="38"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `getBinding` of class `ViewImageFragment` requires synthetic accessor"
@ -4689,7 +4601,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/fragment/ViewImageFragment.kt"
line="187"
line="188"
column="25"/>
</issue>
@ -4700,7 +4612,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/fragment/ViewImageFragment.kt"
line="272"
line="273"
column="54"/>
</issue>
@ -4711,7 +4623,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/fragment/ViewImageFragment.kt"
line="286"
line="287"
column="17"/>
</issue>
@ -4722,7 +4634,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/fragment/ViewImageFragment.kt"
line="294"
line="295"
column="17"/>
</issue>
@ -4733,7 +4645,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt"
line="120"
line="121"
column="17"/>
</issue>
@ -4744,7 +4656,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt"
line="120"
line="121"
column="41"/>
</issue>
@ -4755,7 +4667,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt"
line="120"
line="121"
column="41"/>
</issue>
@ -4766,7 +4678,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt"
line="148"
line="149"
column="41"/>
</issue>
@ -4777,7 +4689,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt"
line="191"
line="192"
column="21"/>
</issue>
@ -5188,6 +5100,13 @@
column="55"/>
</issue>
<issue
id="ConvertToWebp"
message="One or more images in this project can be converted to the WebP format which typically results in smaller file sizes, even for lossless conversion">
<location
file="src/blue/res/mipmap-xxxhdpi/ic_launcher.png"/>
</issue>
<issue
id="SelectableText"
message="Consider making the text value selectable by specifying `android:textIsSelectable=&quot;true&quot;`"
@ -6834,7 +6753,7 @@
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/db/AppDatabase.java"
line="37"
line="53"
column="21"/>
</issue>
@ -6845,7 +6764,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/db/AppDatabase.java"
line="38"
line="54"
column="21"/>
</issue>
@ -6856,7 +6775,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/db/AppDatabase.java"
line="39"
line="55"
column="21"/>
</issue>
@ -6867,7 +6786,7 @@
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/db/AppDatabase.java"
line="40"
line="56"
column="21"/>
</issue>
@ -6878,7 +6797,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/db/AppDatabase.java"
line="41"
line="57"
column="21"/>
</issue>
@ -6889,7 +6808,7 @@
errorLine2=" ~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/db/AppDatabase.java"
line="373"
line="389"
column="31"/>
</issue>
@ -6977,7 +6896,7 @@
errorLine2=" ~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/BaseActivity.java"
line="233"
line="240"
column="36"/>
</issue>
@ -6988,41 +6907,85 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/BaseActivity.java"
line="233"
line="240"
column="58"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static void make(final Context context, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~">
errorLine1=" public static android.app.Notification make(final Context context, NotificationManager notificationManager, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="139"
column="35"/>
line="151"
column="55"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static void make(final Context context, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~~~~~~">
errorLine1=" public static android.app.Notification make(final Context context, NotificationManager notificationManager, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="139"
column="52"/>
line="151"
column="72"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static void make(final Context context, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~~~~~~~">
errorLine1=" public static android.app.Notification make(final Context context, NotificationManager notificationManager, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="139"
column="71"/>
line="151"
column="113"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static android.app.Notification make(final Context context, NotificationManager notificationManager, Notification body, AccountEntity account, boolean isFirstOfBatch) {"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="151"
column="132"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static void updateSummaryNotifications(Context context, NotificationManager notificationManager, AccountEntity account) {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="273"
column="51"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static void updateSummaryNotifications(Context context, NotificationManager notificationManager, AccountEntity account) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="273"
column="68"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static void updateSummaryNotifications(Context context, NotificationManager notificationManager, AccountEntity account) {"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="273"
column="109"/>
</issue>
<issue
@ -7032,7 +6995,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="494"
line="576"
column="48"/>
</issue>
@ -7043,74 +7006,30 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="512"
line="604"
column="49"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static boolean filterNotification(AccountEntity account, Notification notification,"
errorLine2=" ~~~~~~~~~~~~~">
errorLine1=" public static boolean filterNotification(NotificationManager notificationManager, AccountEntity account, @NonNull Notification notification) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="533"
line="620"
column="46"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static boolean filterNotification(AccountEntity account, Notification notification,"
errorLine2=" ~~~~~~~~~~~~">
errorLine1=" public static boolean filterNotification(NotificationManager notificationManager, AccountEntity account, @NonNull Notification notification) {"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="533"
column="69"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" Context context) {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="534"
column="47"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static boolean filterNotification(AccountEntity account, Notification.Type type,"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="538"
column="46"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" public static boolean filterNotification(AccountEntity account, Notification.Type type,"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="538"
column="69"/>
</issue>
<issue
id="UnknownNullness"
message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
errorLine1=" Context context) {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/com/keylesspalace/tusky/components/notifications/NotificationHelper.java"
line="539"
column="47"/>
line="620"
column="87"/>
</issue>
<issue

View file

@ -39,6 +39,7 @@ import android.webkit.MimeTypeMap
import android.widget.Toast
import androidx.core.app.ShareCompat
import androidx.core.content.FileProvider
import androidx.core.content.IntentCompat
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
@ -96,7 +97,7 @@ class ViewMediaActivity : BaseActivity(), ViewImageFragment.PhotoActionsListener
supportPostponeEnterTransition()
// Gather the parameters.
attachments = intent.getParcelableArrayListExtra(EXTRA_ATTACHMENTS)
attachments = IntentCompat.getParcelableArrayListExtra(intent, EXTRA_ATTACHMENTS, AttachmentViewData::class.java)
val initialPosition = intent.getIntExtra(EXTRA_ATTACHMENT_INDEX, 0)
// Adapter is actually of existential type PageAdapter & SharedElementsTransitionListener

View file

@ -53,7 +53,9 @@ import androidx.appcompat.app.AlertDialog
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.core.content.IntentCompat
import androidx.core.content.res.use
import androidx.core.os.BundleCompat
import androidx.core.view.ContentInfoCompat
import androidx.core.view.OnReceiveContentListener
import androidx.core.view.isGone
@ -251,7 +253,7 @@ class ComposeActivity :
/* If the composer is started up as a reply to another post, override the "starting" state
* based on what the intent from the reply request passes. */
val composeOptions: ComposeOptions? = intent.getParcelableExtra(COMPOSE_OPTIONS_EXTRA)
val composeOptions: ComposeOptions? = IntentCompat.getParcelableExtra(intent, COMPOSE_OPTIONS_EXTRA, ComposeOptions::class.java)
viewModel.setup(composeOptions)
setupButtons()
@ -285,7 +287,7 @@ class ComposeActivity :
/* Finally, overwrite state with data from saved instance state. */
savedInstanceState?.let {
photoUploadUri = it.getParcelable(PHOTO_UPLOAD_URI_KEY)
photoUploadUri = BundleCompat.getParcelable(it, PHOTO_UPLOAD_URI_KEY, Uri::class.java)
(it.getSerializable(VISIBILITY_KEY) as Status.Visibility).apply {
setStatusVisibility(this)
@ -314,12 +316,12 @@ class ComposeActivity :
if (type.startsWith("image/") || type.startsWith("video/") || type.startsWith("audio/")) {
when (intent.action) {
Intent.ACTION_SEND -> {
intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)?.let { uri ->
IntentCompat.getParcelableExtra(intent, Intent.EXTRA_STREAM, Uri::class.java)?.let { uri ->
pickMedia(uri)
}
}
Intent.ACTION_SEND_MULTIPLE -> {
intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM)?.forEach { uri ->
IntentCompat.getParcelableArrayListExtra(intent, Intent.EXTRA_STREAM, Uri::class.java)?.forEach { uri ->
pickMedia(uri)
}
}

View file

@ -27,6 +27,7 @@ import android.view.ViewGroup
import android.view.WindowManager
import android.widget.EditText
import androidx.appcompat.app.AlertDialog
import androidx.core.os.BundleCompat
import androidx.core.os.bundleOf
import androidx.fragment.app.DialogFragment
import com.bumptech.glide.Glide
@ -73,7 +74,7 @@ class CaptionDialog : DialogFragment() {
val window = dialog.window
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
val previewUri = arguments?.getParcelable<Uri>(PREVIEW_URI_ARG) ?: error("Preview Uri is null")
val previewUri = BundleCompat.getParcelable(requireArguments(), PREVIEW_URI_ARG, Uri::class.java) ?: error("Preview Uri is null")
// Load the image and manually set it into the ImageView because it doesn't have a fixed size.
Glide.with(this)
.load(previewUri)

View file

@ -15,13 +15,13 @@
package com.keylesspalace.tusky.components.compose.dialog
import android.app.Activity
import android.content.DialogInterface
import android.graphics.drawable.Drawable
import android.net.Uri
import android.view.WindowManager
import android.widget.FrameLayout
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.bumptech.glide.Glide
@ -38,7 +38,7 @@ fun <T> T.makeFocusDialog(
existingFocus: Focus?,
previewUri: Uri,
onUpdateFocus: suspend (Focus) -> Unit
) where T : Activity, T : LifecycleOwner {
) where T : AppCompatActivity, T : LifecycleOwner {
val focus = existingFocus ?: Focus(0.0f, 0.0f) // Default to center
val dialogBinding = DialogFocusBinding.inflate(layoutInflater)

View file

@ -7,6 +7,7 @@ import android.widget.AdapterView
import android.widget.ArrayAdapter
import androidx.activity.viewModels
import androidx.appcompat.app.AlertDialog
import androidx.core.content.IntentCompat
import androidx.core.view.size
import androidx.core.widget.doAfterTextChanged
import androidx.lifecycle.lifecycleScope
@ -47,7 +48,7 @@ class EditFilterActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
originalFilter = intent?.getParcelableExtra(FILTER_TO_EDIT)
originalFilter = IntentCompat.getParcelableExtra(intent, FILTER_TO_EDIT, Filter::class.java)
filter = originalFilter ?: Filter("", "", listOf(), null, Filter.Action.WARN.action, listOf())
binding.apply {
contextSwitches = mapOf(

View file

@ -33,6 +33,7 @@ import android.webkit.WebViewClient
import androidx.activity.result.contract.ActivityResultContract
import androidx.activity.viewModels
import androidx.appcompat.app.AlertDialog
import androidx.core.content.IntentCompat
import androidx.core.net.toUri
import androidx.lifecycle.lifecycleScope
import com.keylesspalace.tusky.BaseActivity
@ -61,7 +62,9 @@ class OauthLogin : ActivityResultContract<LoginData, LoginResult>() {
return if (resultCode == Activity.RESULT_CANCELED) {
LoginResult.Cancel
} else {
intent!!.getParcelableExtra(RESULT_EXTRA)!!
intent?.let {
IntentCompat.getParcelableExtra(it, RESULT_EXTRA, LoginResult::class.java)
} ?: LoginResult.Err("failed parsing LoginWebViewActivity result")
}
}
@ -70,7 +73,7 @@ class OauthLogin : ActivityResultContract<LoginData, LoginResult>() {
private const val DATA_EXTRA = "data"
fun parseData(intent: Intent): LoginData {
return intent.getParcelableExtra(DATA_EXTRA)!!
return IntentCompat.getParcelableExtra(intent, DATA_EXTRA, LoginData::class.java)!!
}
fun makeResultIntent(result: LoginResult): Intent {

View file

@ -26,6 +26,7 @@ import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.core.os.BundleCompat
import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
@ -92,7 +93,7 @@ class ViewImageFragment : ViewMediaFragment() {
super.onViewCreated(view, savedInstanceState)
val arguments = this.requireArguments()
val attachment = arguments.getParcelable<Attachment>(ARG_ATTACHMENT)
val attachment = BundleCompat.getParcelable(arguments, ARG_ATTACHMENT, Attachment::class.java)
this.shouldStartTransition = arguments.getBoolean(ARG_START_POSTPONED_TRANSITION)
val url: String?
var description: String? = null

View file

@ -16,6 +16,7 @@ import android.util.Log
import androidx.annotation.StringRes
import androidx.core.app.NotificationCompat
import androidx.core.app.ServiceCompat
import androidx.core.content.IntentCompat
import at.connyduck.calladapter.networkresult.fold
import com.keylesspalace.tusky.MainActivity
import com.keylesspalace.tusky.R
@ -83,7 +84,7 @@ class SendStatusService : Service(), Injectable {
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
if (intent.hasExtra(KEY_STATUS)) {
val statusToSend: StatusToSend = intent.getParcelableExtra(KEY_STATUS)
val statusToSend: StatusToSend = IntentCompat.getParcelableExtra(intent, KEY_STATUS, StatusToSend::class.java)
?: throw IllegalStateException("SendStatusService started without $KEY_STATUS extra")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {