summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c2e0dc9d9..45e56f4be 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -640,7 +640,35 @@ public class Launcher extends Activity
/** To be overriden by subclasses to hint to Launcher that we have custom content */
protected boolean hasCustomContentToLeft() {
- return false;
+ return isGelIntegrationSupported() && isGelIntegrationEnabled();
+ }
+
+ public boolean isGelIntegrationSupported() {
+ final SearchManager searchManager =
+ (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+ ComponentName globalSearchActivity = searchManager.getGlobalSearchActivity();
+
+ // Currently the only custom content available is the GEL launcher integration,
+ // only supported on CyanogenMod.
+ return globalSearchActivity != null && isCM();
+ }
+
+ public boolean isGelIntegrationEnabled() {
+ return mGelIntegrationEnabled;
+ }
+
+ public void onCustomContentLaunch() {
+ if(isGelIntegrationEnabled() && isGelIntegrationSupported()) {
+ GelIntegrationHelper.getInstance().registerSwipeBackGestureListenerAndStartGel(this, mWorkspace.isLayoutRtl());
+ }
+ }
+
+ /**
+ * Check if the device running this application is running CyanogenMod.
+ * @return true if this device is running CM.
+ */
+ protected boolean isCM() {
+ return getPackageManager().hasSystemFeature("com.cyanogenmod.android");
}
/**