From ceec31b17c7abf423e9ab9301ae323b6bc232310 Mon Sep 17 00:00:00 2001 From: kholoud mohamed Date: Thu, 3 Feb 2022 15:44:25 +0000 Subject: [PATCH] Expose action that allows landing on the work tab Bug: 217385869 Bug: 203531272 Test: manual Change-Id: I68a6add9f603105e0a2ee01ebdc3059e18c9a050 --- AndroidManifest.xml | 1 + src/com/android/launcher3/Launcher.java | 9 +++++++++ .../launcher3/allapps/BaseAllAppsContainerView.java | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 398489044e..b459b2dc3b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -58,6 +58,7 @@ android:enabled="true"> + diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 59c40ccbe3..45a83aa604 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -124,6 +124,7 @@ import com.android.launcher3.accessibility.LauncherAccessibilityDelegate; import com.android.launcher3.allapps.ActivityAllAppsContainerView; import com.android.launcher3.allapps.AllAppsStore; import com.android.launcher3.allapps.AllAppsTransitionController; +import com.android.launcher3.allapps.BaseAllAppsContainerView; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.anim.PropertyListBuilder; @@ -1567,6 +1568,7 @@ public class Launcher extends StatefulActivity implements Launche boolean isActionMain = Intent.ACTION_MAIN.equals(intent.getAction()); boolean internalStateHandled = ACTIVITY_TRACKER.handleNewIntent(this); hideKeyboard(); + if (isActionMain) { if (!internalStateHandled) { // In all these cases, only animate if we're already on home @@ -1595,6 +1597,8 @@ public class Launcher extends StatefulActivity implements Launche handleGestureContract(intent); } else if (Intent.ACTION_ALL_APPS.equals(intent.getAction())) { showAllAppsFromIntent(alreadyOnHome); + } else if (Intent.ACTION_SHOW_WORK_APPS.equals(intent.getAction())) { + showAllAppsWorkTabFromIntent(alreadyOnHome); } TraceHelper.INSTANCE.endSection(traceToken); @@ -1605,6 +1609,11 @@ public class Launcher extends StatefulActivity implements Launche getStateManager().goToState(ALL_APPS, alreadyOnHome); } + private void showAllAppsWorkTabFromIntent(boolean alreadyOnHome) { + showAllAppsFromIntent(alreadyOnHome); + mAppsView.switchToTab(BaseAllAppsContainerView.AdapterHolder.WORK); + } + /** * Handles gesture nav contract */ diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index b257407161..8d03305fcd 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -331,6 +331,16 @@ public abstract class BaseAllAppsContainerView