am 5417f09c: Send action key and msg with GlobalSearch clicks

Merge commit '5417f09c141713c62be697fe10fe149d6d3d0eb4' into eclair-plus-aosp

* commit '5417f09c141713c62be697fe10fe149d6d3d0eb4':
  Send action key and msg with GlobalSearch clicks
This commit is contained in:
Bjorn Bringert
2009-09-21 03:58:17 -07:00
committed by Android Git Automerger
3 changed files with 12 additions and 3 deletions

View File

@@ -1182,7 +1182,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
// report back about the click // report back about the click
if (mGlobalSearchMode) { if (mGlobalSearchMode) {
// in global search mode, do it via cursor // in global search mode, do it via cursor
mSuggestionsAdapter.callCursorOnClick(c, position); mSuggestionsAdapter.callCursorOnClick(c, position, actionKey, actionMsg);
} else if (intent != null } else if (intent != null
&& mPreviousComponents != null && mPreviousComponents != null
&& !mPreviousComponents.isEmpty()) { && !mPreviousComponents.isEmpty()) {

View File

@@ -1343,6 +1343,10 @@ public class SearchManager
= "DialogCursorProtocol.CLICK.sendPosition"; = "DialogCursorProtocol.CLICK.sendPosition";
public final static String CLICK_SEND_MAX_DISPLAY_POS public final static String CLICK_SEND_MAX_DISPLAY_POS
= "DialogCursorProtocol.CLICK.sendDisplayPosition"; = "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 public final static String CLICK_RECEIVE_SELECTED_POS
= "DialogCursorProtocol.CLICK.receiveSelectedPosition"; = "DialogCursorProtocol.CLICK.receiveSelectedPosition";

View File

@@ -37,6 +37,7 @@ import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Filter; import android.widget.Filter;
@@ -290,12 +291,16 @@ class SuggestionsAdapter extends ResourceCursorAdapter {
* @param cursor The cursor * @param cursor The cursor
* @param position The position that was clicked. * @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; if (!mGlobalSearchMode) return;
final Bundle request = new Bundle(3); final Bundle request = new Bundle(5);
request.putInt(DialogCursorProtocol.METHOD, DialogCursorProtocol.CLICK); request.putInt(DialogCursorProtocol.METHOD, DialogCursorProtocol.CLICK);
request.putInt(DialogCursorProtocol.CLICK_SEND_POSITION, position); request.putInt(DialogCursorProtocol.CLICK_SEND_POSITION, position);
request.putInt(DialogCursorProtocol.CLICK_SEND_MAX_DISPLAY_POS, mMaxDisplayed); 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); final Bundle response = cursor.respond(request);
mMaxDisplayed = -1; mMaxDisplayed = -1;
mListItemToSelect = response.getInt( mListItemToSelect = response.getInt(