[automerger skipped] Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master am: 923156a720 -s ours am: 942aeb2c4c -s ours
am: 0fb01f7cf9 -s ours
am skip reason: change_id I157ff596deb419a57eca32a9b8d954d76294f627 with SHA1 ecb37ee845 is in history
Change-Id: Ifc6bb76e519332399a6e3fee63a461b632a6431d
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 0d29e5d..a3bd348 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -217,6 +217,7 @@
private AnimationFactory mAnimationFactory = (t) -> { };
private LiveTileOverlay mLiveTileOverlay = new LiveTileOverlay();
+ private boolean mLiveTileOverlayAttached = false;
private boolean mWasLauncherAlreadyVisible;
@@ -323,8 +324,7 @@
mRecentsView = activity.getOverviewPanel();
linkRecentsViewScroll();
- mRecentsView.setLiveTileOverlay(mLiveTileOverlay);
- mActivity.getRootView().getOverlay().add(mLiveTileOverlay);
+ addLiveTileOverlay();
mStateCallback.setState(STATE_LAUNCHER_PRESENT);
if (alreadyOnHome) {
@@ -972,7 +972,7 @@
@Override
public void onAnimationStart(Animator animation) {
if (mActivity != null) {
- mActivity.getRootView().getOverlay().remove(mLiveTileOverlay);
+ removeLiveTileOverlay();
}
}
@@ -1071,7 +1071,7 @@
mRecentsView.onGestureAnimationEnd();
mActivity.getRootView().setOnApplyWindowInsetsListener(null);
- mActivity.getRootView().getOverlay().remove(mLiveTileOverlay);
+ removeLiveTileOverlay();
}
private void endLauncherTransitionController() {
@@ -1201,6 +1201,22 @@
updateFinalShift();
}
+ private synchronized void addLiveTileOverlay() {
+ if (!mLiveTileOverlayAttached) {
+ mActivity.getRootView().getOverlay().add(mLiveTileOverlay);
+ mRecentsView.setLiveTileOverlay(mLiveTileOverlay);
+ mLiveTileOverlayAttached = true;
+ }
+ }
+
+ private synchronized void removeLiveTileOverlay() {
+ if (mLiveTileOverlayAttached) {
+ mActivity.getRootView().getOverlay().remove(mLiveTileOverlay);
+ mRecentsView.setLiveTileOverlay(null);
+ mLiveTileOverlayAttached = false;
+ }
+ }
+
public static float getHiddenTargetAlpha(RemoteAnimationTargetCompat app, float expectedAlpha) {
if (!isNotInRecents(app)) {
return 0;
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index 1bf77f5..3e1d61a 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -825,7 +825,7 @@
*/
public void onSwipeUpAnimationSuccess() {
if (getRunningTaskView() != null) {
- float startProgress = ENABLE_QUICKSTEP_LIVE_TILE.get()
+ float startProgress = ENABLE_QUICKSTEP_LIVE_TILE.get() && mLiveTileOverlay != null
? mLiveTileOverlay.cancelIconAnimation()
: 0f;
animateUpRunningTaskIconScale(startProgress);
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index ba122f9..3bef598 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -732,7 +732,7 @@
int[] array = new int[tokenizer.countTokens()];
int count = 0;
while (tokenizer.hasMoreTokens()) {
- array[count] = Integer.parseInt(tokenizer.nextToken().trim());
+ array[count] = Integer.parseInt(tokenizer.nextToken());
count++;
}
return array;