From b8f623db36a1de8703911949bafc418804f64a20 Mon Sep 17 00:00:00 2001 From: Raj Yengisetty Date: Wed, 19 Nov 2014 08:12:01 -0800 Subject: Search Provider: Remove Action.ASSIST preference Always return to Trebuchet on return gesture. Change-Id: I92ca0dc3bfcb7763691a1d73381c2a6cebebdae3 --- .../android/launcher3/GelIntegrationHelper.java | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/com/android/launcher3/GelIntegrationHelper.java b/src/com/android/launcher3/GelIntegrationHelper.java index fbd6e5b16..5f5b81c50 100644 --- a/src/com/android/launcher3/GelIntegrationHelper.java +++ b/src/com/android/launcher3/GelIntegrationHelper.java @@ -68,6 +68,7 @@ public class GelIntegrationHelper { Intent homeIntent = new Intent(Intent.ACTION_MAIN); homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); homeIntent.addCategory(Intent.CATEGORY_HOME); + homeIntent.setPackage(launcherActivity.getPackageName()); launcherActivity.startActivity(homeIntent); launcherActivity.overridePendingTransition(0, 0); dropEventsUntilLift(); @@ -80,16 +81,13 @@ public class GelIntegrationHelper { int edge = isLayoutRtl ? EDGE_GESTURE_SERVICE_LEFT_EDGE : EDGE_GESTURE_SERVICE_RIGHT_EDGE; edgeGestureManager.updateEdgeGestureActivationListener(mEdgeGestureActivationListener, edge); - // Attempt to use Intent.ACTION_ASSIST, if supported - Intent intent = new Intent(Intent.ACTION_ASSIST); - if (!isIntentSupported(launcherActivity, intent)) { - // Start the Global Search Activity - final SearchManager searchManager = - (SearchManager) launcherActivity.getSystemService(Context.SEARCH_SERVICE); - ComponentName globalSearchActivity = searchManager.getGlobalSearchActivity(); - intent = new Intent(); - intent.setComponent(globalSearchActivity); - } + + // Start the Global Search Activity + final SearchManager searchManager = + (SearchManager) launcherActivity.getSystemService(Context.SEARCH_SERVICE); + ComponentName globalSearchActivity = searchManager.getGlobalSearchActivity(); + Intent intent = new Intent(); + intent.setComponent(globalSearchActivity); try { launcherActivity.startActivity(intent); @@ -98,10 +96,4 @@ public class GelIntegrationHelper { Log.e(TAG, "Unable to launch global search activity."); } } - - private boolean isIntentSupported(Context context, Intent intent) { - PackageManager pm = context.getPackageManager(); - return pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null; - } - } -- cgit v1.2.3