com.eveningoutpost.dexdrip.UtilityModels.IdempotentMigrations Java Examples

The following examples show how to use com.eveningoutpost.dexdrip.UtilityModels.IdempotentMigrations. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: xdrip.java    From xDrip-Experimental with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    Context context = getApplicationContext();
    CollectionServiceStarter collectionServiceStarter = new CollectionServiceStarter(context);
    collectionServiceStarter.start(getApplicationContext());
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, false);
    context.startService(new Intent(context, MissedReadingService.class));	
    new IdempotentMigrations(getApplicationContext()).performAll();
    AlertType.fromSettings(getApplicationContext());
}
 
Example #2
Source File: xdrip.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onCreate() {
    xdrip.context = getApplicationContext();
    super.onCreate();
    try {
        if (PreferenceManager.getDefaultSharedPreferences(xdrip.context).getBoolean("enable_crashlytics", true)) {
            initCrashlytics(this);
            initBF();
        }
    } catch (Exception e) {
        Log.e(TAG, e.toString());
    }
    executor = new PlusAsyncExecutor();
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_advanced_settings, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_defaults, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_prefs, true);

    checkForcedEnglish(xdrip.context);

    JoH.ratelimit("policy-never", 3600); // don't on first load
    new IdempotentMigrations(getApplicationContext()).performAll();


    JobManager.create(this).addJobCreator(new XDripJobCreator());
    DailyJob.schedule();
    //SyncService.startSyncServiceSoon();

    if (!isRunningTest()) {
        MissedReadingService.delayedLaunch();
        NFCReaderX.handleHomeScreenScanPreference(getApplicationContext());
        AlertType.fromSettings(getApplicationContext());
        //new CollectionServiceStarter(getApplicationContext()).start(getApplicationContext());
        CollectionServiceStarter.restartCollectionServiceBackground();
        PlusSyncService.startSyncService(context, "xdrip.java");
        if (Pref.getBoolean("motion_tracking_enabled", false)) {
            ActivityRecognizedService.startActivityRecogniser(getApplicationContext());
        }
        BluetoothGlucoseMeter.startIfEnabled();
        LeFunEntry.initialStartIfEnabled();
        MiBandEntry.initialStartIfEnabled();
        BlueJayEntry.initialStartIfEnabled();
        XdripWebService.immortality();
        VersionTracker.updateDevice();

    } else {
        Log.d(TAG, "Detected running test mode, holding back on background processes");
    }
    Reminder.firstInit(xdrip.getAppContext());
    PluggableCalibration.invalidateCache();
}
 
Example #3
Source File: xdrip.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onCreate() {
    xdrip.context = getApplicationContext();
    super.onCreate();
    try {
        if (PreferenceManager.getDefaultSharedPreferences(xdrip.context).getBoolean("enable_crashlytics", true)) {
            initCrashlytics(this);
            initBF();
        }
    } catch (Exception e) {
        Log.e(TAG, e.toString());
    }
    executor = new PlusAsyncExecutor();
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_advanced_settings, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_defaults, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_prefs, true);

    checkForcedEnglish(xdrip.context);

    JoH.ratelimit("policy-never", 3600); // don't on first load
    new IdempotentMigrations(getApplicationContext()).performAll();


    JobManager.create(this).addJobCreator(new XDripJobCreator());
    DailyJob.schedule();
    //SyncService.startSyncServiceSoon();

    if (!isRunningTest()) {
        MissedReadingService.delayedLaunch();
        NFCReaderX.handleHomeScreenScanPreference(getApplicationContext());
        AlertType.fromSettings(getApplicationContext());
        //new CollectionServiceStarter(getApplicationContext()).start(getApplicationContext());
        CollectionServiceStarter.restartCollectionServiceBackground();
        PlusSyncService.startSyncService(context, "xdrip.java");
        if (Pref.getBoolean("motion_tracking_enabled", false)) {
            ActivityRecognizedService.startActivityRecogniser(getApplicationContext());
        }
        BluetoothGlucoseMeter.startIfEnabled();
        LeFunEntry.initialStartIfEnabled();
        MiBandEntry.initialStartIfEnabled();
        BlueJayEntry.initialStartIfEnabled();
        XdripWebService.immortality();
        VersionTracker.updateDevice();

    } else {
        Log.d(TAG, "Detected running test mode, holding back on background processes");
    }
    Reminder.firstInit(xdrip.getAppContext());
    PluggableCalibration.invalidateCache();
}