Add animation when unoccluding windows (1/2) am: 6626f54e65
am: 314c05db45
Change-Id: I0e9d85e8f90d00fe835c0622438ac5b6afd2b52d
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index b52e4b0..2b3d643 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -507,6 +507,11 @@
* Retrieves the {@param outBounds} from the stack with id {@param stackId}.
*/
void getStackBounds(int stackId, Rect outBounds);
+
+ /**
+ * Overrides all currently playing app animations with {@param a}.
+ */
+ void overridePlayingAppAnimationsLw(Animation a);
}
public interface PointerEventListener {
diff --git a/core/java/com/android/internal/policy/IKeyguardService.aidl b/core/java/com/android/internal/policy/IKeyguardService.aidl
index 83d75fb..e51ad3f 100644
--- a/core/java/com/android/internal/policy/IKeyguardService.aidl
+++ b/core/java/com/android/internal/policy/IKeyguardService.aidl
@@ -28,8 +28,9 @@
* FLAG_SHOW_ON_LOCK_SCREEN.
*
* @param isOccluded Whether the Keyguard is occluded by another window.
+ * @param animate Whether to play an animation for the state change.
*/
- void setOccluded(boolean isOccluded);
+ void setOccluded(boolean isOccluded, boolean animate);
void addStateMonitorCallback(IKeyguardStateCallback callback);
void verifyUnlock(IKeyguardExitCallback callback);
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 36afbc6..07b0b86 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1947,6 +1947,7 @@
<java-symbol type="anim" name="lock_screen_behind_enter_fade_in" />
<java-symbol type="anim" name="lock_screen_wallpaper_exit" />
<java-symbol type="anim" name="launch_task_behind_source" />
+ <java-symbol type="anim" name="wallpaper_open_exit" />
<java-symbol type="bool" name="config_alwaysUseCdmaRssi" />
<java-symbol type="dimen" name="status_bar_icon_size" />
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
index 84901ee..b393cf7 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
@@ -90,10 +90,10 @@
}
@Override // Binder interface
- public void setOccluded(boolean isOccluded) {
+ public void setOccluded(boolean isOccluded, boolean animate) {
Trace.beginSection("KeyguardService.mBinder#setOccluded");
checkPermission();
- mKeyguardViewMediator.setOccluded(isOccluded);
+ mKeyguardViewMediator.setOccluded(isOccluded, animate);
Trace.endSection();
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index de0c77b..4449435 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1114,11 +1114,11 @@
/**
* Notify us when the keyguard is occluded by another window
*/
- public void setOccluded(boolean isOccluded) {
+ public void setOccluded(boolean isOccluded, boolean animate) {
Trace.beginSection("KeyguardViewMediator#setOccluded");
if (DEBUG) Log.d(TAG, "setOccluded " + isOccluded);
mHandler.removeMessages(SET_OCCLUDED);
- Message msg = mHandler.obtainMessage(SET_OCCLUDED, (isOccluded ? 1 : 0), 0);
+ Message msg = mHandler.obtainMessage(SET_OCCLUDED, isOccluded ? 1 : 0, animate ? 1 : 0);
mHandler.sendMessage(msg);
Trace.endSection();
}
@@ -1126,7 +1126,7 @@
/**
* Handles SET_OCCLUDED message sent by setOccluded()
*/
- private void handleSetOccluded(boolean isOccluded) {
+ private void handleSetOccluded(boolean isOccluded, boolean animate) {
Trace.beginSection("KeyguardViewMediator#handleSetOccluded");
synchronized (KeyguardViewMediator.this) {
if (mHiding && isOccluded) {
@@ -1137,7 +1137,7 @@
if (mOccluded != isOccluded) {
mOccluded = isOccluded;
- mStatusBarKeyguardViewManager.setOccluded(isOccluded);
+ mStatusBarKeyguardViewManager.setOccluded(isOccluded, animate);
updateActivityLockScreenState();
adjustStatusBarLocked();
}
@@ -1468,7 +1468,7 @@
break;
case SET_OCCLUDED:
Trace.beginSection("KeyguardViewMediator#handleMessage SET_OCCLUDED");
- handleSetOccluded(msg.arg1 != 0);
+ handleSetOccluded(msg.arg1 != 0, msg.arg2 != 0);
Trace.endSection();
break;
case KEYGUARD_TIMEOUT:
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index af85101..a6a5742 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -92,6 +92,7 @@
* Whether an instant expand request is currently pending and we are just waiting for layout.
*/
private boolean mInstantExpanding;
+ private boolean mAnimateAfterExpanding;
PanelBar mBar;
@@ -656,7 +657,7 @@
vel = 0;
}
mFlingAnimationUtils.apply(animator, mExpandedHeight, target, vel, getHeight());
- if (expandBecauseOfFalsing) {
+ if (vel == 0) {
animator.setDuration(350);
}
} else {
@@ -870,6 +871,7 @@
}
mInstantExpanding = true;
+ mAnimateAfterExpanding = animate;
mUpdateFlingOnLayout = false;
abortAnimations();
cancelPeek();
@@ -894,7 +896,7 @@
if (mStatusBar.getStatusBarWindow().getHeight()
!= mStatusBar.getStatusBarHeight()) {
getViewTreeObserver().removeOnGlobalLayoutListener(this);
- if (animate) {
+ if (mAnimateAfterExpanding) {
notifyExpandingStarted();
fling(0, true /* expand */);
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 535594b..f114084 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -279,6 +279,14 @@
*/
private static final int REMOTE_INPUT_KEPT_ENTRY_AUTO_CANCEL_DELAY = 200;
+ /**
+ * Never let the alpha become zero for surfaces that draw with SRC - otherwise the RenderNode
+ * won't draw anything and uninitialized memory will show through
+ * if mScrimSrcModeEnabled. Note that 0.001 is rounded down to 0 in
+ * libhwui.
+ */
+ private static final float SRC_MIN_ALPHA = 0.002f;
+
static {
boolean onlyCoreApps;
boolean freeformWindowManagement;
@@ -2209,17 +2217,13 @@
if (mBackdrop.getVisibility() != View.VISIBLE) {
mBackdrop.setVisibility(View.VISIBLE);
if (allowEnterAnimation) {
- mBackdrop.animate().alpha(1f).withEndAction(new Runnable() {
- @Override
- public void run() {
- mStatusBarWindowManager.setBackdropShowing(true);
- }
- });
+ mBackdrop.setAlpha(SRC_MIN_ALPHA);
+ mBackdrop.animate().alpha(1f);
} else {
mBackdrop.animate().cancel();
mBackdrop.setAlpha(1f);
- mStatusBarWindowManager.setBackdropShowing(true);
}
+ mStatusBarWindowManager.setBackdropShowing(true);
metaDataChanged = true;
if (DEBUG_MEDIA) {
Log.v(TAG, "DEBUG_MEDIA: Fading in album artwork");
@@ -2282,11 +2286,7 @@
} else {
mStatusBarWindowManager.setBackdropShowing(false);
mBackdrop.animate()
- // Never let the alpha become zero - otherwise the RenderNode
- // won't draw anything and uninitialized memory will show through
- // if mScrimSrcModeEnabled. Note that 0.001 is rounded down to 0 in
- // libhwui.
- .alpha(0.002f)
+ .alpha(SRC_MIN_ALPHA)
.setInterpolator(Interpolators.ACCELERATE_DECELERATE)
.setDuration(300)
.setStartDelay(0)
@@ -2301,7 +2301,6 @@
});
if (mKeyguardFadingAway) {
mBackdrop.animate()
-
// Make it disappear faster, as the focus should be on the activity
// behind.
.setDuration(mKeyguardFadingAwayDuration / 2)
@@ -4120,6 +4119,15 @@
}
/**
+ * Plays the animation when an activity that was occluding Keyguard goes away.
+ */
+ public void animateKeyguardUnoccluding() {
+ mScrimController.animateKeyguardUnoccluding(500);
+ mNotificationPanel.setExpandedFraction(0f);
+ animateExpandNotificationsPanel();
+ }
+
+ /**
* Starts the timeout when we try to start the affordances on Keyguard. We usually rely that
* Keyguard goes away via fadeKeyguardAfterLaunchTransition, however, that might not happen
* because the launched app crashed or something else went wrong.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 8b87a7f..73a95c2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -196,6 +196,14 @@
}
}
+ public void animateKeyguardUnoccluding(long duration) {
+ mAnimateChange = false;
+ setScrimBehindColor(0f);
+ mAnimateChange = true;
+ scheduleUpdate();
+ mDurationOverride = duration;
+ }
+
public void animateGoingToFullShade(long delay, long duration) {
mDurationOverride = duration;
mAnimationDelay = delay;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index c72f994..def4bc3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -242,7 +242,7 @@
return mStatusBarWindowManager.isShowingWallpaper();
}
- public void setOccluded(boolean occluded) {
+ public void setOccluded(boolean occluded, boolean animate) {
if (occluded && !mOccluded && mShowing) {
if (mPhoneStatusBar.isInLaunchTransition()) {
mOccluded = true;
@@ -258,9 +258,12 @@
}
}
mOccluded = occluded;
- mPhoneStatusBar.updateMediaMetaData(false, false);
+ mPhoneStatusBar.updateMediaMetaData(false, animate && !occluded);
mStatusBarWindowManager.setKeyguardOccluded(occluded);
reset();
+ if (animate && !occluded) {
+ mPhoneStatusBar.animateKeyguardUnoccluding();
+ }
}
public boolean isOccluded() {
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 7dd3b89..ee90011 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -5399,15 +5399,18 @@
boolean showing = mKeyguardDelegate.isShowing();
if (wasOccluded && !isOccluded && showing) {
mKeyguardOccluded = false;
- mKeyguardDelegate.setOccluded(false);
+ mKeyguardDelegate.setOccluded(false, true /* animate */);
mStatusBar.getAttrs().privateFlags |= PRIVATE_FLAG_KEYGUARD;
if (!mKeyguardDelegate.hasLockscreenWallpaper()) {
mStatusBar.getAttrs().flags |= FLAG_SHOW_WALLPAPER;
}
+ Animation anim = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.wallpaper_open_exit);
+ mWindowManagerFuncs.overridePlayingAppAnimationsLw(anim);
return true;
} else if (!wasOccluded && isOccluded && showing) {
mKeyguardOccluded = true;
- mKeyguardDelegate.setOccluded(true);
+ mKeyguardDelegate.setOccluded(true, false /* animate */);
mStatusBar.getAttrs().privateFlags &= ~PRIVATE_FLAG_KEYGUARD;
mStatusBar.getAttrs().flags &= ~FLAG_SHOW_WALLPAPER;
return true;
diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
index c48095e..acf855f 100644
--- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
+++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
@@ -188,7 +188,7 @@
mKeyguardService.onBootCompleted();
}
if (mKeyguardState.occluded) {
- mKeyguardService.setOccluded(mKeyguardState.occluded);
+ mKeyguardService.setOccluded(mKeyguardState.occluded, false /* animate */);
}
}
@@ -240,10 +240,10 @@
}
}
- public void setOccluded(boolean isOccluded) {
+ public void setOccluded(boolean isOccluded, boolean animate) {
if (mKeyguardService != null) {
- if (DEBUG) Log.v(TAG, "setOccluded(" + isOccluded + ")");
- mKeyguardService.setOccluded(isOccluded);
+ if (DEBUG) Log.v(TAG, "setOccluded(" + isOccluded + ") animate=" + animate);
+ mKeyguardService.setOccluded(isOccluded, animate);
}
mKeyguardState.occluded = isOccluded;
}
diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java
index 55652fe..2169927 100644
--- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java
+++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java
@@ -63,9 +63,9 @@
}
@Override // Binder interface
- public void setOccluded(boolean isOccluded) {
+ public void setOccluded(boolean isOccluded, boolean animate) {
try {
- mService.setOccluded(isOccluded);
+ mService.setOccluded(isOccluded, animate);
} catch (RemoteException e) {
Slog.w(TAG , "Remote Exception", e);
}
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 621e43a..a8a0b0e 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -30,6 +30,7 @@
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.WINDOW_REPLACEMENT_TIMEOUT_DURATION;
import static com.android.server.wm.WindowManagerService.H.NOTIFY_ACTIVITY_DRAWN;
+import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_NONE;
import com.android.server.input.InputApplicationHandle;
import com.android.server.wm.WindowManagerService.H;
@@ -44,6 +45,7 @@
import android.view.IApplicationToken;
import android.view.View;
import android.view.WindowManager;
+import android.view.animation.Animation;
import java.io.PrintWriter;
import java.util.ArrayDeque;
@@ -838,6 +840,18 @@
}
}
+ /**
+ * See {@link WindowManagerService#overridePlayingAppAnimationsLw}
+ */
+ void overridePlayingAppAnimations(Animation a) {
+ if (mAppAnimator.isAnimating()) {
+ final WindowState win = findMainWindow();
+ final int width = win.mContainingFrame.width();
+ final int height = win.mContainingFrame.height();
+ mAppAnimator.setAnimation(a, width, height, false, STACK_CLIP_NONE);
+ }
+ }
+
@Override
void dump(PrintWriter pw, String prefix) {
super.dump(pw, prefix);
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index aba64e8..9b5b101 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -35,6 +35,7 @@
import android.view.Display;
import android.view.DisplayInfo;
import android.view.Surface;
+import android.view.animation.Animation;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -674,4 +675,13 @@
return touchedWin;
}
+
+ /**
+ * See {@link WindowManagerService#overridePlayingAppAnimationsLw}.
+ */
+ void overridePlayingAppAnimationsLw(Animation a) {
+ for (int i = mStacks.size() - 1; i >= 0; i--) {
+ mStacks.get(i).overridePlayingAppAnimations(a);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index fb9fafc..ca183010 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -38,6 +38,7 @@
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.Surface;
+import android.view.animation.Animation;
import com.android.server.EventLogTags;
@@ -765,6 +766,15 @@
return mStack.getDisplayContent().getDisplayInfo();
}
+ /**
+ * See {@link WindowManagerService#overridePlayingAppAnimationsLw}
+ */
+ void overridePlayingAppAnimations(Animation a) {
+ for (int i = mAppTokens.size() - 1; i >= 0; i--) {
+ mAppTokens.get(i).overridePlayingAppAnimations(a);
+ }
+ }
+
@Override
public String toString() {
return "{taskId=" + mTaskId + " appTokens=" + mAppTokens + " mdr=" + mDeferRemoval + "}";
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index a665edd..8f8f642 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -44,6 +44,7 @@
import android.view.DisplayInfo;
import android.view.Surface;
import android.view.SurfaceControl;
+import android.view.animation.Animation;
import com.android.internal.policy.DividerSnapAlgorithm;
import com.android.internal.policy.DividerSnapAlgorithm.SnapTarget;
@@ -1367,4 +1368,13 @@
public boolean getBoundsAnimating() {
return mBoundsAnimating;
}
+
+ /**
+ * See {@link WindowManagerService#overridePlayingAppAnimationsLw}
+ */
+ void overridePlayingAppAnimations(Animation a) {
+ for (int i = mTasks.size() - 1; i >= 0; --i) {
+ mTasks.get(i).overridePlayingAppAnimations(a);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java
index 2b66c3a..e7ceba9 100644
--- a/services/core/java/com/android/server/wm/WallpaperController.java
+++ b/services/core/java/com/android/server/wm/WallpaperController.java
@@ -757,14 +757,16 @@
}
// Now stick it in. For apps over wallpaper keep the wallpaper at the bottommost
- // layer. For keyguard over wallpaper put the wallpaper under the keyguard.
+ // layer. For keyguard over wallpaper put the wallpaper under the lowest window that
+ // is currently on screen, i.e. not hidden by policy.
int insertionIndex = 0;
if (visible && wallpaperTarget != null) {
final int type = wallpaperTarget.mAttrs.type;
final int privateFlags = wallpaperTarget.mAttrs.privateFlags;
if ((privateFlags & PRIVATE_FLAG_KEYGUARD) != 0
|| type == TYPE_KEYGUARD_SCRIM) {
- insertionIndex = windows.indexOf(wallpaperTarget);
+ insertionIndex = Math.min(windows.indexOf(wallpaperTarget),
+ findLowestWindowOnScreen(windows));
}
}
if (DEBUG_WALLPAPER_LIGHT || DEBUG_WINDOW_MOVEMENT
@@ -781,6 +783,21 @@
return changed;
}
+ /**
+ * @return The index in {@param windows} of the lowest window that is currently on screen and
+ * not hidden by the policy.
+ */
+ private int findLowestWindowOnScreen(WindowList windows) {
+ final int size = windows.size();
+ for (int index = 0; index < size; index++) {
+ final WindowState win = windows.get(index);
+ if (win.isOnScreen()) {
+ return index;
+ }
+ }
+ return Integer.MAX_VALUE;
+ }
+
boolean adjustWallpaperWindows() {
mService.mWindowPlacerLocked.mWallpaperMayChange = false;
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index b0d357c..47b0f3b 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -234,14 +234,12 @@
boolean allowWhenLocked = false;
// Show IME over the keyguard if the target allows it
allowWhenLocked |= (win.mIsImWindow || imeTarget == win) && showImeOverKeyguard;
- // Show SHOW_WHEN_LOCKED windows that turn on the screen
- allowWhenLocked |= (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0 && win.mTurnOnScreen;
+ // Show SHOW_WHEN_LOCKED windows
+ allowWhenLocked |= (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0;
if (appShowWhenLocked != null) {
allowWhenLocked |= appShowWhenLocked == win.mAppToken
- // Show all SHOW_WHEN_LOCKED windows if some apps are shown over lockscreen
- || (win.mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0
- // Show error dialogs over apps that dismiss keyguard.
+ // Show error dialogs over apps that are shown on lockscreen
|| (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 2145e9b..47a4114 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -249,6 +249,7 @@
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowStateAnimator.DRAW_PENDING;
+import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_NONE;
/** {@hide} */
public class WindowManagerService extends IWindowManager.Stub
@@ -5211,6 +5212,11 @@
}
}
+ @Override
+ public void overridePlayingAppAnimationsLw(Animation a) {
+ getDefaultDisplayContentLocked().overridePlayingAppAnimationsLw(a);
+ }
+
/**
* Re-sizes a stack and its containing tasks.
* @param stackId Id of stack to resize.