mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Android: Convert DolphinVibratorManagerPassthrough to Kotlin
This commit is contained in:
parent
29adbb4394
commit
4c8cd49d80
@ -1,33 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.dolphinemu.dolphinemu.features.input.model;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Vibrator;
|
||||
import android.os.VibratorManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.S)
|
||||
public final class DolphinVibratorManagerPassthrough implements DolphinVibratorManager
|
||||
{
|
||||
private final VibratorManager mVibratorManager;
|
||||
|
||||
public DolphinVibratorManagerPassthrough(@NonNull VibratorManager vibratorManager)
|
||||
{
|
||||
mVibratorManager = vibratorManager;
|
||||
}
|
||||
|
||||
@Override @NonNull
|
||||
public Vibrator getVibrator(int vibratorId)
|
||||
{
|
||||
return mVibratorManager.getVibrator(vibratorId);
|
||||
}
|
||||
|
||||
@Override @NonNull
|
||||
public int[] getVibratorIds()
|
||||
{
|
||||
return mVibratorManager.getVibratorIds();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.dolphinemu.dolphinemu.features.input.model
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Vibrator
|
||||
import android.os.VibratorManager
|
||||
import androidx.annotation.RequiresApi
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.S)
|
||||
class DolphinVibratorManagerPassthrough(private val vibratorManager: VibratorManager) :
|
||||
DolphinVibratorManager {
|
||||
override fun getVibrator(vibratorId: Int): Vibrator = vibratorManager.getVibrator(vibratorId)
|
||||
|
||||
override fun getVibratorIds(): IntArray = vibratorManager.vibratorIds
|
||||
}
|
Loading…
Reference in New Issue
Block a user