Merge changes from topic "revert-11213348-launch-animation-leak-GIBWWKPCDE" into rvc-dev

* changes:
  Revert "Break strong ref to ExpandableNotificationRow"
  Revert "Pass main executor to ActivityLaunchAnimator"
This commit is contained in:
TreeHugger Robot
2020-05-27 22:50:15 +00:00
committed by Android (Google) Code Review
7 changed files with 38 additions and 117 deletions

View File

@@ -45,7 +45,6 @@ import com.android.systemui.car.bluetooth.CarBatteryController;
import com.android.systemui.car.navigationbar.CarNavigationBarController; import com.android.systemui.car.navigationbar.CarNavigationBarController;
import com.android.systemui.classifier.FalsingLog; import com.android.systemui.classifier.FalsingLog;
import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.keyguard.DismissCallbackRegistry;
@@ -173,7 +172,6 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
DisplayMetrics displayMetrics, DisplayMetrics displayMetrics,
MetricsLogger metricsLogger, MetricsLogger metricsLogger,
@UiBackground Executor uiBgExecutor, @UiBackground Executor uiBgExecutor,
@Main Executor mainExecutor,
NotificationMediaManager notificationMediaManager, NotificationMediaManager notificationMediaManager,
NotificationLockscreenUserManager lockScreenUserManager, NotificationLockscreenUserManager lockScreenUserManager,
NotificationRemoteInputManager remoteInputManager, NotificationRemoteInputManager remoteInputManager,
@@ -254,7 +252,6 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
displayMetrics, displayMetrics,
metricsLogger, metricsLogger,
uiBgExecutor, uiBgExecutor,
mainExecutor,
notificationMediaManager, notificationMediaManager,
lockScreenUserManager, lockScreenUserManager,
remoteInputManager, remoteInputManager,

View File

