Skip to content
Permalink
Browse files

Merge pull request #7724 from zackhow/rum

Android: Don't clear vibrators in onStop
  • Loading branch information...
Helios747 committed Feb 3, 2019
2 parents f65b3a9 + b9e402e commit dc15c969edb02e61d5e7ef0ac57825f5936db42b
@@ -324,7 +324,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 dc15c96

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