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

Commit 940ef38c authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Pass AppData to the app from SearchDialog queries.

Bug: 3494468

During migration of SearchDialog to use SearchView, the appdata was not
passed along. This fixes the loss.

Change-Id: Ia754086d2bb95294e1d29650a72e4fdddec9c899
parent 0528bc77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -255,6 +255,7 @@ public class SearchDialog extends Dialog {
            // of any bad state in the AutoCompleteTextView etc
            createContentView();
            mSearchView.setSearchableInfo(mSearchable);
            mSearchView.setAppSearchData(mAppSearchData);

            show();
        }
+13 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ public class SearchView extends LinearLayout {
    private boolean mVoiceButtonEnabled;

    private SearchableInfo mSearchable;
    private Bundle mAppSearchData;

    // For voice searching
    private final Intent mVoiceWebSearchIntent;
@@ -263,6 +264,15 @@ public class SearchView extends LinearLayout {
        updateViewsVisibility(mIconifiedByDefault);
    }

    /**
     * Sets the APP_DATA for legacy SearchDialog use.
     * @param appSearchData bundle provided by the app when launching the search dialog
     * @hide
     */
    public void setAppSearchData(Bundle appSearchData) {
        mAppSearchData = appSearchData;
    }

    /** @hide */
    @Override
    public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
@@ -1115,6 +1125,9 @@ public class SearchView extends LinearLayout {
        if (extraData != null) {
            intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData);
        }
        if (mAppSearchData != null) {
            intent.putExtra(SearchManager.APP_DATA, mAppSearchData);
        }
        if (actionKey != KeyEvent.KEYCODE_UNKNOWN) {
            intent.putExtra(SearchManager.ACTION_KEY, actionKey);
            intent.putExtra(SearchManager.ACTION_MSG, actionMsg);