From 6a7a7f6bad9ddb3b09620b5bd3e931e4a7f94037 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 1 Apr 2021 13:14:23 -0400 Subject: [PATCH 1/8] Set FLAG_IMMUTABLE flag on FirstScreenBroadcast PendingIntent. Bug: 179289753 Bug: 183927137 Test: restore phone and ensure broadcast is sent Change-Id: I8d8e38a1aa6bdf13879d460cfa84cabe6c6bb1f2 (cherry picked from commit b62fba0d0199d719ac63761846e09b4b28e1dc2c) Merged-In: I8d8e38a1aa6bdf13879d460cfa84cabe6c6bb1f2 --- .../android/launcher3/model/FirstScreenBroadcast.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/model/FirstScreenBroadcast.java b/src/com/android/launcher3/model/FirstScreenBroadcast.java index 1149b553f6..b8dbd08901 100644 --- a/src/com/android/launcher3/model/FirstScreenBroadcast.java +++ b/src/com/android/launcher3/model/FirstScreenBroadcast.java @@ -15,6 +15,15 @@ */ package com.android.launcher3.model; +import static android.app.PendingIntent.FLAG_IMMUTABLE; +import static android.app.PendingIntent.FLAG_ONE_SHOT; +import static android.os.Process.myUserHandle; + +import static com.android.launcher3.pm.InstallSessionHelper.getUserHandle; + +import static java.util.stream.Collectors.groupingBy; +import static java.util.stream.Collectors.mapping; + import android.app.PendingIntent; import android.content.Context; import android.content.Intent; @@ -140,7 +149,7 @@ public class FirstScreenBroadcast { .putStringArrayListExtra(HOTSEAT_ITEM_EXTRA, new ArrayList<>(hotseatItems)) .putStringArrayListExtra(WIDGET_ITEM_EXTRA, new ArrayList<>(widgetItems)) .putExtra(VERIFICATION_TOKEN_EXTRA, PendingIntent.getActivity(context, 0, - new Intent(), PendingIntent.FLAG_ONE_SHOT))); + new Intent(), FLAG_ONE_SHOT | FLAG_IMMUTABLE))); } private static String getPackageName(ItemInfo info) { From 76877fda732a657086755a47a885ccf7b58aaa5e Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Tue, 8 Jun 2021 21:51:47 -0700 Subject: [PATCH 2/8] Update blur radius Bug: 189976220 Test: manual Change-Id: If5e6d6be7314dacfad8c501a5ae2da6556ca3cea --- quickstep/res/values/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml index b2ff7709d4..f22a9d7dbe 100644 --- a/quickstep/res/values/config.xml +++ b/quickstep/res/values/config.xml @@ -37,5 +37,5 @@ - 150 + 72 From 838414ab3adf6fe3641101c02133b759cd51c6f8 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 9 Jun 2021 10:41:02 +0100 Subject: [PATCH 3/8] Use FINAL_FRAME for leaving grid animation Bug: 14844554 Test: manual Change-Id: I9a8cf94a448de2520c4cc434f15377fa1f2d202e --- .../uioverrides/BaseRecentsViewStateController.java | 7 ++++--- .../quickstep/fallback/FallbackRecentsStateController.java | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 7a968c1799..d74b6c5f1d 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -17,6 +17,7 @@ package com.android.launcher3.uioverrides; import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT; +import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; @@ -113,9 +114,9 @@ public abstract class BaseRecentsViewStateController mRecentsView, getTaskModalnessProperty(), toState.getOverviewModalness(), config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR)); - setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, - toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f, - INSTANT); + boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()); + setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f, + showAsGrid ? INSTANT : FINAL_FRAME); } abstract FloatProperty getTaskModalnessProperty(); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index 854067b926..50b69dcff4 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -15,6 +15,7 @@ */ package com.android.quickstep.fallback; +import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL; @@ -93,8 +94,9 @@ public class FallbackRecentsStateController implements StateHandler Date: Wed, 9 Jun 2021 13:07:32 +0100 Subject: [PATCH 4/8] Avoid unnecessary onLayout if gesture is going to HOME Fixes: 186508379 Test: manual swipe up to carousel, then to home Change-Id: I97a642a6fc4c4d0ca3805b79db60b6dfdaea1315 --- quickstep/src/com/android/quickstep/views/RecentsView.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index c57d1562b9..2cfaa4db44 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2781,6 +2781,12 @@ public abstract class RecentsView Date: Mon, 7 Jun 2021 15:02:05 -0700 Subject: [PATCH 5/8] Revert the squish translate from all apps Bug: 189973274 Bug: 189975416 Test: manual, attached video on the bug Change-Id: I881a2b79462e8d420b3dcb6a6b98adbe9e8e0394 --- .../allapps/AllAppsContainerView.java | 28 +++---------------- .../launcher3/views/SpringRelativeLayout.java | 2 +- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index cb20fec47a..681f5e7a30 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -669,30 +669,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo } public void onPull(float deltaDistance, float displacement) { - absorbPullDeltaDistance(PULL_MULTIPLIER * deltaDistance, - PULL_MULTIPLIER * displacement); - // ideally, this should be done using EdgeEffect.onPush to create squish effect. - // However, until such method is available, launcher to simulate the onPush method. - mHeader.setTranslationY(-.5f * mHeaderTop * deltaDistance); - getRecyclerViewContainer().setTranslationY(-mHeaderTop * deltaDistance); - } - - public void onRelease() { - ValueAnimator anim1 = ValueAnimator.ofFloat(1f, 0f); - final float floatingHeaderHeight = getFloatingHeaderView().getTranslationY(); - final float recyclerViewHeight = getRecyclerViewContainer().getTranslationY(); - anim1.setDuration(200); - anim1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { - getFloatingHeaderView().setTranslationY( - ((float) valueAnimator.getAnimatedValue()) * floatingHeaderHeight); - getRecyclerViewContainer().setTranslationY( - ((float) valueAnimator.getAnimatedValue()) * recyclerViewHeight); - } - }); - anim1.start(); - super.onRelease(); + absorbPullDeltaDistance(PULL_MULTIPLIER * deltaDistance, PULL_MULTIPLIER * displacement); + // Current motion spec is to actually push and not pull + // on this surface. However, until EdgeEffect.onPush (b/190612804) is + // implemented at view level, we will simply pull } @Override diff --git a/src/com/android/launcher3/views/SpringRelativeLayout.java b/src/com/android/launcher3/views/SpringRelativeLayout.java index 8342d3e9d2..8e3ac20574 100644 --- a/src/com/android/launcher3/views/SpringRelativeLayout.java +++ b/src/com/android/launcher3/views/SpringRelativeLayout.java @@ -93,7 +93,7 @@ public class SpringRelativeLayout extends RelativeLayout { invalidate(); } - protected void onRelease() { + public void onRelease() { mEdgeGlowBottom.onRelease(); } From 08cca82ecab9327fce8ca959feaf0f88902d8f37 Mon Sep 17 00:00:00 2001 From: Samuel Fufa Date: Tue, 25 May 2021 19:21:37 -0500 Subject: [PATCH 6/8] [AllApps][Work] Introduce work toggle Fab Screenshot: https://screenshot.googleplex.com/C4r7kKPxv3PKdyN Bug: 186856928 Test: on-device Change-Id: I69ffa0ef367b182688e69c730fc9dee1afa7cadd --- res/drawable/work_apps_toggle_background.xml | 31 +++ res/layout/work_mode_fab.xml | 33 +++ res/layout/work_mode_switch.xml | 9 +- res/layout/work_profile_edu.xml | 61 ----- res/values/dimens.xml | 4 + res/values/strings.xml | 13 +- .../allapps/AllAppsContainerView.java | 4 +- .../allapps/LauncherAllAppsContainerView.java | 8 - .../launcher3/allapps/WorkModeSwitch.java | 168 +++---------- .../android/launcher3/views/WorkEduView.java | 230 ------------------ 10 files changed, 118 insertions(+), 443 deletions(-) create mode 100644 res/drawable/work_apps_toggle_background.xml create mode 100644 res/layout/work_mode_fab.xml delete mode 100644 res/layout/work_profile_edu.xml delete mode 100644 src/com/android/launcher3/views/WorkEduView.java diff --git a/res/drawable/work_apps_toggle_background.xml b/res/drawable/work_apps_toggle_background.xml new file mode 100644 index 0000000000..a04d269875 --- /dev/null +++ b/res/drawable/work_apps_toggle_background.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + diff --git a/res/layout/work_mode_fab.xml b/res/layout/work_mode_fab.xml new file mode 100644 index 0000000000..21f269fed6 --- /dev/null +++ b/res/layout/work_mode_fab.xml @@ -0,0 +1,33 @@ + + + \ No newline at end of file diff --git a/res/layout/work_mode_switch.xml b/res/layout/work_mode_switch.xml index 31953c72aa..538a180992 100644 --- a/res/layout/work_mode_switch.xml +++ b/res/layout/work_mode_switch.xml @@ -1,5 +1,4 @@ - - - + android:paddingTop="@dimen/work_profile_footer_padding" /> diff --git a/res/layout/work_profile_edu.xml b/res/layout/work_profile_edu.xml deleted file mode 100644 index c3c7010f7e..0000000000 --- a/res/layout/work_profile_edu.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - -