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

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

Merge "Change to MSDLModule to use the new MSDLPlayer creator function." into main

parents 203cdd3f ac58356c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@

package com.android.systemui.haptics.msdl.dagger

import android.annotation.SuppressLint
import android.content.Context
import android.os.VibratorManager
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.google.android.msdl.domain.MSDLPlayer
@@ -25,8 +27,12 @@ import dagger.Provides

@Module
object MSDLModule {
    @SuppressLint("NonInjectedService")
    @Provides
    @SysUISingleton
    fun provideMSDLPlayer(@Application context: Context): MSDLPlayer =
        MSDLPlayer.createPlayer(context)
    fun provideMSDLPlayer(@Application context: Context): MSDLPlayer {
        val vibratorManager =
            context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager
        return MSDLPlayer.createPlayer(vibratorManager.defaultVibrator)
    }
}