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

Commit ac58356c authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Change to MSDLModule to use the new MSDLPlayer creator function.

The MSDLPlayer now receives the Vibrator directly.

Test: presubmit
Flag: NONE usage of this API is flagged elsewhere.
Bug: 344654090
Change-Id: Ifccc2ececd9288ba3a7cfc1a75d681f1275d743a
parent f48aabce
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)
    }
}