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);
}
}
Aggregations