Merge "Remove blurs when adjusting brightness" into rvc-dev am: 137af5ad16 am: d369b905da
Change-Id: I74e4e09ed39a80ecfe09898ae7881a2eef74620a
This commit is contained in:
@@ -65,6 +65,7 @@ import com.android.systemui.statusbar.NavigationBarController;
|
|||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
|
import com.android.systemui.statusbar.NotificationShadeDepthController;
|
||||||
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
||||||
import com.android.systemui.statusbar.PulseExpansionHandler;
|
import com.android.systemui.statusbar.PulseExpansionHandler;
|
||||||
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
|
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
|
||||||
@@ -225,6 +226,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
|
|||||||
KeyguardIndicationController keyguardIndicationController,
|
KeyguardIndicationController keyguardIndicationController,
|
||||||
DismissCallbackRegistry dismissCallbackRegistry,
|
DismissCallbackRegistry dismissCallbackRegistry,
|
||||||
StatusBarTouchableRegionManager statusBarTouchableRegionManager,
|
StatusBarTouchableRegionManager statusBarTouchableRegionManager,
|
||||||
|
Lazy<NotificationShadeDepthController> depthControllerLazy,
|
||||||
/* Car Settings injected components. */
|
/* Car Settings injected components. */
|
||||||
CarNavigationBarController carNavigationBarController) {
|
CarNavigationBarController carNavigationBarController) {
|
||||||
super(
|
super(
|
||||||
@@ -304,6 +306,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
|
|||||||
phoneStatusBarPolicy,
|
phoneStatusBarPolicy,
|
||||||
keyguardIndicationController,
|
keyguardIndicationController,
|
||||||
dismissCallbackRegistry,
|
dismissCallbackRegistry,
|
||||||
|
depthControllerLazy,
|
||||||
statusBarTouchableRegionManager);
|
statusBarTouchableRegionManager);
|
||||||
mUserSwitcherController = userSwitcherController;
|
mUserSwitcherController = userSwitcherController;
|
||||||
mScrimController = scrimController;
|
mScrimController = scrimController;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import com.android.systemui.statusbar.NavigationBarController;
|
|||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
|
import com.android.systemui.statusbar.NotificationShadeDepthController;
|
||||||
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
||||||
import com.android.systemui.statusbar.PulseExpansionHandler;
|
import com.android.systemui.statusbar.PulseExpansionHandler;
|
||||||
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
|
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
|
||||||
@@ -200,6 +201,7 @@ public class CarStatusBarModule {
|
|||||||
KeyguardIndicationController keyguardIndicationController,
|
KeyguardIndicationController keyguardIndicationController,
|
||||||
DismissCallbackRegistry dismissCallbackRegistry,
|
DismissCallbackRegistry dismissCallbackRegistry,
|
||||||
StatusBarTouchableRegionManager statusBarTouchableRegionManager,
|
StatusBarTouchableRegionManager statusBarTouchableRegionManager,
|
||||||
|
Lazy<NotificationShadeDepthController> notificationShadeDepthControllerLazy,
|
||||||
CarNavigationBarController carNavigationBarController) {
|
CarNavigationBarController carNavigationBarController) {
|
||||||
return new CarStatusBar(
|
return new CarStatusBar(
|
||||||
context,
|
context,
|
||||||
@@ -278,6 +280,7 @@ public class CarStatusBarModule {
|
|||||||
keyguardIndicationController,
|
keyguardIndicationController,
|
||||||
dismissCallbackRegistry,
|
dismissCallbackRegistry,
|
||||||
statusBarTouchableRegionManager,
|
statusBarTouchableRegionManager,
|
||||||
|
notificationShadeDepthControllerLazy,
|
||||||
carNavigationBarController);
|
carNavigationBarController);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import com.android.systemui.statusbar.phone.PanelExpansionListener
|
|||||||
import com.android.systemui.statusbar.policy.KeyguardStateController
|
import com.android.systemui.statusbar.policy.KeyguardStateController
|
||||||
import java.io.FileDescriptor
|
import java.io.FileDescriptor
|
||||||
import java.io.PrintWriter
|
import java.io.PrintWriter
|
||||||
import java.lang.IllegalArgumentException
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
@@ -74,6 +73,15 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
var globalActionsSpring = DepthAnimation()
|
var globalActionsSpring = DepthAnimation()
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
var brightnessMirrorSpring = DepthAnimation()
|
||||||
|
var brightnessMirrorVisible: Boolean = false
|
||||||
|
set(value) {
|
||||||
|
field = value
|
||||||
|
brightnessMirrorSpring.animateTo(if (value) blurUtils.blurRadiusOfRatio(1f)
|
||||||
|
else 0)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blur radius of the wake-up animation on this frame.
|
* Blur radius of the wake-up animation on this frame.
|
||||||
*/
|
*/
|
||||||
@@ -91,7 +99,9 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
val updateBlurCallback = Choreographer.FrameCallback {
|
val updateBlurCallback = Choreographer.FrameCallback {
|
||||||
updateScheduled = false
|
updateScheduled = false
|
||||||
|
|
||||||
val blur = max(max(shadeSpring.radius, wakeAndUnlockBlurRadius), globalActionsSpring.radius)
|
var shadeRadius = max(shadeSpring.radius, wakeAndUnlockBlurRadius)
|
||||||
|
shadeRadius = (shadeRadius * (1f - brightnessMirrorSpring.ratio)).toInt()
|
||||||
|
val blur = max(shadeRadius, globalActionsSpring.radius)
|
||||||
blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur)
|
blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur)
|
||||||
try {
|
try {
|
||||||
wallpaperManager.setWallpaperZoomOut(root.windowToken,
|
wallpaperManager.setWallpaperZoomOut(root.windowToken,
|
||||||
@@ -148,6 +158,7 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
if (isDozing) {
|
if (isDozing) {
|
||||||
shadeSpring.finishIfRunning()
|
shadeSpring.finishIfRunning()
|
||||||
globalActionsSpring.finishIfRunning()
|
globalActionsSpring.finishIfRunning()
|
||||||
|
brightnessMirrorSpring.finishIfRunning()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,6 +210,7 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
it.increaseIndent()
|
it.increaseIndent()
|
||||||
it.println("shadeRadius: ${shadeSpring.radius}")
|
it.println("shadeRadius: ${shadeSpring.radius}")
|
||||||
it.println("globalActionsRadius: ${globalActionsSpring.radius}")
|
it.println("globalActionsRadius: ${globalActionsSpring.radius}")
|
||||||
|
it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}")
|
||||||
it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius")
|
it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,7 +224,12 @@ class NotificationShadeDepthController @Inject constructor(
|
|||||||
* Blur radius visible on the UI, in pixels.
|
* Blur radius visible on the UI, in pixels.
|
||||||
*/
|
*/
|
||||||
var radius = 0
|
var radius = 0
|
||||||
private set
|
|
||||||
|
/**
|
||||||
|
* Depth ratio of the current blur radius.
|
||||||
|
*/
|
||||||
|
val ratio
|
||||||
|
get() = blurUtils.ratioOfBlurRadius(radius)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Radius that we're animating to.
|
* Radius that we're animating to.
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
|||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
import com.android.systemui.statusbar.NotificationPresenter;
|
import com.android.systemui.statusbar.NotificationPresenter;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
|
import com.android.systemui.statusbar.NotificationShadeDepthController;
|
||||||
import com.android.systemui.statusbar.NotificationShelf;
|
import com.android.systemui.statusbar.NotificationShelf;
|
||||||
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
||||||
import com.android.systemui.statusbar.PulseExpansionHandler;
|
import com.android.systemui.statusbar.PulseExpansionHandler;
|
||||||
@@ -589,6 +590,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
private ActivityLaunchAnimator mActivityLaunchAnimator;
|
private ActivityLaunchAnimator mActivityLaunchAnimator;
|
||||||
protected StatusBarNotificationPresenter mPresenter;
|
protected StatusBarNotificationPresenter mPresenter;
|
||||||
private NotificationActivityStarter mNotificationActivityStarter;
|
private NotificationActivityStarter mNotificationActivityStarter;
|
||||||
|
private Lazy<NotificationShadeDepthController> mNotificationShadeDepthControllerLazy;
|
||||||
private final BubbleController mBubbleController;
|
private final BubbleController mBubbleController;
|
||||||
private final BubbleController.BubbleExpandListener mBubbleExpandListener;
|
private final BubbleController.BubbleExpandListener mBubbleExpandListener;
|
||||||
|
|
||||||
@@ -679,6 +681,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
PhoneStatusBarPolicy phoneStatusBarPolicy,
|
PhoneStatusBarPolicy phoneStatusBarPolicy,
|
||||||
KeyguardIndicationController keyguardIndicationController,
|
KeyguardIndicationController keyguardIndicationController,
|
||||||
DismissCallbackRegistry dismissCallbackRegistry,
|
DismissCallbackRegistry dismissCallbackRegistry,
|
||||||
|
Lazy<NotificationShadeDepthController> notificationShadeDepthControllerLazy,
|
||||||
StatusBarTouchableRegionManager statusBarTouchableRegionManager) {
|
StatusBarTouchableRegionManager statusBarTouchableRegionManager) {
|
||||||
super(context);
|
super(context);
|
||||||
mNotificationsController = notificationsController;
|
mNotificationsController = notificationsController;
|
||||||
@@ -735,6 +738,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
mScreenPinningRequest = screenPinningRequest;
|
mScreenPinningRequest = screenPinningRequest;
|
||||||
mDozeScrimController = dozeScrimController;
|
mDozeScrimController = dozeScrimController;
|
||||||
mBiometricUnlockControllerLazy = biometricUnlockControllerLazy;
|
mBiometricUnlockControllerLazy = biometricUnlockControllerLazy;
|
||||||
|
mNotificationShadeDepthControllerLazy = notificationShadeDepthControllerLazy;
|
||||||
mVolumeComponent = volumeComponent;
|
mVolumeComponent = volumeComponent;
|
||||||
mCommandQueue = commandQueue;
|
mCommandQueue = commandQueue;
|
||||||
mRecentsOptional = recentsOptional;
|
mRecentsOptional = recentsOptional;
|
||||||
@@ -1135,6 +1139,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
mBrightnessMirrorController = new BrightnessMirrorController(
|
mBrightnessMirrorController = new BrightnessMirrorController(
|
||||||
mNotificationShadeWindowView,
|
mNotificationShadeWindowView,
|
||||||
mNotificationPanelViewController,
|
mNotificationPanelViewController,
|
||||||
|
mNotificationShadeDepthControllerLazy.get(),
|
||||||
(visible) -> {
|
(visible) -> {
|
||||||
mBrightnessMirrorVisible = visible;
|
mBrightnessMirrorVisible = visible;
|
||||||
updateScrimController();
|
updateScrimController();
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import com.android.systemui.statusbar.NavigationBarController;
|
|||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
|
import com.android.systemui.statusbar.NotificationShadeDepthController;
|
||||||
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
||||||
import com.android.systemui.statusbar.PulseExpansionHandler;
|
import com.android.systemui.statusbar.PulseExpansionHandler;
|
||||||
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
|
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
|
||||||
@@ -197,6 +198,7 @@ public interface StatusBarPhoneModule {
|
|||||||
UserInfoControllerImpl userInfoControllerImpl,
|
UserInfoControllerImpl userInfoControllerImpl,
|
||||||
PhoneStatusBarPolicy phoneStatusBarPolicy,
|
PhoneStatusBarPolicy phoneStatusBarPolicy,
|
||||||
KeyguardIndicationController keyguardIndicationController,
|
KeyguardIndicationController keyguardIndicationController,
|
||||||
|
Lazy<NotificationShadeDepthController> notificationShadeDepthController,
|
||||||
DismissCallbackRegistry dismissCallbackRegistry,
|
DismissCallbackRegistry dismissCallbackRegistry,
|
||||||
StatusBarTouchableRegionManager statusBarTouchableRegionManager) {
|
StatusBarTouchableRegionManager statusBarTouchableRegionManager) {
|
||||||
return new StatusBar(
|
return new StatusBar(
|
||||||
@@ -276,6 +278,7 @@ public interface StatusBarPhoneModule {
|
|||||||
phoneStatusBarPolicy,
|
phoneStatusBarPolicy,
|
||||||
keyguardIndicationController,
|
keyguardIndicationController,
|
||||||
dismissCallbackRegistry,
|
dismissCallbackRegistry,
|
||||||
|
notificationShadeDepthController,
|
||||||
statusBarTouchableRegionManager);
|
statusBarTouchableRegionManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.view.View;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.statusbar.NotificationShadeDepthController;
|
||||||
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;
|
||||||
|
|
||||||
@@ -39,16 +40,19 @@ public class BrightnessMirrorController
|
|||||||
private final NotificationShadeWindowView mStatusBarWindow;
|
private final NotificationShadeWindowView mStatusBarWindow;
|
||||||
private final Consumer<Boolean> mVisibilityCallback;
|
private final Consumer<Boolean> mVisibilityCallback;
|
||||||
private final NotificationPanelViewController mNotificationPanel;
|
private final NotificationPanelViewController mNotificationPanel;
|
||||||
|
private final NotificationShadeDepthController mDepthController;
|
||||||
private final ArraySet<BrightnessMirrorListener> mBrightnessMirrorListeners = new ArraySet<>();
|
private final ArraySet<BrightnessMirrorListener> mBrightnessMirrorListeners = new ArraySet<>();
|
||||||
private final int[] mInt2Cache = new int[2];
|
private final int[] mInt2Cache = new int[2];
|
||||||
private View mBrightnessMirror;
|
private View mBrightnessMirror;
|
||||||
|
|
||||||
public BrightnessMirrorController(NotificationShadeWindowView statusBarWindow,
|
public BrightnessMirrorController(NotificationShadeWindowView statusBarWindow,
|
||||||
NotificationPanelViewController notificationPanelViewController,
|
NotificationPanelViewController notificationPanelViewController,
|
||||||
|
NotificationShadeDepthController notificationShadeDepthController,
|
||||||
@NonNull Consumer<Boolean> visibilityCallback) {
|
@NonNull Consumer<Boolean> visibilityCallback) {
|
||||||
mStatusBarWindow = statusBarWindow;
|
mStatusBarWindow = statusBarWindow;
|
||||||
mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror);
|
mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror);
|
||||||
mNotificationPanel = notificationPanelViewController;
|
mNotificationPanel = notificationPanelViewController;
|
||||||
|
mDepthController = notificationShadeDepthController;
|
||||||
mNotificationPanel.setPanelAlphaEndAction(() -> {
|
mNotificationPanel.setPanelAlphaEndAction(() -> {
|
||||||
mBrightnessMirror.setVisibility(View.INVISIBLE);
|
mBrightnessMirror.setVisibility(View.INVISIBLE);
|
||||||
});
|
});
|
||||||
@@ -59,11 +63,13 @@ public class BrightnessMirrorController
|
|||||||
mBrightnessMirror.setVisibility(View.VISIBLE);
|
mBrightnessMirror.setVisibility(View.VISIBLE);
|
||||||
mVisibilityCallback.accept(true);
|
mVisibilityCallback.accept(true);
|
||||||
mNotificationPanel.setPanelAlpha(0, true /* animate */);
|
mNotificationPanel.setPanelAlpha(0, true /* animate */);
|
||||||
|
mDepthController.setBrightnessMirrorVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideMirror() {
|
public void hideMirror() {
|
||||||
mVisibilityCallback.accept(false);
|
mVisibilityCallback.accept(false);
|
||||||
mNotificationPanel.setPanelAlpha(255, true /* animate */);
|
mNotificationPanel.setPanelAlpha(255, true /* animate */);
|
||||||
|
mDepthController.setBrightnessMirrorVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLocation(View original) {
|
public void setLocation(View original) {
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import org.mockito.Mockito.clearInvocations
|
|||||||
import org.mockito.Mockito.doThrow
|
import org.mockito.Mockito.doThrow
|
||||||
import org.mockito.Mockito.verify
|
import org.mockito.Mockito.verify
|
||||||
import org.mockito.junit.MockitoJUnit
|
import org.mockito.junit.MockitoJUnit
|
||||||
import java.lang.IllegalArgumentException
|
|
||||||
|
|
||||||
@RunWith(AndroidTestingRunner::class)
|
@RunWith(AndroidTestingRunner::class)
|
||||||
@RunWithLooper
|
@RunWithLooper
|
||||||
@@ -64,6 +63,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
|
|||||||
@Mock private lateinit var viewRootImpl: ViewRootImpl
|
@Mock private lateinit var viewRootImpl: ViewRootImpl
|
||||||
@Mock private lateinit var shadeSpring: NotificationShadeDepthController.DepthAnimation
|
@Mock private lateinit var shadeSpring: NotificationShadeDepthController.DepthAnimation
|
||||||
@Mock private lateinit var globalActionsSpring: NotificationShadeDepthController.DepthAnimation
|
@Mock private lateinit var globalActionsSpring: NotificationShadeDepthController.DepthAnimation
|
||||||
|
@Mock private lateinit var brightnessSpring: NotificationShadeDepthController.DepthAnimation
|
||||||
@JvmField @Rule val mockitoRule = MockitoJUnit.rule()
|
@JvmField @Rule val mockitoRule = MockitoJUnit.rule()
|
||||||
|
|
||||||
private lateinit var statusBarStateListener: StatusBarStateController.StateListener
|
private lateinit var statusBarStateListener: StatusBarStateController.StateListener
|
||||||
@@ -83,6 +83,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
|
|||||||
keyguardStateController, choreographer, wallpaperManager,
|
keyguardStateController, choreographer, wallpaperManager,
|
||||||
notificationShadeWindowController, dumpManager)
|
notificationShadeWindowController, dumpManager)
|
||||||
notificationShadeDepthController.shadeSpring = shadeSpring
|
notificationShadeDepthController.shadeSpring = shadeSpring
|
||||||
|
notificationShadeDepthController.brightnessMirrorSpring = brightnessSpring
|
||||||
notificationShadeDepthController.globalActionsSpring = globalActionsSpring
|
notificationShadeDepthController.globalActionsSpring = globalActionsSpring
|
||||||
notificationShadeDepthController.root = root
|
notificationShadeDepthController.root = root
|
||||||
|
|
||||||
@@ -134,6 +135,30 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
|
|||||||
verify(wallpaperManager).setWallpaperZoomOut(any(), anyFloat())
|
verify(wallpaperManager).setWallpaperZoomOut(any(), anyFloat())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun brightnessMirrorVisible_whenVisible() {
|
||||||
|
notificationShadeDepthController.brightnessMirrorVisible = true
|
||||||
|
verify(brightnessSpring).animateTo(eq(maxBlur), any())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun brightnessMirrorVisible_whenHidden() {
|
||||||
|
notificationShadeDepthController.brightnessMirrorVisible = false
|
||||||
|
verify(brightnessSpring).animateTo(eq(0), any())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun brightnessMirror_hidesShadeBlur() {
|
||||||
|
// Brightness mirror is fully visible
|
||||||
|
`when`(brightnessSpring.ratio).thenReturn(1f)
|
||||||
|
// And shade is blurred
|
||||||
|
`when`(shadeSpring.radius).thenReturn(maxBlur)
|
||||||
|
|
||||||
|
notificationShadeDepthController.updateBlurCallback.doFrame(0)
|
||||||
|
verify(notificationShadeWindowController).setBackgroundBlurRadius(0)
|
||||||
|
verify(blurUtils).applyBlur(safeEq(viewRootImpl), eq(0))
|
||||||
|
}
|
||||||
|
|
||||||
private fun <T : Any> safeEq(value: T): T {
|
private fun <T : Any> safeEq(value: T): T {
|
||||||
return eq(value) ?: value
|
return eq(value) ?: value
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ import com.android.systemui.statusbar.NotificationListener;
|
|||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
|
import com.android.systemui.statusbar.NotificationShadeDepthController;
|
||||||
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
|
||||||
import com.android.systemui.statusbar.PulseExpansionHandler;
|
import com.android.systemui.statusbar.PulseExpansionHandler;
|
||||||
import com.android.systemui.statusbar.RemoteInputController;
|
import com.android.systemui.statusbar.RemoteInputController;
|
||||||
@@ -249,6 +250,7 @@ public class StatusBarTest extends SysuiTestCase {
|
|||||||
@Mock private ExtensionController mExtensionController;
|
@Mock private ExtensionController mExtensionController;
|
||||||
@Mock private UserInfoControllerImpl mUserInfoControllerImpl;
|
@Mock private UserInfoControllerImpl mUserInfoControllerImpl;
|
||||||
@Mock private PhoneStatusBarPolicy mPhoneStatusBarPolicy;
|
@Mock private PhoneStatusBarPolicy mPhoneStatusBarPolicy;
|
||||||
|
@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 InitController mInitController = new InitController();
|
private InitController mInitController = new InitController();
|
||||||
@@ -404,6 +406,7 @@ public class StatusBarTest extends SysuiTestCase {
|
|||||||
mPhoneStatusBarPolicy,
|
mPhoneStatusBarPolicy,
|
||||||
mKeyguardIndicationController,
|
mKeyguardIndicationController,
|
||||||
mDismissCallbackRegistry,
|
mDismissCallbackRegistry,
|
||||||
|
mNotificationShadeDepthControllerLazy,
|
||||||
mStatusBarTouchableRegionManager);
|
mStatusBarTouchableRegionManager);
|
||||||
|
|
||||||
when(mNotificationShadeWindowView.findViewById(R.id.lock_icon_container)).thenReturn(
|
when(mNotificationShadeWindowView.findViewById(R.id.lock_icon_container)).thenReturn(
|
||||||
|
|||||||
Reference in New Issue
Block a user