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

Commit 16bec505 authored by Behnam Heydarshahi's avatar Behnam Heydarshahi
Browse files

MediaHierarchyManager listens for settings in bg

It used to do so on the main thread.

Bug: 384098863
Flag: EXEMPT bugfix
Test: atest MediaHierarchyManagerTest
Change-Id: Iad7375302047716d26dc517e53898a3f26d218df
parent 7177560e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -34,13 +34,14 @@ import android.view.ViewGroup
import android.view.ViewGroupOverlay
import androidx.annotation.VisibleForTesting
import com.android.app.animation.Interpolators
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.app.tracing.traceSection
import com.android.keyguard.KeyguardViewController
import com.android.systemui.Flags.mediaControlsLockscreenShadeBugFix
import com.android.systemui.communal.ui.viewmodel.CommunalTransitionViewModel
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dreams.DreamOverlayStateController
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
@@ -68,7 +69,6 @@ import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.mapLatest
import com.android.app.tracing.coroutines.launchTraced as launch

private val TAG: String = MediaHierarchyManager::class.java.simpleName

@@ -115,7 +115,7 @@ constructor(
    wakefulnessLifecycle: WakefulnessLifecycle,
    shadeInteractor: ShadeInteractor,
    private val secureSettings: SecureSettings,
    @Main private val handler: Handler,
    @Background private val handler: Handler,
    @Application private val coroutineScope: CoroutineScope,
    private val splitShadeStateController: SplitShadeStateController,
    private val logger: MediaViewLogger,
@@ -631,7 +631,7 @@ constructor(
                    }
                }
            }
        secureSettings.registerContentObserverForUserSync(
        secureSettings.registerContentObserverForUserAsync(
            Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN,
            settingsObserver,
            UserHandle.USER_ALL,