Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +5 −6 Original line number Diff line number Diff line Loading @@ -197,8 +197,7 @@ constructor( initiallySelectedSlotId = bundle.getString( KeyguardPreviewConstants.KEY_INITIALLY_SELECTED_SLOT_ID, ) ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START, ) ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START, shouldHighlightSelectedAffordance = shouldHighlightSelectedAffordance, ) } else { Loading Loading @@ -230,8 +229,7 @@ constructor( val previewContext = display?.let { ContextThemeWrapper(context.createDisplayContext(it), context.getTheme()) } ?: context } ?: context val rootView = FrameLayout(previewContext) Loading Loading @@ -318,8 +316,8 @@ constructor( */ private fun setUpSmartspace(previewContext: Context, parentView: ViewGroup) { if ( !lockscreenSmartspaceController.isEnabled() || !lockscreenSmartspaceController.isDateWeatherDecoupled() !lockscreenSmartspaceController.isEnabled || !lockscreenSmartspaceController.isDateWeatherDecoupled ) { return } Loading Loading @@ -654,6 +652,7 @@ constructor( clockController.clock = clock } } private fun onClockChanged() { if (MigrateClocksToBlueprint.isEnabled) { return Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/KeyguardSliceViewSection.kt +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ constructor( ) : KeyguardSection() { override fun addViews(constraintLayout: ConstraintLayout) { if (!MigrateClocksToBlueprint.isEnabled) return if (smartspaceController.isEnabled()) return if (smartspaceController.isEnabled) return constraintLayout.findViewById<View?>(R.id.keyguard_slice_view)?.let { (it.parent as ViewGroup).removeView(it) Loading @@ -47,7 +47,7 @@ constructor( override fun applyConstraints(constraintSet: ConstraintSet) { if (!MigrateClocksToBlueprint.isEnabled) return if (smartspaceController.isEnabled()) return if (smartspaceController.isEnabled) return constraintSet.apply { connect( Loading Loading @@ -82,7 +82,7 @@ constructor( override fun removeViews(constraintLayout: ConstraintLayout) { if (!MigrateClocksToBlueprint.isEnabled) return if (smartspaceController.isEnabled()) return if (smartspaceController.isEnabled) return constraintLayout.removeView(R.id.keyguard_slice_view) } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardSmartspaceViewModel.kt +2 −2 Original line number Diff line number Diff line Loading @@ -40,12 +40,12 @@ constructor( smartspaceInteractor: KeyguardSmartspaceInteractor, ) { /** Whether the smartspace section is available in the build. */ val isSmartspaceEnabled: Boolean = smartspaceController.isEnabled() val isSmartspaceEnabled: Boolean = smartspaceController.isEnabled /** Whether the weather area is available in the build. */ private val isWeatherEnabled: StateFlow<Boolean> = smartspaceInteractor.isWeatherEnabled /** Whether the data and weather areas are decoupled in the build. */ val isDateWeatherDecoupled: Boolean = smartspaceController.isDateWeatherDecoupled() val isDateWeatherDecoupled: Boolean = smartspaceController.isDateWeatherDecoupled /** Whether the date area should be visible. */ val isDateVisible: StateFlow<Boolean> = Loading packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +18 −24 Original line number Diff line number Diff line Loading @@ -305,24 +305,18 @@ constructor( dumpManager.registerDumpable(this) } fun isEnabled(): Boolean { execution.assertIsMainThread() return plugin != null } fun isDateWeatherDecoupled(): Boolean { execution.assertIsMainThread() val isEnabled: Boolean = plugin != null return datePlugin != null && weatherPlugin != null } val isDateWeatherDecoupled: Boolean = datePlugin != null && weatherPlugin != null fun isWeatherEnabled(): Boolean { execution.assertIsMainThread() val showWeather = secureSettings.getIntForUser( val isWeatherEnabled: Boolean get() { val showWeather = secureSettings.getIntForUser( LOCK_SCREEN_WEATHER_ENABLED, 1, userTracker.userId) == 1 userTracker.userId, ) == 1 return showWeather } Loading @@ -337,10 +331,10 @@ constructor( fun buildAndConnectDateView(parent: ViewGroup): View? { execution.assertIsMainThread() if (!isEnabled()) { if (!isEnabled) { throw RuntimeException("Cannot build view when not enabled") } if (!isDateWeatherDecoupled()) { if (!isDateWeatherDecoupled) { throw RuntimeException("Cannot build date view when not decoupled") } Loading @@ -361,10 +355,10 @@ constructor( fun buildAndConnectWeatherView(parent: ViewGroup): View? { execution.assertIsMainThread() if (!isEnabled()) { if (!isEnabled) { throw RuntimeException("Cannot build view when not enabled") } if (!isDateWeatherDecoupled()) { if (!isDateWeatherDecoupled) { throw RuntimeException("Cannot build weather view when not decoupled") } Loading @@ -385,7 +379,7 @@ constructor( fun buildAndConnectView(parent: ViewGroup): View? { execution.assertIsMainThread() if (!isEnabled()) { if (!isEnabled) { throw RuntimeException("Cannot build view when not enabled") } Loading Loading @@ -577,7 +571,7 @@ constructor( } private fun filterSmartspaceTarget(t: SmartspaceTarget): Boolean { if (isDateWeatherDecoupled() && t.featureType == SmartspaceTarget.FEATURE_WEATHER) { if (isDateWeatherDecoupled && t.featureType == SmartspaceTarget.FEATURE_WEATHER) { return false } if (!showNotifications) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaViewController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class KeyguardBottomAreaViewController } override fun onViewAttached() { if (!smartspaceRelocateToBottom() || !smartspaceController.isEnabled()) { if (!smartspaceRelocateToBottom() || !smartspaceController.isEnabled) { return } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +5 −6 Original line number Diff line number Diff line Loading @@ -197,8 +197,7 @@ constructor( initiallySelectedSlotId = bundle.getString( KeyguardPreviewConstants.KEY_INITIALLY_SELECTED_SLOT_ID, ) ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START, ) ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START, shouldHighlightSelectedAffordance = shouldHighlightSelectedAffordance, ) } else { Loading Loading @@ -230,8 +229,7 @@ constructor( val previewContext = display?.let { ContextThemeWrapper(context.createDisplayContext(it), context.getTheme()) } ?: context } ?: context val rootView = FrameLayout(previewContext) Loading Loading @@ -318,8 +316,8 @@ constructor( */ private fun setUpSmartspace(previewContext: Context, parentView: ViewGroup) { if ( !lockscreenSmartspaceController.isEnabled() || !lockscreenSmartspaceController.isDateWeatherDecoupled() !lockscreenSmartspaceController.isEnabled || !lockscreenSmartspaceController.isDateWeatherDecoupled ) { return } Loading Loading @@ -654,6 +652,7 @@ constructor( clockController.clock = clock } } private fun onClockChanged() { if (MigrateClocksToBlueprint.isEnabled) { return Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/KeyguardSliceViewSection.kt +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ constructor( ) : KeyguardSection() { override fun addViews(constraintLayout: ConstraintLayout) { if (!MigrateClocksToBlueprint.isEnabled) return if (smartspaceController.isEnabled()) return if (smartspaceController.isEnabled) return constraintLayout.findViewById<View?>(R.id.keyguard_slice_view)?.let { (it.parent as ViewGroup).removeView(it) Loading @@ -47,7 +47,7 @@ constructor( override fun applyConstraints(constraintSet: ConstraintSet) { if (!MigrateClocksToBlueprint.isEnabled) return if (smartspaceController.isEnabled()) return if (smartspaceController.isEnabled) return constraintSet.apply { connect( Loading Loading @@ -82,7 +82,7 @@ constructor( override fun removeViews(constraintLayout: ConstraintLayout) { if (!MigrateClocksToBlueprint.isEnabled) return if (smartspaceController.isEnabled()) return if (smartspaceController.isEnabled) return constraintLayout.removeView(R.id.keyguard_slice_view) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardSmartspaceViewModel.kt +2 −2 Original line number Diff line number Diff line Loading @@ -40,12 +40,12 @@ constructor( smartspaceInteractor: KeyguardSmartspaceInteractor, ) { /** Whether the smartspace section is available in the build. */ val isSmartspaceEnabled: Boolean = smartspaceController.isEnabled() val isSmartspaceEnabled: Boolean = smartspaceController.isEnabled /** Whether the weather area is available in the build. */ private val isWeatherEnabled: StateFlow<Boolean> = smartspaceInteractor.isWeatherEnabled /** Whether the data and weather areas are decoupled in the build. */ val isDateWeatherDecoupled: Boolean = smartspaceController.isDateWeatherDecoupled() val isDateWeatherDecoupled: Boolean = smartspaceController.isDateWeatherDecoupled /** Whether the date area should be visible. */ val isDateVisible: StateFlow<Boolean> = Loading
packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt +18 −24 Original line number Diff line number Diff line Loading @@ -305,24 +305,18 @@ constructor( dumpManager.registerDumpable(this) } fun isEnabled(): Boolean { execution.assertIsMainThread() return plugin != null } fun isDateWeatherDecoupled(): Boolean { execution.assertIsMainThread() val isEnabled: Boolean = plugin != null return datePlugin != null && weatherPlugin != null } val isDateWeatherDecoupled: Boolean = datePlugin != null && weatherPlugin != null fun isWeatherEnabled(): Boolean { execution.assertIsMainThread() val showWeather = secureSettings.getIntForUser( val isWeatherEnabled: Boolean get() { val showWeather = secureSettings.getIntForUser( LOCK_SCREEN_WEATHER_ENABLED, 1, userTracker.userId) == 1 userTracker.userId, ) == 1 return showWeather } Loading @@ -337,10 +331,10 @@ constructor( fun buildAndConnectDateView(parent: ViewGroup): View? { execution.assertIsMainThread() if (!isEnabled()) { if (!isEnabled) { throw RuntimeException("Cannot build view when not enabled") } if (!isDateWeatherDecoupled()) { if (!isDateWeatherDecoupled) { throw RuntimeException("Cannot build date view when not decoupled") } Loading @@ -361,10 +355,10 @@ constructor( fun buildAndConnectWeatherView(parent: ViewGroup): View? { execution.assertIsMainThread() if (!isEnabled()) { if (!isEnabled) { throw RuntimeException("Cannot build view when not enabled") } if (!isDateWeatherDecoupled()) { if (!isDateWeatherDecoupled) { throw RuntimeException("Cannot build weather view when not decoupled") } Loading @@ -385,7 +379,7 @@ constructor( fun buildAndConnectView(parent: ViewGroup): View? { execution.assertIsMainThread() if (!isEnabled()) { if (!isEnabled) { throw RuntimeException("Cannot build view when not enabled") } Loading Loading @@ -577,7 +571,7 @@ constructor( } private fun filterSmartspaceTarget(t: SmartspaceTarget): Boolean { if (isDateWeatherDecoupled() && t.featureType == SmartspaceTarget.FEATURE_WEATHER) { if (isDateWeatherDecoupled && t.featureType == SmartspaceTarget.FEATURE_WEATHER) { return false } if (!showNotifications) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaViewController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class KeyguardBottomAreaViewController } override fun onViewAttached() { if (!smartspaceRelocateToBottom() || !smartspaceController.isEnabled()) { if (!smartspaceRelocateToBottom() || !smartspaceController.isEnabled) { return } Loading