Skip to content
Permalink
Browse files

Android: Don't clear vibrators in onStop

Fixes issue where vibration would stop if you swapped between apps mid emulation.
  • Loading branch information...
zackhow committed Jan 21, 2019
1 parent 3627ef8 commit b9e402e8b0030a1b221188b70f2a995097e03470
@@ -309,7 +309,6 @@ protected void restoreState(Bundle savedInstanceState)
protected void onStop()
{
super.onStop();
Rumble.clear();
}

@Override
@@ -18,18 +18,19 @@
public class Rumble
{
private static Vibrator phoneVibrator;
private static SparseArray<Vibrator> emuVibrators;
private static final SparseArray<Vibrator> emuVibrators = new SparseArray<>();

public static void initRumble(EmulationActivity activity)
{
clear();

if (activity.deviceHasTouchScreen() &&
PreferenceManager.getDefaultSharedPreferences(activity)
.getBoolean("phoneRumble", true))
{
setPhoneVibrator(true, activity);
}

emuVibrators = new SparseArray<>();
for (int i = 0; i < 8; i++)
{
StringSetting deviceName =
@@ -65,7 +66,7 @@ public static void setPhoneVibrator(boolean set, EmulationActivity activity)
}
}

public static void clear()
private static void clear()
{
phoneVibrator = null;
emuVibrators.clear();

0 comments on commit b9e402e

Please sign in to comment.
You can’t perform that action at this time.