From 6d5a1c1307bc9bac6385835c758eccb5e14756f4 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 29 Mar 2022 16:28:10 -0700 Subject: [PATCH 1/8] Fixing crash when unfolding with an app already open Bug: 227388787 Test: Manual Change-Id: Ib1726b99a978bd613c337c2eff4873322d894485 --- .../com/android/quickstep/TouchInteractionService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index ff67b096da..ba4bc5d9c7 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -71,6 +71,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.provider.RestoreDbTask; import com.android.launcher3.statemanager.StatefulActivity; +import com.android.launcher3.taskbar.TaskbarActivityContext; import com.android.launcher3.taskbar.TaskbarManager; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; @@ -687,11 +688,9 @@ public class TouchInteractionService extends Service } // If Taskbar is present, we listen for long press to unstash it. - BaseActivityInterface activityInterface = newGestureState.getActivityInterface(); - StatefulActivity activity = activityInterface.getCreatedActivity(); - if (activity != null && activity.getDeviceProfile().isTaskbarPresent) { - base = new TaskbarStashInputConsumer(this, base, mInputMonitorCompat, - mTaskbarManager.getCurrentActivityContext()); + TaskbarActivityContext tac = mTaskbarManager.getCurrentActivityContext(); + if (tac != null) { + base = new TaskbarStashInputConsumer(this, base, mInputMonitorCompat, tac); } // If Bubbles is expanded, use the overlay input consumer, which will close Bubbles From 34aad9e022286a48dbd3853a71a0bebcc6454949 Mon Sep 17 00:00:00 2001 From: shawnlin Date: Fri, 25 Mar 2022 15:53:34 +0800 Subject: [PATCH 2/8] Fixed cts failure of WindowInsetsControllerTests If stashing taskbar is caused IME visiblity, we could just skip updating rounded corner insets since the rounded corners will be covered by IME during IME is showing and task bar will be restored back to unstashed when IME is hidden. Bug: 225765490 Test: atest WindowInsetsControllerTests Change-Id: If8f40add0d4d9f746169d26f46f27545b4023e90 --- .../taskbar/TaskbarStashController.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 54dd0b2379..e119bed664 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -64,6 +64,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba | FLAG_STASHED_IN_APP_PINNED | FLAG_STASHED_IN_APP_EMPTY | FLAG_STASHED_IN_APP_SETUP | FLAG_STASHED_IN_APP_IME | FLAG_STASHED_IN_APP_ALL_APPS; + private static final int FLAGS_STASHED_IN_APP_IGNORING_IME = + FLAGS_STASHED_IN_APP & ~FLAG_STASHED_IN_APP_IME; + // If any of these flags are enabled, inset apps by our stashed height instead of our unstashed // height. This way the reported insets are consistent even during transitions out of the app. // Currently any flag that causes us to stash in an app is included, except for IME or All Apps @@ -237,6 +240,13 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba return hasAnyFlag(FLAGS_STASHED_IN_APP); } + /** + * Returns whether the taskbar should be stashed in apps regardless of the IME visibility. + */ + public boolean isStashedInAppIgnoringIme() { + return hasAnyFlag(FLAGS_STASHED_IN_APP_IGNORING_IME); + } + /** * Returns whether the taskbar should be stashed in the current LauncherState. */ @@ -585,7 +595,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba private void notifyStashChange(boolean visible, boolean stashed) { mSystemUiProxy.notifyTaskbarStatus(visible, stashed); - mControllers.taskbarActivityContext.updateInsetRoundedCornerFrame(visible && !stashed); + // If stashing taskbar is caused by IME visibility, we could just skip updating rounded + // corner insets since the rounded corners will be covered by IME during IME is showing and + // taskbar will be restored back to unstashed when IME is hidden. + mControllers.taskbarActivityContext.updateInsetRoundedCornerFrame( + visible && !isStashedInAppIgnoringIme()); mControllers.rotationButtonController.onTaskbarStateChange(visible, stashed); } From d20011be15e84932c928c7320ffd11225dad6a08 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Tue, 29 Mar 2022 19:25:25 -0700 Subject: [PATCH 3/8] Change work_app_edu to be like T spec: https://screenshot.googleplex.com/43ThiCnqrAqAQgE Fixed the button to show on Portrait mode..streamline added for work_mode_fab. Took out unneccessary attributes such as textColor for the button and took out background. How it looks in landscape: https://screenshot.googleplex.com/AVaUEztqsXYA28N How it looks in portrait: https://screenshot.googleplex.com/3oTG3j7yZLCxkLz Apk: https://drive.google.com/file/d/1qLeiJSF3lHf7tZzoHWwBHGxDgbveTIYX/view?usp=sharing Test: Manual - Tested on local Pixel device (Raven) Bug: 224731116 Bug: 224731300 Change-Id: If1392806adecf1ce02723d20686ca6bf524f6464 --- res/layout/work_apps_edu.xml | 50 ++++++++++++------- res/layout/work_mode_fab.xml | 2 + res/values/dimens.xml | 17 +++++-- .../allapps/WorkAdapterProvider.java | 2 - 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/res/layout/work_apps_edu.xml b/res/layout/work_apps_edu.xml index 1517087fe2..73200de591 100644 --- a/res/layout/work_apps_edu.xml +++ b/res/layout/work_apps_edu.xml @@ -19,37 +19,49 @@ android:layout_marginTop="8dp" android:gravity="center"> - - - -