Repository navigation
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Hi guys |
There was a problem hiding this comment.
Hello, thank you for the PR. I cannot launch app, I'm getting following error:
Process: it.niedermann.owncloud.notes.dev, PID: 24532
java.lang.RuntimeException: Unable to start receiver it.niedermann.owncloud.notes.widget.notelist.NoteListWidget
at android.app.ActivityThread.handleReceiver(ActivityThread.java: 5670)
at android.app.ActivityThread. - $$Nest$mhandleReceiver(ActivityThread.java: 0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java: 2708)
at android.os.Handler.dispatchMessageImpl(Handler.java: 142)
at android.os.Handler.dispatchMessage(Handler.java: 126)
at android.os.Looper.loopOnce(Looper.java: 285)
at android.os.Looper.loop(Looper.java: 390)
at android.app.ActivityThread.main(ActivityThread.java: 9884)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java: 575)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 906)
Caused by: java.lang.IllegalArgumentException: Cannot set both FLAG_IMMUTABLE and FLAG_MUTABLE
for PendingIntent
at android.app.PendingIntent.checkPendingIntent(PendingIntent.java: 450)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java: 579)
at android.app.PendingIntent.getActivity(PendingIntent.java: 564)
at android.app.PendingIntent.getActivity(PendingIntent.java: 528)
at it.niedermann.owncloud.notes.widget.notelist.NoteListWidget$Companion.updateAppWidget(NoteListWidget.kt: 103)
at it.niedermann.owncloud.notes.widget.notelist.NoteListWidget.onUpdate(NoteListWidget.kt: 36)
at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java: 71)
at it.niedermann.owncloud.notes.widget.notelist.NoteListWidget.onReceive(NoteListWidget.kt: 40)
at android.app.ActivityThread.handleReceiver(ActivityThread.java: 5663)
...10 more
@alperozturk96 What Android API version you try start? |
The note list widget used WidgetUtil.pendingIntentFlagCompat() for its PendingIntent template, which adds FLAG_IMMUTABLE on Android 14+ (API 34+). An immutable PendingIntent cannot be modified at send time, so the per-item fill-in intent carrying the note id was discarded and EditNoteActivity received an intent without PARAM_NOTE_ID, falling back to creating a new note instead of opening the tapped one. Use FLAG_MUTABLE explicitly (as SingleNoteWidget already does) so the fill-in intent with the note id is applied, and use the appWidgetId as PendingIntent request code so widget instances no longer share one PendingIntent. Affected devices: Android 14 and newer (API 34+). On Android 12-13 pendingIntentFlagCompat() returned FLAG_MUTABLE and on Android 11 and below no flag was added, so the fill-in intent worked there. AI-assistant: Cline Extension 1.x (GLM-5.3) Signed-off-by: Mark <mark-smirnow@yandex.ru>
a58b9ea to
dba83ca
Compare
but I tried again and can't able to reproduce as well. @daniele-verducci can you also try? |
Restore the widget header row that was removed in a78ee27: the first scrollable entry of the note list widget shows the widget context title (app name, favorites or category) with a create note button. - tapping the title opens the app - tapping the + button creates a new note in the widget category - the + icon is tinted with the account color when the contrast is sufficient - widget_entry_add.xml: cleaned up legacy paddings and hardcoded sizes, fixed content description of the create button - restore the widget_create_note string Click handling relies on the pending intent template being mutable, which is fixed in nextcloud#3380. Merge that PR first (or together). AI-assistant: Cline Extension 1.x (GLM-5.3) Signed-off-by: Mark <mark-smirnow@yandex.ru>
The note list widget used WidgetUtil.pendingIntentFlagCompat() for its PendingIntent template, which adds FLAG_IMMUTABLE on Android 14+ (API 34+). An immutable PendingIntent cannot be modified at send time, so the per-item fill-in intent carrying the note id was discarded and EditNoteActivity received an intent without PARAM_NOTE_ID, falling back to creating a new note instead of opening the tapped one.
Use FLAG_MUTABLE explicitly (as SingleNoteWidget already does) so the fill-in intent with the note id is applied, and use the appWidgetId as PendingIntent request code so widget instances no longer share one PendingIntent.
Affected devices: Android 14 and newer (API 34+). On Android 12-13 pendingIntentFlagCompat() returned FLAG_MUTABLE and on Android 11 and below no flag was added, so the fill-in intent worked there.
Partically closes: #3168, #2805
AI-assistant: Cline Extension 1.x (GLM-5.3)
🖼️ Screenshots
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)