Some fixes for performance
* Add @Immutable to some classes * Use a QSTile.Icon instead of a Supplier in TileUiState to properly have equality. As this object is close to the UI, it makes no sense to have a supplier and complicate equality. However, this needs to be paired with proper QSTile.Icon (ResourceIcon and DrawableIconWithRes) to facilitate equality. * Use produceState to obtain the TileUiState. Because `QSTile.State` doesn't have a good equality, and we only care about the uiState, use this to avoid recompositions when the legacy state changes but the ui state doesn't. * Add key around Tile composables tied to the spec (identifies the tile). Test: manual, perfetto trace. No recompositions of the tiles Test: atest com.android.systemui.qs Flag: com.android.systemui.qs_ui_refactor_compose_fragment Bug: 383085298 Change-Id: I9a634cabbd1917ead1ced7f0b9fb968225194d24
Loading
Please register or sign in to comment