diff options
author | Mike LeBeau <mlebeau@android.com> | 2010-03-22 17:40:35 -0700 |
---|---|---|
committer | Mike LeBeau <mlebeau@android.com> | 2010-03-22 17:40:35 -0700 |
commit | bfd25cacf81982f7fd9caba9b3d4f558131469fe (patch) | |
tree | b92a390498bd754833138214298ea3d9f0068d9c /policy | |
parent | cf59a0b72d3fa6bfe21b3c4cab317ef06496961e (diff) | |
download | frameworks_base-bfd25cacf81982f7fd9caba9b3d4f558131469fe.zip frameworks_base-bfd25cacf81982f7fd9caba9b3d4f558131469fe.tar.gz frameworks_base-bfd25cacf81982f7fd9caba9b3d4f558131469fe.tar.bz2 |
Tell SearchManager to stopSearch on long-press of search. Also,
do the long-press haptic feedback first, to avoid any slowdown
in the responsiveness of that.
Fixes http://b/2526697
Change-Id: I607063b67bdde92303ee112663b76d6e4e9a369b
Diffstat (limited to 'policy')
-rw-r--r-- | policy/com/android/internal/policy/impl/PhoneWindow.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/policy/com/android/internal/policy/impl/PhoneWindow.java b/policy/com/android/internal/policy/impl/PhoneWindow.java index 4e630df..c6a528d 100644 --- a/policy/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/com/android/internal/policy/impl/PhoneWindow.java @@ -29,6 +29,7 @@ import com.android.internal.view.menu.MenuView; import com.android.internal.view.menu.SubMenuBuilder; import android.app.KeyguardManager; +import android.app.SearchManager; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; @@ -150,6 +151,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private long mVolumeKeyUpTime; private KeyguardManager mKeyguardManager = null; + + private SearchManager mSearchManager = null; private TelephonyManager mTelephonyManager = null; @@ -1237,9 +1240,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { Intent intent = new Intent(Intent.ACTION_SEARCH_LONG_PRESS); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { + mDecor.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); sendCloseSystemWindows(); + getSearchManager().stopSearch(); getContext().startActivity(intent); - mDecor.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); // Only clear this if we successfully start the // activity; otherwise we will allow the normal short // press action to be performed. @@ -1266,6 +1270,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } return mKeyguardManager; } + + /** + * @return A handle to the search manager. + */ + private SearchManager getSearchManager() { + if (mSearchManager == null) { + mSearchManager = (SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE); + } + return mSearchManager; + } /** * A key was released and not handled by anything else in the window. |