@@ -33,7 +33,6 @@ import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.car.CarDeviceProvisionedController; import com.android.systemui.car.CarDeviceProvisionedController;
import com.android.systemui.car.navigationbar.CarNavigationBarController; import com.android.systemui.car.navigationbar.CarNavigationBarController;
import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.keyguard.DismissCallbackRegistry;
import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.KeyguardViewMediator;
@@ -148,7 +147,6 @@ public class CarStatusBarModule {
DisplayMetrics displayMetrics, DisplayMetrics displayMetrics,
MetricsLogger metricsLogger, MetricsLogger metricsLogger,
@UiBackground Executor uiBgExecutor, @UiBackground Executor uiBgExecutor,
@Main Executor mainExecutor,
NotificationMediaManager notificationMediaManager, NotificationMediaManager notificationMediaManager,
NotificationLockscreenUserManager lockScreenUserManager, NotificationLockscreenUserManager lockScreenUserManager,
NotificationRemoteInputManager remoteInputManager, NotificationRemoteInputManager remoteInputManager,
@@ -228,7 +226,6 @@ public class CarStatusBarModule {
displayMetrics, displayMetrics,
metricsLogger, metricsLogger,
uiBgExecutor, uiBgExecutor,
mainExecutor,
notificationMediaManager, notificationMediaManager,
lockScreenUserManager, lockScreenUserManager,
remoteInputManager, remoteInputManager,

View File

@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.notification;
import android.animation.Animator; import android.animation.Animator;
import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.annotation.Nullable;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Rect; import android.graphics.Rect;
@@ -42,8 +41,6 @@ import com.android.systemui.statusbar.phone.CollapsedStatusBarFragment;
import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationPanelViewController;
import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController;
import java.util.concurrent.Executor;
/** /**
* A class that allows activities to be launched in a seamless way where the notification * A class that allows activities to be launched in a seamless way where the notification
* transforms nicely into the starting window. * transforms nicely into the starting window.
@@ -62,7 +59,6 @@ public class ActivityLaunchAnimator {
private final float mWindowCornerRadius; private final float mWindowCornerRadius;
private final NotificationShadeWindowViewController mNotificationShadeWindowViewController; private final NotificationShadeWindowViewController mNotificationShadeWindowViewController;
private final NotificationShadeDepthController mDepthController; private final NotificationShadeDepthController mDepthController;
private final Executor mMainExecutor;
private Callback mCallback; private Callback mCallback;
private final Runnable mTimeoutRunnable = () -> { private final Runnable mTimeoutRunnable = () -> {
setAnimationPending(false); setAnimationPending(false);
@@ -77,14 +73,12 @@ public class ActivityLaunchAnimator {
Callback callback, Callback callback,
NotificationPanelViewController notificationPanel, NotificationPanelViewController notificationPanel,
NotificationShadeDepthController depthController, NotificationShadeDepthController depthController,
NotificationListContainer container, NotificationListContainer container) {
Executor mainExecutor) {
mNotificationPanel = notificationPanel; mNotificationPanel = notificationPanel;
mNotificationContainer = container; mNotificationContainer = container;
mDepthController = depthController; mDepthController = depthController;
mNotificationShadeWindowViewController = notificationShadeWindowViewController; mNotificationShadeWindowViewController = notificationShadeWindowViewController;
mCallback = callback; mCallback = callback;
mMainExecutor = mainExecutor;
mWindowCornerRadius = ScreenDecorationsUtils mWindowCornerRadius = ScreenDecorationsUtils
.getWindowCornerRadius(mNotificationShadeWindowViewController.getView() .getWindowCornerRadius(mNotificationShadeWindowViewController.getView()
.getResources()); .getResources());
@@ -97,7 +91,7 @@ public class ActivityLaunchAnimator {
return null; return null;
} }
AnimationRunner animationRunner = new AnimationRunner( AnimationRunner animationRunner = new AnimationRunner(
(ExpandableNotificationRow) sourceView, mMainExecutor); (ExpandableNotificationRow) sourceView);
return new RemoteAnimationAdapter(animationRunner, ANIMATION_DURATION, return new RemoteAnimationAdapter(animationRunner, ANIMATION_DURATION,
ANIMATION_DURATION - 150 /* statusBarTransitionDelay */); ANIMATION_DURATION - 150 /* statusBarTransitionDelay */);
} }
@@ -140,18 +134,17 @@ public class ActivityLaunchAnimator {
class AnimationRunner extends IRemoteAnimationRunner.Stub { class AnimationRunner extends IRemoteAnimationRunner.Stub {
private final ExpandAnimationParameters mParams = new ExpandAnimationParameters(); private final ExpandableNotificationRow mSourceNotification;
private final ExpandAnimationParameters mParams;
private final Rect mWindowCrop = new Rect(); private final Rect mWindowCrop = new Rect();
private final float mNotificationCornerRadius; private final float mNotificationCornerRadius;
private final Executor mMainExecutor;
@Nullable private ExpandableNotificationRow mSourceNotification;
@Nullable private SyncRtSurfaceTransactionApplier mSyncRtTransactionApplier;
private float mCornerRadius; private float mCornerRadius;
private boolean mIsFullScreenLaunch = true; private boolean mIsFullScreenLaunch = true;
private final SyncRtSurfaceTransactionApplier mSyncRtTransactionApplier;
AnimationRunner(ExpandableNotificationRow sourceNotification, Executor mainExecutor) { public AnimationRunner(ExpandableNotificationRow sourceNofitication) {
mMainExecutor = mainExecutor; mSourceNotification = sourceNofitication;
mSourceNotification = sourceNotification; mParams = new ExpandAnimationParameters();
mSyncRtTransactionApplier = new SyncRtSurfaceTransactionApplier(mSourceNotification); mSyncRtTransactionApplier = new SyncRtSurfaceTransactionApplier(mSourceNotification);
mNotificationCornerRadius = Math.max(mSourceNotification.getCurrentTopRoundness(), mNotificationCornerRadius = Math.max(mSourceNotification.getCurrentTopRoundness(),
mSourceNotification.getCurrentBottomRoundness()); mSourceNotification.getCurrentBottomRoundness());
@@ -162,15 +155,13 @@ public class ActivityLaunchAnimator {
RemoteAnimationTarget[] remoteAnimationWallpaperTargets, RemoteAnimationTarget[] remoteAnimationWallpaperTargets,
IRemoteAnimationFinishedCallback iRemoteAnimationFinishedCallback) IRemoteAnimationFinishedCallback iRemoteAnimationFinishedCallback)
throws RemoteException { throws RemoteException {
mMainExecutor.execute(() -> { mSourceNotification.post(() -> {
RemoteAnimationTarget primary = getPrimaryRemoteAnimationTarget( RemoteAnimationTarget primary = getPrimaryRemoteAnimationTarget(
remoteAnimationTargets); remoteAnimationTargets);
if (primary == null || mSourceNotification == null) { if (primary == null) {
setAnimationPending(false); setAnimationPending(false);
invokeCallback(iRemoteAnimationFinishedCallback); invokeCallback(iRemoteAnimationFinishedCallback);
mNotificationPanel.collapse(false /* delayed */, 1.0f /* speedUpFactor */); mNotificationPanel.collapse(false /* delayed */, 1.0f /* speedUpFactor */);
mSourceNotification = null;
mSyncRtTransactionApplier = null;
return; return;
} }
@@ -181,14 +172,28 @@ public class ActivityLaunchAnimator {
if (!mIsFullScreenLaunch) { if (!mIsFullScreenLaunch) {
mNotificationPanel.collapseWithDuration(ANIMATION_DURATION); mNotificationPanel.collapseWithDuration(ANIMATION_DURATION);
} }
mParams.initFrom(mSourceNotification);
final int targetWidth = primary.sourceContainerBounds.width();
final int notificationHeight;
final int notificationWidth;
notificationHeight = mSourceNotification.getActualHeight()
- mSourceNotification.getClipBottomAmount();
notificationWidth = mSourceNotification.getWidth();
ValueAnimator anim = ValueAnimator.ofFloat(0, 1); ValueAnimator anim = ValueAnimator.ofFloat(0, 1);
mParams.startPosition = mSourceNotification.getLocationOnScreen();
mParams.startTranslationZ = mSourceNotification.getTranslationZ();
mParams.startClipTopAmount = mSourceNotification.getClipTopAmount();
if (mSourceNotification.isChildInGroup()) {
int parentClip = mSourceNotification
.getNotificationParent().getClipTopAmount();
mParams.parentStartClipTopAmount = parentClip;
// We need to calculate how much the child is clipped by the parent
// because children always have 0 clipTopAmount
if (parentClip != 0) {
float childClip = parentClip
- mSourceNotification.getTranslationY();
if (childClip > 0.0f) {
mParams.startClipTopAmount = (int) Math.ceil(childClip);
}
}
}
int targetWidth = primary.sourceContainerBounds.width();
int notificationHeight = mSourceNotification.getActualHeight()
- mSourceNotification.getClipBottomAmount();
int notificationWidth = mSourceNotification.getWidth();
anim.setDuration(ANIMATION_DURATION); anim.setDuration(ANIMATION_DURATION);
anim.setInterpolator(Interpolators.LINEAR); anim.setInterpolator(Interpolators.LINEAR);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@@ -226,11 +231,6 @@ public class ActivityLaunchAnimator {
}); });
} }
@Nullable
ExpandableNotificationRow getRow() {
return mSourceNotification;
}
private void invokeCallback(IRemoteAnimationFinishedCallback callback) { private void invokeCallback(IRemoteAnimationFinishedCallback callback) {
try { try {
callback.onAnimationFinished(); callback.onAnimationFinished();
@@ -253,9 +253,7 @@ public class ActivityLaunchAnimator {
private void setExpandAnimationRunning(boolean running) { private void setExpandAnimationRunning(boolean running) {
mNotificationPanel.setLaunchingNotification(running); mNotificationPanel.setLaunchingNotification(running);
if (mSourceNotification != null) { mSourceNotification.setExpandAnimationRunning(running);
mSourceNotification.setExpandAnimationRunning(running);
}
mNotificationShadeWindowViewController.setExpandAnimationRunning(running); mNotificationShadeWindowViewController.setExpandAnimationRunning(running);
mNotificationContainer.setExpandingNotification(running ? mSourceNotification : null); mNotificationContainer.setExpandingNotification(running ? mSourceNotification : null);
mAnimationRunning = running; mAnimationRunning = running;
@@ -263,8 +261,6 @@ public class ActivityLaunchAnimator {
mCallback.onExpandAnimationFinished(mIsFullScreenLaunch); mCallback.onExpandAnimationFinished(mIsFullScreenLaunch);
applyParamsToNotification(null); applyParamsToNotification(null);
applyParamsToNotificationShade(null); applyParamsToNotificationShade(null);
mSourceNotification = null;
mSyncRtTransactionApplier = null;
} }
} }
@@ -276,9 +272,7 @@ public class ActivityLaunchAnimator {
} }
private void applyParamsToNotification(ExpandAnimationParameters params) { private void applyParamsToNotification(ExpandAnimationParameters params) {
if (mSourceNotification != null) { mSourceNotification.applyExpandAnimationParams(params);
mSourceNotification.applyExpandAnimationParams(params);
}
} }
private void applyParamsToWindow(RemoteAnimationTarget app) { private void applyParamsToWindow(RemoteAnimationTarget app) {
@@ -293,18 +287,14 @@ public class ActivityLaunchAnimator {
.withCornerRadius(mCornerRadius) .withCornerRadius(mCornerRadius)
.withVisibility(true) .withVisibility(true)
.build(); .build();
if (mSyncRtTransactionApplier != null) { mSyncRtTransactionApplier.scheduleApply(true /* earlyWakeup */, params);
mSyncRtTransactionApplier.scheduleApply(true /* earlyWakeup */, params);
}
} }
@Override @Override
public void onAnimationCancelled() throws RemoteException { public void onAnimationCancelled() throws RemoteException {
mMainExecutor.execute(() -> { mSourceNotification.post(() -> {
setAnimationPending(false); setAnimationPending(false);
mCallback.onLaunchAnimationCancelled(); mCallback.onLaunchAnimationCancelled();
mSourceNotification = null;
mSyncRtTransactionApplier = null;
}); });
} }
}; };
@@ -369,28 +359,6 @@ public class ActivityLaunchAnimator {
public float getStartTranslationZ() { public float getStartTranslationZ() {
return startTranslationZ; return startTranslationZ;
} }
/** Initialize with data pulled from the row. */
void initFrom(@Nullable ExpandableNotificationRow row) {
if (row == null) {
return;
}
startPosition = row.getLocationOnScreen();
startTranslationZ = row.getTranslationZ();
startClipTopAmount = row.getClipTopAmount();
if (row.isChildInGroup()) {
int parentClip = row.getNotificationParent().getClipTopAmount();
parentStartClipTopAmount = parentClip;
// We need to calculate how much the child is clipped by the parent
// because children always have 0 clipTopAmount
if (parentClip != 0) {
float childClip = parentClip - row.getTranslationY();
if (childClip > 0.0f) {
startClipTopAmount = (int) Math.ceil(childClip);
}
}
}
}
} }
public interface Callback { public interface Callback {

View File

@@ -143,7 +143,6 @@ import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.charging.WirelessChargingAnimation; import com.android.systemui.charging.WirelessChargingAnimation;
import com.android.systemui.classifier.FalsingLog; import com.android.systemui.classifier.FalsingLog;
import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.fragments.ExtensionFragmentListener; import com.android.systemui.fragments.ExtensionFragmentListener;
import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.fragments.FragmentHostManager;
@@ -511,7 +510,6 @@ public class StatusBar extends SystemUI implements DemoMode,
private final ScrimController mScrimController; private final ScrimController mScrimController;
protected DozeScrimController mDozeScrimController; protected DozeScrimController mDozeScrimController;
private final Executor mUiBgExecutor; private final Executor mUiBgExecutor;
private final Executor mMainExecutor;
protected boolean mDozing; protected boolean mDozing;
@@ -670,7 +668,6 @@ public class StatusBar extends SystemUI implements DemoMode,
DisplayMetrics displayMetrics, DisplayMetrics displayMetrics,
MetricsLogger metricsLogger, MetricsLogger metricsLogger,
@UiBackground Executor uiBgExecutor, @UiBackground Executor uiBgExecutor,
@Main Executor mainExecutor,
NotificationMediaManager notificationMediaManager, NotificationMediaManager notificationMediaManager,
NotificationLockscreenUserManager lockScreenUserManager, NotificationLockscreenUserManager lockScreenUserManager,
NotificationRemoteInputManager remoteInputManager, NotificationRemoteInputManager remoteInputManager,
@@ -751,7 +748,6 @@ public class StatusBar extends SystemUI implements DemoMode,
mDisplayMetrics = displayMetrics; mDisplayMetrics = displayMetrics;
mMetricsLogger = metricsLogger; mMetricsLogger = metricsLogger;
mUiBgExecutor = uiBgExecutor; mUiBgExecutor = uiBgExecutor;
mMainExecutor = mainExecutor;
mMediaManager = notificationMediaManager; mMediaManager = notificationMediaManager;
mLockscreenUserManager = lockScreenUserManager; mLockscreenUserManager = lockScreenUserManager;
mRemoteInputManager = remoteInputManager; mRemoteInputManager = remoteInputManager;
@@ -1279,8 +1275,7 @@ public class StatusBar extends SystemUI implements DemoMode,
mActivityLaunchAnimator = new ActivityLaunchAnimator( mActivityLaunchAnimator = new ActivityLaunchAnimator(
mNotificationShadeWindowViewController, this, mNotificationPanelViewController, mNotificationShadeWindowViewController, this, mNotificationPanelViewController,
mNotificationShadeDepthControllerLazy.get(), mNotificationShadeDepthControllerLazy.get(),
(NotificationListContainer) mStackScroller, (NotificationListContainer) mStackScroller);
mMainExecutor);
// TODO: inject this. // TODO: inject this.
mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanelViewController, mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanelViewController,

View File

@@ -33,7 +33,6 @@ import com.android.systemui.assist.AssistManager;
import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.bubbles.BubbleController; import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.keyguard.DismissCallbackRegistry; import com.android.systemui.keyguard.DismissCallbackRegistry;
import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.keyguard.KeyguardViewMediator;
@@ -146,7 +145,6 @@ public interface StatusBarPhoneModule {
DisplayMetrics displayMetrics, DisplayMetrics displayMetrics,
MetricsLogger metricsLogger, MetricsLogger metricsLogger,
@UiBackground Executor uiBgExecutor, @UiBackground Executor uiBgExecutor,
@Main Executor mainExecutor,
NotificationMediaManager notificationMediaManager, NotificationMediaManager notificationMediaManager,
NotificationLockscreenUserManager lockScreenUserManager, NotificationLockscreenUserManager lockScreenUserManager,
NotificationRemoteInputManager remoteInputManager, NotificationRemoteInputManager remoteInputManager,
@@ -226,7 +224,6 @@ public interface StatusBarPhoneModule {
displayMetrics, displayMetrics,
metricsLogger, metricsLogger,
uiBgExecutor, uiBgExecutor,
mainExecutor,
notificationMediaManager, notificationMediaManager,
lockScreenUserManager, lockScreenUserManager,
remoteInputManager, remoteInputManager,

View File

@@ -19,18 +19,14 @@ package com.android.systemui.statusbar.notification;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.os.RemoteException;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import android.testing.AndroidTestingRunner; import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper; import android.testing.TestableLooper;
import android.view.IRemoteAnimationFinishedCallback;
import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import android.view.View; import android.view.View;
import com.android.systemui.SysuiTestCase; import com.android.systemui.SysuiTestCase;
@@ -40,8 +36,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain
import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationPanelViewController;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController;
import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.time.FakeSystemClock;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
@@ -74,11 +68,9 @@ public class ActivityLaunchAnimatorTest extends SysuiTestCase {
private NotificationPanelViewController mNotificationPanelViewController; private NotificationPanelViewController mNotificationPanelViewController;
@Rule @Rule
public MockitoRule rule = MockitoJUnit.rule(); public MockitoRule rule = MockitoJUnit.rule();
private FakeExecutor mExecutor;
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
mExecutor = new FakeExecutor(new FakeSystemClock());
when(mNotificationShadeWindowViewController.getView()) when(mNotificationShadeWindowViewController.getView())
.thenReturn(mNotificationShadeWindowView); .thenReturn(mNotificationShadeWindowView);
when(mNotificationShadeWindowView.getResources()).thenReturn(mContext.getResources()); when(mNotificationShadeWindowView.getResources()).thenReturn(mContext.getResources());
@@ -88,8 +80,8 @@ public class ActivityLaunchAnimatorTest extends SysuiTestCase {
mCallback, mCallback,
mNotificationPanelViewController, mNotificationPanelViewController,
mNotificationShadeDepthController, mNotificationShadeDepthController,
mNotificationContainer, mNotificationContainer);
mExecutor);
} }
@Test @Test
@@ -121,29 +113,6 @@ public class ActivityLaunchAnimatorTest extends SysuiTestCase {
verify(mCallback).onExpandAnimationTimedOut(); verify(mCallback).onExpandAnimationTimedOut();
} }
@Test
public void testRowLinkBrokenOnAnimationStartFail() throws RemoteException {
ActivityLaunchAnimator.AnimationRunner runner = mLaunchAnimator.new AnimationRunner(mRow,
mExecutor);
// WHEN onAnimationStart with no valid remote target
runner.onAnimationStart(new RemoteAnimationTarget[0], new RemoteAnimationTarget[0],
mock(IRemoteAnimationFinishedCallback.class));
mExecutor.runAllReady();
// THEN the row is nulled out so that it won't be retained
Assert.assertTrue("The row should be null", runner.getRow() == null);
}
@Test
public void testRowLinkBrokenOnAnimationCancelled() throws RemoteException {
ActivityLaunchAnimator.AnimationRunner runner = mLaunchAnimator.new AnimationRunner(mRow,
mExecutor);
// WHEN onAnimationCancelled
runner.onAnimationCancelled();
mExecutor.runAllReady();
// THEN the row is nulled out so that it won't be retained
Assert.assertTrue("The row should be null", runner.getRow() == null);
}
private void executePostsImmediately(View view) { private void executePostsImmediately(View view) {
doAnswer((i) -> { doAnswer((i) -> {
Runnable run = i.getArgument(0); Runnable run = i.getArgument(0);

View File

@@ -251,7 +251,6 @@ public class StatusBarTest extends SysuiTestCase {
@Mock private Lazy<NotificationShadeDepthController> mNotificationShadeDepthControllerLazy; @Mock private Lazy<NotificationShadeDepthController> mNotificationShadeDepthControllerLazy;
private ShadeController mShadeController; private ShadeController mShadeController;
private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock()); private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock());
private FakeExecutor mMainExecutor = new FakeExecutor(new FakeSystemClock());
private InitController mInitController = new InitController(); private InitController mInitController = new InitController();
@Before @Before
@@ -354,7 +353,6 @@ public class StatusBarTest extends SysuiTestCase {
new DisplayMetrics(), new DisplayMetrics(),
mMetricsLogger, mMetricsLogger,
mUiBgExecutor, mUiBgExecutor,
mMainExecutor,
mNotificationMediaManager, mNotificationMediaManager,
mLockscreenUserManager, mLockscreenUserManager,
mRemoteInputManager, mRemoteInputManager,