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

Commit b782a2f4 authored by Bjorn Bringert's avatar Bjorn Bringert
Browse files

Remove globalSearch argument from triggerSearch()

API council says:

"In reviewing the new triggerSearch API, we are concerned that
applications could use the option to perform a global search to spam
the user with frequent searches.  We would like the global search
option to be removed for now (not just hidden, but removed from the
internal IPC API so that nobody can find this and abuse it).  The rest
of the API should be fine as long as it is restricted to local
searches."

Fixes http://b/editIssue?id=2158785

Change-Id: Ie69a9c0ab6373cc4427aab50606885bdede40585
parent 9825ec61
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -17518,8 +17518,6 @@
</parameter>
<parameter name="appSearchData" type="android.os.Bundle">
</parameter>
<parameter name="globalSearch" type="boolean">
</parameter>
</method>
<method name="unregisterForContextMenu"
 return="void"
@@ -24072,8 +24070,6 @@
</parameter>
<parameter name="appSearchData" type="android.os.Bundle">
</parameter>
<parameter name="globalSearch" type="boolean">
</parameter>
</method>
<field name="ACTION_KEY"
 type="java.lang.String"
+2 −6
Original line number Diff line number Diff line
@@ -2619,14 +2619,10 @@ public class Activity extends ContextThemeWrapper
     * context here, in order to improve quality or specificity of its own
     * searches.  This data will be returned with SEARCH intent(s).  Null if
     * no extra data is required.
     * @param globalSearch If false, this will only launch the search that has been specifically
     * defined by the application (which is usually defined as a local search).  If no default
     * search is defined in the current application or activity, no search will be launched.
     * If true, this will always launch a platform-global (e.g. web-based) search instead.
     */
    public void triggerSearch(String query, Bundle appSearchData, boolean globalSearch) {
    public void triggerSearch(String query, Bundle appSearchData) {
        ensureSearchManager();
        mSearchManager.triggerSearch(query, getComponentName(), appSearchData, globalSearch);
        mSearchManager.triggerSearch(query, getComponentName(), appSearchData);
    }

    /**
+0 −1
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ interface ISearchManager {
            in ComponentName launchActivity,
            in Bundle appSearchData,
            ISearchManagerCallback searchManagerCallback,
            boolean globalSearch,
            int ident);

    void stopSearch();
+2 −7
Original line number Diff line number Diff line
@@ -1785,17 +1785,12 @@ public class SearchManager
     * context here, in order to improve quality or specificity of its own
     * searches.  This data will be returned with SEARCH intent(s).  Null if
     * no extra data is required.
     * @param globalSearch If false, this will only launch the search that has been specifically
     * defined by the application (which is usually defined as a local search).  If no default
     * search is defined in the current application or activity, no search will be launched.
     * If true, this will always launch a platform-global (e.g. web-based) search instead.
     *
     * @see #startSearch
     */
    public void triggerSearch(String query,
                              ComponentName launchActivity,
                              Bundle appSearchData,
                              boolean globalSearch) {
                              Bundle appSearchData) {
        if (mIdent == 0) throw new IllegalArgumentException(
                "Called from outside of an Activity context");
        if (!mAssociatedPackage.equals(launchActivity.getPackageName())) {
@@ -1808,7 +1803,7 @@ public class SearchManager
        }
        try {
            mService.triggerSearch(query, launchActivity, appSearchData, mSearchManagerCallback,
                    globalSearch, mIdent);
                    mIdent);
        } catch (RemoteException ex) {
            Log.e(TAG, "triggerSearch() failed.", ex);
        }
+1 −2
Original line number Diff line number Diff line
@@ -247,14 +247,13 @@ public class SearchManagerService extends ISearchManager.Stub {
            ComponentName launchActivity,
            Bundle appSearchData,
            ISearchManagerCallback searchManagerCallback,
            boolean globalSearch,
            int ident) {
        getSearchDialog().startSearch(
                query,
                false,
                launchActivity,
                appSearchData,
                globalSearch,
                false,
                searchManagerCallback,
                ident,
                true); // triger search after launching