summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Utilities.java
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-03-17 15:59:06 -0700
committerRajesh Yengisetty <rajesh@cyngn.com>2015-03-17 23:01:20 +0000
commit5482c2f488e7ce312a85e7440b72865d1f2cf598 (patch)
treee833b7bf5af7febbf8ab45d8118c6f86b5500e0e /src/com/android/launcher3/Utilities.java
parentb4b01cdc995309f0b850c5de928d147b83e97fbd (diff)
downloadandroid_packages_apps_Trebuchet-5482c2f488e7ce312a85e7440b72865d1f2cf598.tar.gz
android_packages_apps_Trebuchet-5482c2f488e7ce312a85e7440b72865d1f2cf598.tar.bz2
android_packages_apps_Trebuchet-5482c2f488e7ce312a85e7440b72865d1f2cf598.zip
Trebuchet: disable search bar when there are no search activities
- On non-GMS devices, there are no Search apps which can support the search bar implementation. - Disable the search bar entirely if there is no search activity - Add a new utility method in SettingsProvider Change-Id: I3bcbceae4ceab308e4d797dad107e0a2ab72d673
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r--src/com/android/launcher3/Utilities.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index fcd4b8587..a594fd9f9 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -17,6 +17,7 @@
package com.android.launcher3;
import android.app.Activity;
+import android.app.SearchManager;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
@@ -566,4 +567,12 @@ public final class Utilities {
float px = dp * (metrics.densityDpi / (float) DisplayMetrics.DENSITY_DEFAULT);
return px;
}
+
+ public static boolean searchActivityExists(Context context) {
+ SearchManager searchManager =
+ (SearchManager) context.getSystemService(Context.SEARCH_SERVICE);
+ ComponentName activityName = searchManager.getGlobalSearchActivity();
+
+ return activityName != null;
+ }
}