diff options
author | Raj Yengisetty <rajesh@cyngn.com> | 2015-03-17 15:59:06 -0700 |
---|---|---|
committer | Rajesh Yengisetty <rajesh@cyngn.com> | 2015-03-17 23:01:20 +0000 |
commit | 5482c2f488e7ce312a85e7440b72865d1f2cf598 (patch) | |
tree | e833b7bf5af7febbf8ab45d8118c6f86b5500e0e /src/com/android/launcher3/Utilities.java | |
parent | b4b01cdc995309f0b850c5de928d147b83e97fbd (diff) | |
download | android_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.java | 9 |
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; + } } |