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

Commit 0435f46f authored by Ale Nijamkin's avatar Ale Nijamkin
Browse files

[flexiglass] Early return if smartspace isn't enabled

Attempting to bind the views when the plugin for smartspace isn't
present causes a runtime crash. Checking whether it's enabled is the way
to guard against that. The check was forgotten in ag/33448654.

Fix: 421454656
Test: temporarily made the check return false and ran with Flexiglass
on; made sure that there was no crash and that the layout without
smartspace looks ok
Flag: com.android.systemui.scene_container

Change-Id: I7228cbda479f6bfc9866429da754891b5a8ee982
parent d987f495
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.keyguard.ui.composable.element
import android.widget.FrameLayout
import android.widget.FrameLayout
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Row
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Composable
@@ -41,6 +42,11 @@ constructor(


    @Composable
    @Composable
    fun DateAndWeather(orientation: Orientation, modifier: Modifier = Modifier) {
    fun DateAndWeather(orientation: Orientation, modifier: Modifier = Modifier) {
        if (!keyguardSmartspaceViewModel.isSmartspaceEnabled) {
            Box(modifier)
            return
        }

        when (orientation) {
        when (orientation) {
            Orientation.Horizontal ->
            Orientation.Horizontal ->
                Row(
                Row(