From 964994972b3748af05d72fef477f60307176b239 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Sun, 16 Aug 2015 23:30:16 +0200 Subject: [PATCH] Fix for pebble sample provider switching without quitting gb) --- .../devices/pebble/PebbleCoordinator.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java index dfc069a66..d8e12ce66 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java @@ -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