mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-11 19:14:00 +00:00
Fix rumble not working due to deprecated API call (#1454)
This commit is contained in:
@@ -133,7 +133,16 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
this.conn = conn;
|
||||
this.gestures = gestures;
|
||||
this.prefConfig = prefConfig;
|
||||
this.deviceVibrator = (Vibrator) activityContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
this.deviceVibratorManager = (VibratorManager) activityContext.getSystemService(Context.VIBRATOR_MANAGER_SERVICE);
|
||||
this.deviceVibrator = (Vibrator) this.deviceVibratorManager.getDefaultVibrator();
|
||||
}
|
||||
else {
|
||||
this.deviceVibratorManager = null;
|
||||
this.deviceVibrator = (Vibrator) activityContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
}
|
||||
|
||||
this.deviceSensorManager = (SensorManager) activityContext.getSystemService(Context.SENSOR_SERVICE);
|
||||
this.inputManager = (InputManager) activityContext.getSystemService(Context.INPUT_SERVICE);
|
||||
this.mainThreadHandler = new Handler(Looper.getMainLooper());
|
||||
@@ -144,13 +153,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
this.backgroundHandlerThread.start();
|
||||
this.backgroundThreadHandler = new Handler(backgroundHandlerThread.getLooper());
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
this.deviceVibratorManager = (VibratorManager) activityContext.getSystemService(Context.VIBRATOR_MANAGER_SERVICE);
|
||||
}
|
||||
else {
|
||||
this.deviceVibratorManager = null;
|
||||
}
|
||||
|
||||
this.sceManager = new SceManager(activityContext);
|
||||
this.sceManager.start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user