Handle messages to update Launcher preview color

Receive color update messages with a list of color resource ids and a
corresponding list of color overrides, and adjust the preview
accordingly.

Flag: com.android.systemui.shared.new_customization_picker_ui
Test: manually verified that the selected colors are previewed
Bug: 350718581
Change-Id: Ibcde0575416df00b76627ac1004f21f5f9af1196
This commit is contained in:
Catherine Liang
2024-09-24 17:50:52 +00:00
parent e710e70bc8
commit b5fdc80bb2
4 changed files with 103 additions and 14 deletions
@@ -95,6 +95,7 @@ public class GridCustomizationsProvider extends ContentProvider {
private static final int MESSAGE_ID_UPDATE_PREVIEW = 1337;
private static final int MESSAGE_ID_UPDATE_GRID = 7414;
private static final int MESSAGE_ID_UPDATE_COLOR = 856;
// Set of all active previews used to track duplicate memory allocations
private final Set<PreviewLifecycleObserver> mActivePreviews =
@@ -289,6 +290,11 @@ public class GridCustomizationsProvider extends ContentProvider {
renderer.updateGrid(gridName);
}
break;
case MESSAGE_ID_UPDATE_COLOR:
if (Flags.newCustomizationPickerUi()) {
renderer.previewColor(message.getData());
}
break;
default:
// Unknown command, destroy lifecycle
Log.d(TAG, "Unknown preview command: " + message.what + ", destroying preview");