From 3c6a0d12f527d07b1a1801885aef1966addac651 Mon Sep 17 00:00:00 2001 From: T2Fat2Fly <55565923+T2Fat2Fly@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:20:34 -0400 Subject: [PATCH] Fix rumble not working due to deprecated API call (#1454) --- .../binding/input/ControllerHandler.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/limelight/binding/input/ControllerHandler.java b/app/src/main/java/com/limelight/binding/input/ControllerHandler.java index f7c8c0d11..cac84f2c2 100644 --- a/app/src/main/java/com/limelight/binding/input/ControllerHandler.java +++ b/app/src/main/java/com/limelight/binding/input/ControllerHandler.java @@ -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();