Skip resizing the stack when there is no current bounds.
- When initially calling loadConfigurationsAndApply(), the state is
set to STATE_NO_PIP when there is no pinned stack. As of change
ag/1725150, resizeStack no longer fails silently when there is no
such stack to resize. This CL skips the call to resizeStack() when
the PiP mode is set to STATE_NO_PIP.
Bug: 34692144
Test: Try and launch Fugu
Change-Id: Ic539f4431c2f94e7c10520c383fa49157d1d0631
(cherry picked from commit 87794464669d1dba94c7277f1fa1f21d6e3be82d)
diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java
index 56947e5..964fefa 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java
@@ -377,16 +377,18 @@
mCurrentPipBounds = mPipBounds;
break;
}
- try {
- int animationDurationMs = -1;
- if (wasRecentsShown
- && (mState == STATE_PIP_RECENTS || mState == STATE_PIP_RECENTS_FOCUSED)) {
- animationDurationMs = mRecentsFocusChangedAnimationDurationMs;
+ if (mCurrentPipBounds != null) {
+ try {
+ int animationDurationMs = -1;
+ if (wasRecentsShown
+ && (mState == STATE_PIP_RECENTS || mState == STATE_PIP_RECENTS_FOCUSED)) {
+ animationDurationMs = mRecentsFocusChangedAnimationDurationMs;
+ }
+ mActivityManager.resizeStack(PINNED_STACK_ID, mCurrentPipBounds,
+ true, true, true, animationDurationMs);
+ } catch (RemoteException e) {
+ Log.e(TAG, "resizeStack failed", e);
}
- mActivityManager.resizeStack(PINNED_STACK_ID, mCurrentPipBounds,
- true, true, true, animationDurationMs);
- } catch (RemoteException e) {
- Log.e(TAG, "resizeStack failed", e);
}
}