Bugfix/noid/use extra shortcut id only when supported#6094
Conversation
EXTRA_SHORTCUT_ID is only available in Android 10 (Q) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
eafee5d to
16eb6e6
Compare
There was a problem hiding this comment.
Pull request overview
Follow-up bugfix to Direct Share shortcut handling and lint/detekt warning suppression, ensuring shortcut IDs are only accessed when supported and suppressing long-parameter warnings in Compose UI code.
Changes:
- Added/adjusted
@Suppressannotations for Detekt/lint warnings in chat UI composables. - Added an SDK version gate before reading
Intent.EXTRA_SHORTCUT_IDwhen handlingACTION_SENDinConversationsListActivity.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/main/java/com/nextcloud/talk/ui/chat/ChatMessageScaffold.kt | Updates suppression annotations to address Detekt warnings (long method/parameter list). |
| app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt | Gates reading EXTRA_SHORTCUT_ID behind an SDK check for Direct Share intent handling. |
Comments suppressed due to low confidence (1)
app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt:336
- The new API-level gate (>= Q) prevents handling Direct Share shortcut selection on Android 8–9 (API 26–28), even though the app’s minSdk is 26 and sharing shortcuts exist there. Consider reading the shortcut id using the API 25+ constant (e.g., ShortcutManager.EXTRA_SHORTCUT_ID) and gating on N_MR1 (or removing the gate entirely given minSdk 26), instead of requiring Q.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && hasActivityActionSendIntent()) {
val shortcutId = intent.getStringExtra(Intent.EXTRA_SHORTCUT_ID)
if (shortcutId != null) {
pendingDirectShareToken = DirectShareHelper.extractTokenFromShortcutId(shortcutId)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/24663965800/artifacts/6530562978 |
.. to resolve detekt warnings.. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
16eb6e6 to
7c5e3b1
Compare
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/24667554244/artifacts/6532108074 |
followup to #6024
🏁 Checklist
/backport to stable-xx.x