Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7976d884 authored by Nan Wu's avatar Nan Wu
Browse files

Fix AppWidget nested extra keys not collected issue

An app widget provider app provides a fillInIntent to the RemoteViews
This fillInIntent is sent (together with the RemoteViews) over to
AppWidgetManagerService without keys collected. The AppWidgetManagerService
make a callback to AppWidgetHostView which includes the fillInIntent.
The appWidgetHostView eventually calls Activity.startIntenSender with
the fillInIntent, which tries to collect the keys. Unfortunately,
at this point, the fillInIntent extra bundle is parceled (sent over
to AppWidgetManagerService thru IPC). Since we no longer unparcels
the extra bundle when trying to collect keys, they are missed.

After investigating the code, it seems the fillInIntent always comes
into RemoteViews from a few places in the code. It is easier to collect
keys at those points, although there is no guarantee that
the fillInIntent will be sent over IPC yet. But there is no harm to
collect it. The alternative is to collect keys right before the
RemoteViews is sent over IPC, but it is much harder to probe the
RemoteViews to find all the fillInIntents at that point.

Also, it is not necessary to generate the creator token in the
AppWidgetManagerService right after the fillInIntent is sent
over IPC. We can wait until AppWidgetHostView calls Activity.
startIntentSender to generate the creator token because both
RemoteViews and AppWidgetHostView are systemUI.

Bug: 395568288
Test: manual test. RemoteViewsTest, RemoteViewsAdapterTest, RemoteViewsSerializersTest
Flag: EXEMPT bug fix
Change-Id: Id9ec09e0f1ed906282bdeb085ca89302f52e05e4
parent cc8b75ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment