diff options
4 files changed, 40 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java index ced725e0b1d6..ea9817c68c30 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java @@ -702,6 +702,13 @@ public class NotificationMediaManager implements Dumpable { mProcessArtworkTasks.remove(task); } + // TODO(b/273443374): remove + public boolean isLockscreenWallpaperOnNotificationShade() { + return mBackdrop != null && mLockscreenWallpaper != null + && !mLockscreenWallpaper.isLockscreenLiveWallpaperEnabled() + && (mBackdropFront.isVisibleToUser() || mBackdropBack.isVisibleToUser()); + } + /** * {@link AsyncTask} to prepare album art for use as backdrop on lock screen. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java index 3268032becf8..2814e8d8f97b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java @@ -49,6 +49,7 @@ import com.android.systemui.plugins.log.LogLevel; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.statusbar.CommandQueue; +import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.disableflags.DisableStateTracker; @@ -119,6 +120,9 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat private final Object mLock = new Object(); private final KeyguardLogger mLogger; + // TODO(b/273443374): remove + private NotificationMediaManager mNotificationMediaManager; + private final ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { @Override @@ -283,7 +287,8 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat SecureSettings secureSettings, CommandQueue commandQueue, @Main Executor mainExecutor, - KeyguardLogger logger + KeyguardLogger logger, + NotificationMediaManager notificationMediaManager ) { super(view); mCarrierTextController = carrierTextController; @@ -335,6 +340,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat /* mask2= */ DISABLE2_SYSTEM_ICONS, this::updateViewState ); + mNotificationMediaManager = notificationMediaManager; } @Override @@ -484,8 +490,11 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat * (1.0f - mKeyguardHeadsUpShowingAmount); } - if (mSystemEventAnimator.isAnimationRunning()) { + if (mSystemEventAnimator.isAnimationRunning() + && !mNotificationMediaManager.isLockscreenWallpaperOnNotificationShade()) { newAlpha = Math.min(newAlpha, mSystemEventAnimatorAlpha); + } else { + mView.setTranslationX(0); } boolean hideForBypass = @@ -625,11 +634,21 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat private StatusBarSystemEventDefaultAnimator getSystemEventAnimator(boolean isAnimationRunning) { return new StatusBarSystemEventDefaultAnimator(getResources(), (alpha) -> { - mSystemEventAnimatorAlpha = alpha; + // TODO(b/273443374): remove if-else condition + if (!mNotificationMediaManager.isLockscreenWallpaperOnNotificationShade()) { + mSystemEventAnimatorAlpha = alpha; + } else { + mSystemEventAnimatorAlpha = 1f; + } updateViewState(); return Unit.INSTANCE; }, (translationX) -> { - mView.setTranslationX(translationX); + // TODO(b/273443374): remove if-else condition + if (!mNotificationMediaManager.isLockscreenWallpaperOnNotificationShade()) { + mView.setTranslationX(translationX); + } else { + mView.setTranslationX(0); + } return Unit.INSTANCE; }, isAnimationRunning); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenWallpaper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenWallpaper.java index 0814ea593a0b..c16877a999f3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenWallpaper.java @@ -233,6 +233,11 @@ public class LockscreenWallpaper extends IWallpaperManagerCallback.Stub implemen }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } + // TODO(b/273443374): remove + public boolean isLockscreenLiveWallpaperEnabled() { + return mWallpaperManager.isLockscreenLiveWallpaperEnabled(); + } + @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println(getClass().getSimpleName() + ":"); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java index eb0b9b3a3fb1..760a90b4d59a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java @@ -54,6 +54,7 @@ import com.android.systemui.battery.BatteryMeterViewController; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.statusbar.CommandQueue; +import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; import com.android.systemui.statusbar.policy.BatteryController; @@ -120,6 +121,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { @Mock private CommandQueue mCommandQueue; @Mock private KeyguardLogger mLogger; + @Mock private NotificationMediaManager mNotificationMediaManager; + private TestNotificationPanelViewStateProvider mNotificationPanelViewStateProvider; private KeyguardStatusBarView mKeyguardStatusBarView; private KeyguardStatusBarViewController mController; @@ -167,7 +170,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { mSecureSettings, mCommandQueue, mFakeExecutor, - mLogger + mLogger, + mNotificationMediaManager ); } |