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
Loading
Please register or sign in to comment