1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-01-27 10:07:32 +01:00

Pebble: if untested features option is enabled use Gadgetbridge sample provider insted of Morpheuz

This commit is contained in:
Andreas Shimokawa 2015-08-11 11:21:10 +02:00
parent 5884684cad
commit 0be251e83d

View File

@ -2,22 +2,30 @@ package nodomain.freeyourgadget.gadgetbridge.devices.pebble;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.preference.PreferenceManager;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.activities.AppManagerActivity; import nodomain.freeyourgadget.gadgetbridge.activities.AppManagerActivity;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
public class PebbleCoordinator implements DeviceCoordinator { public class PebbleCoordinator implements DeviceCoordinator {
private MorpheuzSampleProvider sampleProvider; private MorpheuzSampleProvider sampleProvider;
public PebbleCoordinator() { public PebbleCoordinator() {
//sampleProvider = new MorpheuzSampleProvider(); // FIXME: make this configurable somewhere else
sampleProvider = new PebbleGadgetBridgeSampleProvider(); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
if (sharedPrefs.getBoolean("pebble_force_untested", false)) {
sampleProvider = new PebbleGadgetBridgeSampleProvider();
} else {
sampleProvider = new MorpheuzSampleProvider();
}
} }
@Override @Override