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

Commit 49e2192f authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Adding a CoreStartable object to dump the history of MSDL playback.

The object's purpose is to dump the MSDL library history of the most
recent events.

Test: presubmit.
Test: manual. Ran adb shell dumpsys activity com.anroid.systemui and
  verified the presence of MSDL events
Flag: NONE The usage of the MSDL player is flagged elsewhere.
Bug: 344654090

Change-Id: I52b2e270424c8e063dcdf9bbf38280140bcc1c73
parent 20792fe6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import com.android.systemui.dreams.AssistantAttentionMonitor
import com.android.systemui.dreams.DreamMonitor
import com.android.systemui.dreams.homecontrols.HomeControlsDreamStartable
import com.android.systemui.globalactions.GlobalActionsComponent
import com.android.systemui.inputdevice.tutorial.KeyboardTouchpadTutorialCoreStartable
import com.android.systemui.haptics.msdl.MSDLCoreStartable
import com.android.systemui.keyboard.KeyboardUI
import com.android.systemui.keyboard.PhysicalKeyboardCoreStartable
import com.android.systemui.keyguard.KeyguardViewConfigurator
@@ -323,4 +323,9 @@ abstract class SystemUICoreStartableModule {
    @IntoMap
    @ClassKey(BatteryControllerStartable::class)
    abstract fun bindsBatteryControllerStartable(impl: BatteryControllerStartable): CoreStartable

    @Binds
    @IntoMap
    @ClassKey(MSDLCoreStartable::class)
    abstract fun bindMSDLCoreStartable(impl: MSDLCoreStartable): CoreStartable
}
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.haptics.msdl

import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.google.android.msdl.domain.MSDLPlayer
import com.google.android.msdl.logging.MSDLHistoryLogger
import java.io.PrintWriter
import javax.inject.Inject

@SysUISingleton
class MSDLCoreStartable @Inject constructor(private val msdlPlayer: MSDLPlayer) : CoreStartable {
    override fun start() {}

    override fun dump(pw: PrintWriter, args: Array<out String>) {
        pw.println("MSDLPlayer history of the last ${MSDLHistoryLogger.HISTORY_SIZE} events:")
        msdlPlayer.getHistory().forEach { event -> pw.println("$event") }
    }
}