summaryrefslogtreecommitdiffstats
path: root/quickstep/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2019-06-24 16:01:13 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-06-25 13:25:30 -0700
commit700dc99d9b3d7df7e1910fa5661d60714a7f6a0d (patch)
tree46153ce762cfe17853aafbc4495ddbca3a85ea6e /quickstep/src
parenta90531cd00ad64fb8501c8190f99e068f9d581d6 (diff)
downloadandroid_packages_apps_Trebuchet-700dc99d9b3d7df7e1910fa5661d60714a7f6a0d.tar.gz
android_packages_apps_Trebuchet-700dc99d9b3d7df7e1910fa5661d60714a7f6a0d.tar.bz2
android_packages_apps_Trebuchet-700dc99d9b3d7df7e1910fa5661d60714a7f6a0d.zip
Enabling simple gesture navigation for 3P launcher
In case of 3P launcher, swipe-up will go to Launcher and there will be no way to reach overview. Bug: 135769778 Change-Id: Ib2c6bb1b13e6055d30b7360ec077b0a2fece66ff
Diffstat (limited to 'quickstep/src')
-rw-r--r--quickstep/src/com/android/quickstep/OverviewComponentObserver.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
index 0a73b8b19..0738affa9 100644
--- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
+++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
@@ -33,7 +33,6 @@ import android.content.pm.ResolveInfo;
import com.android.systemui.shared.system.PackageManagerWrapper;
-import com.android.systemui.shared.system.QuickStepContract;
import java.util.ArrayList;
/**
@@ -58,7 +57,9 @@ public final class OverviewComponentObserver {
private String mUpdateRegisteredPackage;
private ActivityControlHelper mActivityControlHelper;
private Intent mOverviewIntent;
+ private Intent mHomeIntent;
private int mSystemUiStateFlags;
+ private boolean mIsHomeAndOverviewSame;
public OverviewComponentObserver(Context context) {
mContext = context;
@@ -93,11 +94,14 @@ public final class OverviewComponentObserver {
final String overviewIntentCategory;
ComponentName overviewComponent;
+ mHomeIntent = null;
+
if ((mSystemUiStateFlags & SYSUI_STATE_HOME_DISABLED) == 0 &&
(defaultHome == null || mMyHomeComponent.equals(defaultHome))) {
// User default home is same as out home app. Use Overview integrated in Launcher.
overviewComponent = mMyHomeComponent;
mActivityControlHelper = new LauncherActivityControllerHelper();
+ mIsHomeAndOverviewSame = true;
overviewIntentCategory = Intent.CATEGORY_HOME;
if (mUpdateRegisteredPackage != null) {
@@ -109,8 +113,12 @@ public final class OverviewComponentObserver {
// The default home app is a different launcher. Use the fallback Overview instead.
overviewComponent = new ComponentName(mContext, RecentsActivity.class);
mActivityControlHelper = new FallbackActivityControllerHelper();
+ mIsHomeAndOverviewSame = false;
overviewIntentCategory = Intent.CATEGORY_DEFAULT;
+ mHomeIntent = new Intent(Intent.ACTION_MAIN)
+ .addCategory(Intent.CATEGORY_HOME)
+ .setComponent(defaultHome);
// User's default home app can change as a result of package updates of this app (such
// as uninstalling the app or removing the "Launcher" feature in an update).
// Listen for package updates of this app (and remove any previously attached
@@ -135,6 +143,9 @@ public final class OverviewComponentObserver {
.addCategory(overviewIntentCategory)
.setComponent(overviewComponent)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ if (mHomeIntent == null) {
+ mHomeIntent = mOverviewIntent;
+ }
}
/**
@@ -159,6 +170,20 @@ public final class OverviewComponentObserver {
}
/**
+ * Get the current intent for going to the home activity.
+ */
+ public Intent getHomeIntent() {
+ return mHomeIntent;
+ }
+
+ /**
+ * Returns true if home and overview are same activity.
+ */
+ public boolean isHomeAndOverviewSame() {
+ return mIsHomeAndOverviewSame;
+ }
+
+ /**
* Get the current activity control helper for managing interactions to the overview activity.
*
* @return the current activity control helper