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

Skip to content
Commit 378447f6 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Fabián Kozynski
Browse files

Support restoring TileService before app install

Before, CustomTile were destroyed if the app was not installed (before
that, they were kept as UNAVAILABLE, but that caused other issues). This
was an issue when restoring from a backup, as the setting would include
custom tiles that were restored before the app was installed and
therefore immediately removed (and never brought back).

With this change:
* Do not create CustomTile that don't have a corresponding valid
  component. Instead, keep them in the setting and mark them as
  NotInstalled internally.
* If the component later appears, actually create the tile, and send
  `onTileAdded`.

Note that if a component for a TileService disappears (it's
uninstalled), the tile will be automatically removed and would need to
be manually added. This is existing behavior.

Finally, in order to prevent race conditions when a package with
multiple tiles is uninstalled, use a mutex whenever making changes to
the setting.

Fixes: 282003318
Test: atest com.android.systemui.qs
Test: atest CtsTileServiceTestCases
Test: manual, add custom tiles through adb to settings and later install
app
Test: atest android.host.systemui
Flag: QS_PIPELINE_NEW_HOST
Change-Id: I0a774969ad20611103b09ce4ace6175ad53350ce

Change-Id: I8b48f45124928702fcdcf88484ccf3b501ea86ed
parent 755737cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment