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

Commit 34c4605c authored by Anushree Ganjam's avatar Anushree Ganjam
Browse files

Update the Online search Engine key to "selected_search_engine".

Test steps:
1. Execute adb shell settings put secure selected_search_engine <search_engine_package_name> (Ex: com.duckduckgo.mobile.android)
2. Install the app and verify the search widget on launcher is updated.
3. Uninstall the app and verify the search widget is replaced by
   placeholder

When we change the search engine setting after the app is installed , we need to force-stop launcher app for the new settings to take effect.

Bug: 333029477
Flag: EXEMPT bugfix
Test: Manual
Change-Id: If127dcc87c5278a98177b83514cddb09a4124223
parent 6b905584
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ import com.android.launcher3.widget.util.WidgetSizes;
 */
public class QsbContainerView extends FrameLayout {

    public static final String SEARCH_PROVIDER_SETTINGS_KEY = "SEARCH_PROVIDER_PACKAGE_NAME";
    public static final String SEARCH_ENGINE_SETTINGS_KEY = "selected_search_engine";

    /**
     * Returns the package name for user configured search provider or from searchManager
@@ -71,8 +71,8 @@ public class QsbContainerView extends FrameLayout {
    @WorkerThread
    @Nullable
    public static String getSearchWidgetPackageName(@NonNull Context context) {
        String providerPkg = Settings.Global.getString(context.getContentResolver(),
                SEARCH_PROVIDER_SETTINGS_KEY);
        String providerPkg = Settings.Secure.getString(context.getContentResolver(),
                SEARCH_ENGINE_SETTINGS_KEY);
        if (providerPkg == null) {
            SearchManager searchManager = context.getSystemService(SearchManager.class);
            ComponentName componentName = searchManager.getGlobalSearchActivity();