Search in sources :

Example 1 with GBPrefs

use of nodomain.freeyourgadget.gadgetbridge.util.GBPrefs in project Gadgetbridge by Freeyourgadget.

the class GBApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    if (lockHandler != null) {
        // guard against multiple invocations (robolectric)
        return;
    }
    sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
    prefs = new Prefs(sharedPrefs);
    gbPrefs = new GBPrefs(prefs);
    // don't do anything here before we set up logging, otherwise
    // slf4j may be implicitly initialized before we properly configured it.
    setupLogging(isFileLoggingEnabled());
    if (getPrefsFileVersion() != CURRENT_PREFS_VERSION) {
        migratePrefs(getPrefsFileVersion());
    }
    setupExceptionHandler();
    GB.environment = GBEnvironment.createDeviceEnvironment();
    setupDatabase(this);
    deviceManager = new DeviceManager(this);
    deviceService = createDeviceService();
    loadBlackList();
    if (isRunningMarshmallowOrLater()) {
        notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    }
}
Also used : GBPrefs(nodomain.freeyourgadget.gadgetbridge.util.GBPrefs) DeviceManager(nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager) GBPrefs(nodomain.freeyourgadget.gadgetbridge.util.GBPrefs) Prefs(nodomain.freeyourgadget.gadgetbridge.util.Prefs)

Aggregations

DeviceManager (nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager)1 GBPrefs (nodomain.freeyourgadget.gadgetbridge.util.GBPrefs)1 Prefs (nodomain.freeyourgadget.gadgetbridge.util.Prefs)1