Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f150efc2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ib1e6ebd4,I4f71971e into main

* changes:
  Remove clock migration: bonus one
  Remove clock migration: the last one
parents 77b32335 bba5ad92
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -546,14 +546,6 @@ flag {
   bug: "305049544"
}

flag {
   name: "migrate_clocks_to_blueprint"
   namespace: "systemui"
   description: "Move clock related views from KeyguardStatusView to KeyguardRootView, "
        "and use modern architecture for lockscreen clocks"
   bug: "301502635"
}

flag {
   name: "clock_reactive_variants"
   namespace: "systemui"
+0 −22
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.haptics.msdl.FakeMSDLPlayer;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.KeyguardViewConfigurator;
import com.android.systemui.keyguard.data.repository.FakeKeyguardClockRepository;
import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository;
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor;
@@ -89,7 +88,6 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractorFactory;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.domain.interactor.NaturalScrollingSettingObserver;
import com.android.systemui.keyguard.ui.view.KeyguardRootView;
import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardTouchHandlingViewModel;
import com.android.systemui.kosmos.KosmosJavaAdapter;
@@ -240,9 +238,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected AmbientState mAmbientState;
    @Mock protected UserManager mUserManager;
    @Mock protected UiEventLogger mUiEventLogger;
    @Mock protected KeyguardViewConfigurator mKeyguardViewConfigurator;
    @Mock protected KeyguardRootView mKeyguardRootView;
    @Mock protected View mKeyguardRootViewChild;
    @Mock protected KeyguardMediaController mKeyguardMediaController;
    @Mock protected NavigationModeController mNavigationModeController;
    @Mock protected NavigationBarController mNavigationBarController;
@@ -534,9 +529,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        when(longPressHandlingView.getResources()).thenReturn(longPressHandlingViewRes);
        when(longPressHandlingViewRes.getString(anyInt())).thenReturn("");

        when(mKeyguardRootView.findViewById(anyInt())).thenReturn(mKeyguardRootViewChild);
        when(mKeyguardViewConfigurator.getKeyguardRootView()).thenReturn(mKeyguardRootView);

        mNotificationPanelViewController = new NotificationPanelViewController(
                mView,
                mMainHandler,
@@ -598,7 +590,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                mSharedNotificationContainerInteractor,
                mActiveNotificationsInteractor,
                mShadeAnimationInteractor,
                mKeyguardViewConfigurator,
                mDeviceEntryFaceAuthInteractor,
                new ResourcesSplitShadeStateController(),
                mPowerInteractor,
@@ -699,19 +690,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
        }
    }

    protected void setBottomPadding(int stackBottom, int lockIconPadding, int indicationPadding,
            int ambientPadding) {

        when(mNotificationStackScrollLayoutController.getTop()).thenReturn(0);
        when(mNotificationStackScrollLayoutController.getHeight()).thenReturn(stackBottom);
        when(mNotificationStackScrollLayoutController.getBottom()).thenReturn(stackBottom);
        when(mKeyguardRootViewChild.getTop()).thenReturn((int) (stackBottom - lockIconPadding));

        when(mResources.getDimensionPixelSize(R.dimen.keyguard_indication_bottom_padding))
                .thenReturn(indicationPadding);
        mNotificationPanelViewController.loadDimens();
    }

    protected void triggerPositionClockAndNotifications() {
        mNotificationPanelViewController.onQsSetExpansionHeightCalled(false);
    }
+0 −4
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import com.android.systemui.Flags.statusBarCallChipNotificationIcon
import com.android.systemui.Flags.statusBarScreenSharingChips
import com.android.systemui.Flags.statusBarUseReposForCallChip
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.statusbar.notification.collection.SortBySectionTimeFlag
@@ -64,9 +63,6 @@ class FlagDependencies @Inject constructor(featureFlags: FeatureFlagsClassic, ha
        // SceneContainer dependencies
        SceneContainerFlag.getFlagDependencies().forEach { (alpha, beta) -> alpha dependsOn beta }

        // CommunalHub dependencies
        communalHub dependsOn MigrateClocksToBlueprint.token

        // DualShade dependencies
        DualShade.token dependsOn SceneContainerFlag.getMainAconfigFlag()

+0 −8
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryHapticsInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
import com.android.systemui.keyguard.shared.model.LockscreenSceneBlueprint
import com.android.systemui.keyguard.ui.binder.KeyguardBlueprintViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardRootViewBinder
import com.android.systemui.keyguard.ui.binder.LightRevealScrimViewBinder
@@ -38,7 +37,6 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel
import com.android.systemui.keyguard.ui.viewmodel.LightRevealScrimViewModel
import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel
import com.android.systemui.keyguard.ui.viewmodel.OccludingAppDeviceEntryMessageViewModel
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.scene.shared.flag.SceneContainerFlag
@@ -47,13 +45,11 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.KeyguardIndicationController
import com.android.systemui.statusbar.LightRevealScrim
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationLockscreenScrimViewModel
import com.android.systemui.statusbar.phone.ScreenOffAnimationController
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
import com.android.systemui.wallpapers.ui.viewmodel.WallpaperViewModel
import com.google.android.msdl.domain.MSDLPlayer
import dagger.Lazy
import java.util.Optional
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
@@ -82,9 +78,6 @@ constructor(
    private val falsingManager: FalsingManager,
    private val keyguardClockViewModel: KeyguardClockViewModel,
    private val smartspaceViewModel: KeyguardSmartspaceViewModel,
    private val lockscreenContentViewModelFactory: LockscreenContentViewModel.Factory,
    private val notificationScrimViewModelFactory: NotificationLockscreenScrimViewModel.Factory,
    private val lockscreenSceneBlueprintsLazy: Lazy<Set<LockscreenSceneBlueprint>>,
    private val clockInteractor: KeyguardClockInteractor,
    private val keyguardViewMediator: KeyguardViewMediator,
    private val deviceEntryUnlockTrackerViewBinder: Optional<DeviceEntryUnlockTrackerViewBinder>,
@@ -97,7 +90,6 @@ constructor(
) : CoreStartable {

    private var rootViewHandle: DisposableHandle? = null
    private var indicationAreaHandle: DisposableHandle? = null

    override fun start() {
        bindKeyguardRootView()
+0 −53
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.keyguard

import com.android.systemui.Flags
import com.android.systemui.flags.FlagToken
import com.android.systemui.flags.RefactorFlagUtils

/** Helper for reading or using the migrate clocks to blueprint flag. */
@Suppress("NOTHING_TO_INLINE")
object MigrateClocksToBlueprint {
    /** The aconfig flag name */
    const val FLAG_NAME = Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT

    /** A token used for dependency declaration */
    val token: FlagToken
        get() = FlagToken(FLAG_NAME, isEnabled)

    /** Is the refactor enabled */
    @JvmStatic
    inline val isEnabled
        get() = Flags.migrateClocksToBlueprint()

    /**
     * Called to ensure code is only run when the flag is enabled. This protects users from the
     * unintended behaviors caused by accidentally running new logic, while also crashing on an eng
     * build to ensure that the refactor author catches issues in testing.
     */
    @JvmStatic
    inline fun isUnexpectedlyInLegacyMode() =
        RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)

    /**
     * Called to ensure code is only run when the flag is disabled. This will throw an exception if
     * the flag is enabled to ensure that the refactor author catches issues in testing.
     */
    @JvmStatic
    inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)
}
Loading