Fix for pebble sample provider switching without quitting gb)

This commit is contained in:
cpfeiffer 2015-08-16 23:30:16 +02:00
parent 27a9eb8a07
commit 964994972b
1 changed files with 7 additions and 10 deletions

View File

@ -16,16 +16,7 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class PebbleCoordinator implements DeviceCoordinator {
private MorpheuzSampleProvider sampleProvider;
public PebbleCoordinator() {
// FIXME: make this configurable somewhere else
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
if (sharedPrefs.getBoolean("pebble_force_untested", false)) {
sampleProvider = new PebbleGadgetBridgeSampleProvider();
} else {
sampleProvider = new MorpheuzSampleProvider();
}
}
@Override
@ -54,7 +45,13 @@ public class PebbleCoordinator implements DeviceCoordinator {
@Override
public SampleProvider getSampleProvider() {
return sampleProvider;
// FIXME: make this configurable somewhere else.
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
if (sharedPrefs.getBoolean("pebble_force_untested", false)) {
return new PebbleGadgetBridgeSampleProvider();
} else {
return new MorpheuzSampleProvider();
}
}
@Override