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

Commit 5417f09c authored by Bjorn Bringert's avatar Bjorn Bringert
Browse files

Send action key and msg with GlobalSearch clicks

Needed for QSB logging, http://b/issue?id=2097469

Change-Id: I817e5b26c9739ab05bd873675854478ce601d234
parent 3c5767d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
            // report back about the click
            if (mGlobalSearchMode) {
                // in global search mode, do it via cursor
                mSuggestionsAdapter.callCursorOnClick(c, position);
                mSuggestionsAdapter.callCursorOnClick(c, position, actionKey, actionMsg);
            } else if (intent != null
                    && mPreviousComponents != null
                    && !mPreviousComponents.isEmpty()) {
+4 −0
Original line number Diff line number Diff line
@@ -1343,6 +1343,10 @@ public class SearchManager
                = "DialogCursorProtocol.CLICK.sendPosition";
        public final static String CLICK_SEND_MAX_DISPLAY_POS
                = "DialogCursorProtocol.CLICK.sendDisplayPosition";
        public final static String CLICK_SEND_ACTION_KEY
                = "DialogCursorProtocol.CLICK.sendActionKey";
        public final static String CLICK_SEND_ACTION_MSG
                = "DialogCursorProtocol.CLICK.sendActionMsg";
        public final static String CLICK_RECEIVE_SELECTED_POS
                = "DialogCursorProtocol.CLICK.receiveSelectedPosition";

+7 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
@@ -290,12 +291,16 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
     * @param cursor The cursor
     * @param position The position that was clicked.
     */
    void callCursorOnClick(Cursor cursor, int position) {
    void callCursorOnClick(Cursor cursor, int position, int actionKey, String actionMsg) {
        if (!mGlobalSearchMode) return;
        final Bundle request = new Bundle(3);
        final Bundle request = new Bundle(5);
        request.putInt(DialogCursorProtocol.METHOD, DialogCursorProtocol.CLICK);
        request.putInt(DialogCursorProtocol.CLICK_SEND_POSITION, position);
        request.putInt(DialogCursorProtocol.CLICK_SEND_MAX_DISPLAY_POS, mMaxDisplayed);
        if (actionKey != KeyEvent.KEYCODE_UNKNOWN) {
            request.putInt(DialogCursorProtocol.CLICK_SEND_ACTION_KEY, actionKey);
            request.putString(DialogCursorProtocol.CLICK_SEND_ACTION_MSG, actionMsg);
        }
        final Bundle response = cursor.respond(request);
        mMaxDisplayed = -1;
        mListItemToSelect = response.getInt(