Fix for pebble sample provider switching without quitting gb)
This commit is contained in:
parent
27a9eb8a07
commit
964994972b
|
@ -16,16 +16,7 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||||
|
|
||||||
public class PebbleCoordinator implements DeviceCoordinator {
|
public class PebbleCoordinator implements DeviceCoordinator {
|
||||||
private MorpheuzSampleProvider sampleProvider;
|
|
||||||
|
|
||||||
public PebbleCoordinator() {
|
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
|
@Override
|
||||||
|
@ -54,7 +45,13 @@ public class PebbleCoordinator implements DeviceCoordinator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SampleProvider getSampleProvider() {
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue