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

Commit 0c5917ee authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez Committed by Android (Google) Code Review
Browse files

Merge "Using Vibrator provided by Dagger in the MSDLModule" into main

parents 8bebd165 cf40bf90
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ class MSDLCoreStartable @Inject constructor(private val msdlPlayer: MSDLPlayer)
    override fun start() {}

    override fun dump(pw: PrintWriter, args: Array<out String>) {
        pw.println("MSDLPlayer history of the last ${MSDLHistoryLogger.HISTORY_SIZE} events:")
        pw.println(msdlPlayer)
        pw.println("MSDL player history of the last ${MSDLHistoryLogger.HISTORY_SIZE} events:")
        msdlPlayer.getHistory().forEach { event -> pw.println("$event") }
    }
}
+2 −8
Original line number Diff line number Diff line
@@ -17,10 +17,8 @@
package com.android.systemui.haptics.msdl.dagger

import android.annotation.SuppressLint
import android.content.Context
import android.os.VibratorManager
import android.os.Vibrator
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.google.android.msdl.domain.MSDLPlayer
import dagger.Module
import dagger.Provides
@@ -30,9 +28,5 @@ object MSDLModule {
    @SuppressLint("NonInjectedService")
    @Provides
    @SysUISingleton
    fun provideMSDLPlayer(@Application context: Context): MSDLPlayer {
        val vibratorManager =
            context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager
        return MSDLPlayer.createPlayer(vibratorManager.defaultVibrator)
    }
    fun provideMSDLPlayer(vibrator: Vibrator?): MSDLPlayer = MSDLPlayer.createPlayer(vibrator)
}