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

Commit 5610e6c2 authored by Evan Laird's avatar Evan Laird
Browse files

Add some dumpsys information to SystemStatusAnimationScheduler

Test: adb shell dumpsys activity service
com.android.systemui/.SystemUIService SystemStatusAnimationScheduler
Bug: 187973222

Change-Id: Iaaefbeb267415d33263b56ab13c77baff267219e
parent a5b59595
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -26,14 +26,18 @@ import android.os.Process
import android.provider.DeviceConfig
import android.util.Log
import android.view.View
import com.android.systemui.Dumpable

import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.statusbar.phone.StatusBarWindowController
import com.android.systemui.statusbar.policy.CallbackController
import com.android.systemui.util.Assert
import com.android.systemui.util.concurrency.DelayableExecutor
import com.android.systemui.util.time.SystemClock
import java.io.FileDescriptor
import java.io.PrintWriter

import javax.inject.Inject

@@ -59,9 +63,10 @@ class SystemStatusAnimationScheduler @Inject constructor(
    private val coordinator: SystemEventCoordinator,
    private val chipAnimationController: SystemEventChipAnimationController,
    private val statusBarWindowController: StatusBarWindowController,
    private val dumpManager: DumpManager,
    private val systemClock: SystemClock,
    @Main private val executor: DelayableExecutor
) : CallbackController<SystemStatusAnimationCallback> {
) : CallbackController<SystemStatusAnimationCallback>, Dumpable {

    companion object {
        private const val PROPERTY_ENABLE_IMMERSIVE_INDICATOR = "enable_immersive_indicator"
@@ -71,10 +76,6 @@ class SystemStatusAnimationScheduler @Inject constructor(
                PROPERTY_ENABLE_IMMERSIVE_INDICATOR, true)
    }

    /** True from the time a scheduled event starts until it's animation finishes */
    var isActive = false
        private set

    @SystemAnimationState var animationState: Int = IDLE
        private set

@@ -88,6 +89,7 @@ class SystemStatusAnimationScheduler @Inject constructor(

    init {
        coordinator.attachScheduler(this)
        dumpManager.registerDumpable(TAG, this)
    }

    fun onStatusEvent(event: StatusEvent) {
@@ -293,6 +295,20 @@ class SystemStatusAnimationScheduler @Inject constructor(
        anim -> chipAnimationController.onChipAnimationUpdate(anim, animationState)
    }

    override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) {
        pw.println("Scheduled event: $scheduledEvent")
        pw.println("Has persistent privacy dot: $hasPersistentDot")
        pw.println("Animation state: $animationState")
        pw.println("Listeners:")
        if (listeners.isEmpty()) {
            pw.println("(none)")
        } else {
            listeners.forEach {
                pw.println("  $it")
            }
        }
    }

    inner class ChipAnimatorAdapter(
        @SystemAnimationState val endState: Int,
        val viewCreator: (context: Context) -> View