From 87603a10e80efa88fe670728fd07443fb2aa69b8 Mon Sep 17 00:00:00 2001 From: Anushree Ganjam Date: Tue, 15 Apr 2025 23:48:25 +0000 Subject: [PATCH] Introduce "qsb_container_hotseat" layout to override the existing search_container_hotseat. This layout is no-op in AOSP. Bug: 405166827 Test: Manual Flag: com.android.launcher3.enable_qsb_on_hotseat Change-Id: Ief142c3c141a672c5a4c53814b7901ff322ed053 --- aconfig/launcher_search.aconfig | 2 +- res/layout/qsb_container_hotseat.xml | 20 ++++++++++++++++++++ src/com/android/launcher3/Hotseat.java | 9 ++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 res/layout/qsb_container_hotseat.xml diff --git a/aconfig/launcher_search.aconfig b/aconfig/launcher_search.aconfig index 409970baf8..15ea9580d6 100644 --- a/aconfig/launcher_search.aconfig +++ b/aconfig/launcher_search.aconfig @@ -57,7 +57,7 @@ flag { } flag { name: "enable_qsb_on_hotseat" - namespace: "launcher" + namespace: "launcher_search" description: "Enable Search App's widget on hotseat" bug: "405226308" } diff --git a/res/layout/qsb_container_hotseat.xml b/res/layout/qsb_container_hotseat.xml new file mode 100644 index 0000000000..2fd3db1e78 --- /dev/null +++ b/res/layout/qsb_container_hotseat.xml @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 1c181794c4..19e8f95e01 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -100,7 +100,14 @@ public class Hotseat extends CellLayout implements Insettable { public Hotseat(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false); + if (Flags.enableQsbOnHotseat()) { + mQsb = LayoutInflater.from(context).inflate(R.layout.qsb_container_hotseat, this, + false); + } else { + mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, + false); + } + addView(mQsb); mIconsAlphaChannels = new MultiValueAlpha(getShortcutsAndWidgets(), ALPHA_CHANNEL_CHANNELS_COUNT);