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

Commit ea7e6e1e authored by Liam, Lee Pong Lam's avatar Liam, Lee Pong Lam
Browse files

Remove flag smartspaceLockscreenViewmodel

Bug: 409612394
Test: unit tests
Flag: EXEMPT cleanup
Change-Id: I59933708ce260ad0172203c740566823234d8dd6
parent 9ae9bad4
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -849,13 +849,6 @@ flag {
   }
}

flag {
   name: "smartspace_lockscreen_viewmodel"
   namespace: "systemui"
   description: "Indicate Smartspace lockscreen viewmodel"
   bug: "331451011"
}

flag {
    name: "smartspace_viewpager2"
    namespace: "systemui"
+293 −346

File changed.

Preview size limit exceeded, changes collapsed.

+8 −29
Original line number Diff line number Diff line
@@ -42,14 +42,12 @@ import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.settingslib.Utils
import com.android.systemui.Dumpable
import com.android.systemui.Flags.smartspaceLockscreenViewmodel
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.BcSmartspaceConfigPlugin
import com.android.systemui.plugins.BcSmartspaceDataPlugin
@@ -102,7 +100,6 @@ constructor(
    private val deviceProvisionedController: DeviceProvisionedController,
    private val bypassController: KeyguardBypassController,
    private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
    private val wakefulnessLifecycle: WakefulnessLifecycle,
    private val smartspaceViewModelFactory: SmartspaceViewModel.Factory,
    private val dumpManager: DumpManager,
    private val execution: Execution,
@@ -298,18 +295,6 @@ constructor(
            }
        }

    // TODO(b/331451011): Refactor to viewmodel and use interactor pattern.
    private val wakefulnessLifecycleObserver =
        object : WakefulnessLifecycle.Observer {
            override fun onStartedWakingUp() {
                smartspaceViews.forEach { it.setScreenOn(true) }
            }

            override fun onFinishedGoingToSleep() {
                smartspaceViews.forEach { it.setScreenOn(false) }
            }
        }

    init {
        deviceProvisionedController.addCallback(deviceProvisionedListener)
        dumpManager.registerDumpable(this)
@@ -460,7 +445,6 @@ constructor(
            setTag(R.id.tag_smartspace_view, Any())
            addOnAttachStateChangeListener(stateChangeListener)

            if (smartspaceLockscreenViewmodel()) {
            val viewModel = smartspaceViewModelFactory.create(surfaceName)
            SmartspaceViewBinder.bind(
                smartspaceView = ssView,
@@ -469,7 +453,6 @@ constructor(
            )
        }
    }
    }

    private fun connectSession() {
        if (userSmartspaceManager == null) {
@@ -523,9 +506,6 @@ constructor(
        configurationController.addCallback(configChangeListener)
        statusBarStateController.addCallback(statusBarStateListener)
        bypassController.registerOnBypassStateChangedListener(bypassStateChangedListener)
        if (!smartspaceLockscreenViewmodel()) {
            wakefulnessLifecycle.addObserver(wakefulnessLifecycleObserver)
        }

        datePlugin?.registerSmartspaceEventNotifier { e -> session?.notifySmartspaceEvent(e) }
        weatherPlugin?.registerSmartspaceEventNotifier { e -> session?.notifySmartspaceEvent(e) }
@@ -565,9 +545,6 @@ constructor(
        configurationController.removeCallback(configChangeListener)
        statusBarStateController.removeCallback(statusBarStateListener)
        bypassController.unregisterOnBypassStateChangedListener(bypassStateChangedListener)
        if (!smartspaceLockscreenViewmodel()) {
            wakefulnessLifecycle.removeObserver(wakefulnessLifecycleObserver)
        }
        session = null

        datePlugin?.registerSmartspaceEventNotifier(null)
@@ -616,6 +593,7 @@ constructor(
            userTracker.userHandle -> {
                !t.isSensitive || showSensitiveContentForCurrentUser
            }

            managedUserHandle -> {
                // Really, this should be "if this managed profile is associated with the current
                // active user", but we don't have a good way to check that, so instead we cheat:
@@ -624,6 +602,7 @@ constructor(
                userTracker.userHandle.identifier == UserHandle.USER_SYSTEM &&
                    (!t.isSensitive || showSensitiveContentForManagedUser)
            }

            else -> {
                false
            }