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

Commit 3506c4c9 authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Automerger Merge Worker
Browse files

Merge "Subsequent blind fix for runBlocking Interrupted Exceptions" into udc-dev am: f175ad01

parents 19f12b00 f175ad01
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.IntentFilter
import android.graphics.Rect
import android.graphics.Rect
import android.hardware.display.DisplayManager
import android.hardware.display.DisplayManager
import android.os.Bundle
import android.os.Bundle
import android.os.Handler
import android.os.IBinder
import android.os.IBinder
import android.view.LayoutInflater
import android.view.LayoutInflater
import android.view.SurfaceControlViewHost
import android.view.SurfaceControlViewHost
@@ -58,6 +59,7 @@ class KeyguardPreviewRenderer
constructor(
constructor(
    @Application private val context: Context,
    @Application private val context: Context,
    @Main private val mainDispatcher: CoroutineDispatcher,
    @Main private val mainDispatcher: CoroutineDispatcher,
    @Main private val mainHandler: Handler,
    private val bottomAreaViewModel: KeyguardBottomAreaViewModel,
    private val bottomAreaViewModel: KeyguardBottomAreaViewModel,
    displayManager: DisplayManager,
    displayManager: DisplayManager,
    private val windowManager: WindowManager,
    private val windowManager: WindowManager,
@@ -113,7 +115,7 @@ constructor(
    }
    }


    fun render() {
    fun render() {
        runBlocking(mainDispatcher) {
        mainHandler.post {
            val rootView = FrameLayout(context)
            val rootView = FrameLayout(context)


            setUpBottomArea(rootView)
            setUpBottomArea(rootView)
@@ -169,14 +171,12 @@ constructor(
     * @param hide TRUE hides smartspace, FALSE shows smartspace
     * @param hide TRUE hides smartspace, FALSE shows smartspace
     */
     */
    fun hideSmartspace(hide: Boolean) {
    fun hideSmartspace(hide: Boolean) {
        runBlocking(mainDispatcher) {
        mainHandler.post { smartSpaceView?.visibility = if (hide) View.INVISIBLE else View.VISIBLE }
            smartSpaceView?.visibility = if (hide) View.INVISIBLE else View.VISIBLE
        }
    }
    }


    /** Sets the clock's color to the overridden seed color. */
    /** Sets the clock's color to the overridden seed color. */
    fun onColorOverridden(@ColorInt color: Int?) {
    fun onColorOverridden(@ColorInt color: Int?) {
        runBlocking(mainDispatcher) {
        mainHandler.post {
            colorOverride = color
            colorOverride = color
            clockController.clock?.run { events.onSeedColorChanged(color) }
            clockController.clock?.run { events.onSeedColorChanged(color) }
        }
        }