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 Original line 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 {
flag {
    name: "smartspace_viewpager2"
    name: "smartspace_viewpager2"
    namespace: "systemui"
    namespace: "systemui"
+293 −346

File changed.

Preview size limit exceeded, changes collapsed.

+8 −29
Original line number Original line Diff line number Diff line
@@ -42,14 +42,12 @@ import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.settingslib.Utils
import com.android.settingslib.Utils
import com.android.systemui.Dumpable
import com.android.systemui.Dumpable
import com.android.systemui.Flags.smartspaceLockscreenViewmodel
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.flags.Flags
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.BcSmartspaceConfigPlugin
import com.android.systemui.plugins.BcSmartspaceConfigPlugin
import com.android.systemui.plugins.BcSmartspaceDataPlugin
import com.android.systemui.plugins.BcSmartspaceDataPlugin
@@ -102,7 +100,6 @@ constructor(
    private val deviceProvisionedController: DeviceProvisionedController,
    private val deviceProvisionedController: DeviceProvisionedController,
    private val bypassController: KeyguardBypassController,
    private val bypassController: KeyguardBypassController,
    private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
    private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
    private val wakefulnessLifecycle: WakefulnessLifecycle,
    private val smartspaceViewModelFactory: SmartspaceViewModel.Factory,
    private val smartspaceViewModelFactory: SmartspaceViewModel.Factory,
    private val dumpManager: DumpManager,
    private val dumpManager: DumpManager,
    private val execution: Execution,
    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 {
    init {
        deviceProvisionedController.addCallback(deviceProvisionedListener)
        deviceProvisionedController.addCallback(deviceProvisionedListener)
        dumpManager.registerDumpable(this)
        dumpManager.registerDumpable(this)
@@ -460,7 +445,6 @@ constructor(
            setTag(R.id.tag_smartspace_view, Any())
            setTag(R.id.tag_smartspace_view, Any())
            addOnAttachStateChangeListener(stateChangeListener)
            addOnAttachStateChangeListener(stateChangeListener)


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


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


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


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

            managedUserHandle -> {
            managedUserHandle -> {
                // Really, this should be "if this managed profile is associated with the current
                // 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:
                // 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 &&
                userTracker.userHandle.identifier == UserHandle.USER_SYSTEM &&
                    (!t.isSensitive || showSensitiveContentForManagedUser)
                    (!t.isSensitive || showSensitiveContentForManagedUser)
            }
            }

            else -> {
            else -> {
                false
                false
            }
            }