summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Dialog.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/app/Dialog.java')
-rw-r--r--core/java/android/app/Dialog.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 786a52f..d049104 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -49,6 +49,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.PhoneWindow;
+import android.view.SearchEvent;
import android.view.View;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
@@ -123,6 +124,8 @@ public class Dialog implements DialogInterface, Window.Callback,
private Handler mListenersHandler;
+ private SearchEvent mSearchEvent;
+
private ActionMode mActionMode;
private int mActionModeTypeStarting = ActionMode.TYPE_PRIMARY;
@@ -995,6 +998,14 @@ public class Dialog implements DialogInterface, Window.Callback,
/**
* This hook is called when the user signals the desire to start a search.
*/
+ public boolean onSearchRequested(SearchEvent searchEvent) {
+ mSearchEvent = searchEvent;
+ return onSearchRequested();
+ }
+
+ /**
+ * This hook is called when the user signals the desire to start a search.
+ */
public boolean onSearchRequested() {
final SearchManager searchManager = (SearchManager) mContext
.getSystemService(Context.SEARCH_SERVICE);
@@ -1011,6 +1022,17 @@ public class Dialog implements DialogInterface, Window.Callback,
}
/**
+ * During the onSearchRequested() callbacks, this function will return the
+ * {@link SearchEvent} that triggered the callback, if it exists.
+ *
+ * @return SearchEvent The SearchEvent that triggered the {@link
+ * #onSearchRequested} callback.
+ */
+ public final SearchEvent getSearchEvent() {
+ return mSearchEvent;
+ }
+
+ /**
* {@inheritDoc}
*/
@Override