diff options
| author | 2024-09-27 23:29:56 +0000 | |
|---|---|---|
| committer | 2024-09-27 23:29:56 +0000 | |
| commit | cd19a409784e4ee61ba4d633cbd549b09025b379 (patch) | |
| tree | 8c6755967cc1aa3b6c0d0775116b4315fd580be4 | |
| parent | ddb2a418bd7ebd3c1c7df84cf028abbdb39b7e70 (diff) | |
| parent | 49e2192fddbd4d5aea18d66cb7e0e9482d4a0d06 (diff) | |
Merge "Adding a CoreStartable object to dump the history of MSDL playback." into main
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt | 7 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/haptics/msdl/MSDLCoreStartable.kt | 34 |
2 files changed, 40 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt b/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt index cbea87676d3a..8da4d460b7a5 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt @@ -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 } diff --git a/packages/SystemUI/src/com/android/systemui/haptics/msdl/MSDLCoreStartable.kt b/packages/SystemUI/src/com/android/systemui/haptics/msdl/MSDLCoreStartable.kt new file mode 100644 index 000000000000..58736c608af3 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/haptics/msdl/MSDLCoreStartable.kt @@ -0,0 +1,34 @@ +/* + * 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") } + } +} |