Android: Allow device vibration with external controller

This commit is contained in:
Connor McLaughlin
2021-03-06 15:49:15 +10:00
parent a6e497cf62
commit 491e3a36df
2 changed files with 6 additions and 5 deletions

View File

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