Merge pull request #7724 from zackhow/rum

Android: Don't clear vibrators in onStop
This commit is contained in:
Anthony 2019-02-03 12:45:02 -08:00 committed by GitHub
commit dc15c969ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -324,7 +324,6 @@ public final class EmulationActivity extends AppCompatActivity
protected void onStop()
{
super.onStop();
Rumble.clear();
}
@Override

View File

@ -18,10 +18,12 @@ import java.util.HashMap;
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))
@ -29,7 +31,6 @@ public class Rumble
setPhoneVibrator(true, activity);
}
emuVibrators = new SparseArray<>();
for (int i = 0; i < 8; i++)
{
StringSetting deviceName =
@ -65,7 +66,7 @@ public class Rumble
}
}
public static void clear()
private static void clear()
{
phoneVibrator = null;
emuVibrators.clear();