Android: Allow device vibration with external controller

This commit is contained in:
Connor McLaughlin committed 2021-03-06 16:00:38 +10:00
1 parent a6e497cf62
commit 491e3a36df
2 files changed
+6 -5

No files matched your search

@@ -682,19 +682,20 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
if (mTouchscreenController != null) {
activityLayout.removeView(mTouchscreenController);
mTouchscreenController = null;
mVibratorService = null;
}
} else {
if (mTouchscreenController == null) {
mTouchscreenController = new TouchscreenControllerView(this);
if (vibration)
mVibratorService = (Vibrator) getSystemService(VIBRATOR_SERVICE);
activityLayout.addView(mTouchscreenController);
}
mTouchscreenController.init(0, controllerType, viewType, hapticFeedback);
}
if (vibration)
mVibratorService = (Vibrator) getSystemService(VIBRATOR_SERVICE);
else
mVibratorService = null;
}
private InputManager.InputDeviceListener mInputDeviceListener;