Android: Convert DolphinVibratorManagerPassthrough to Kotlin

This commit is contained in:
Charles Lombardo 2023-06-10 05:14:38 -04:00
parent 29adbb4394
commit 4c8cd49d80
2 changed files with 16 additions and 33 deletions

View File

@ -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();
}
}

View File

@ -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
}