urbanairship-core/src/main/java/com/urbanairship/push/PushManager.java
void migrateQuietTimeSettings() {

        /*
         * We changed the quiet time enabled key without migrating it when we released 7.1.0. Migrate
         * the old quiet time key to the new key only if the new key is not yet set.
         */
        if (preferenceDataStore.getString(QUIET_TIME_ENABLED, null) == null) {
            preferenceDataStore.put(QUIET_TIME_ENABLED, preferenceDataStore.getBoolean(OLD_QUIET_TIME_ENABLED, false));
            preferenceDataStore.remove(OLD_QUIET_TIME_ENABLED);
        }

        // Attempt to extract an old quiet time interval
        int startHr = preferenceDataStore.getInt(QuietTime.START_HOUR_KEY, QuietTime.NOT_SET_VAL);
        int startMin = preferenceDataStore.getInt(QuietTime.START_MIN_KEY, QuietTime.NOT_SET_VAL);
        int endHr = preferenceDataStore.getInt(QuietTime.END_HOUR_KEY, QuietTime.NOT_SET_VAL);
        int endMin = preferenceDataStore.getInt(QuietTime.END_MIN_KEY, QuietTime.NOT_SET_VAL);

        if (startHr == QuietTime.NOT_SET_VAL || startMin == QuietTime.NOT_SET_VAL ||
                endHr == QuietTime.NOT_SET_VAL || endMin == QuietTime.NOT_SET_VAL) {
            return;
        }

        Logger.debug("Migrating quiet time interval");

        QuietTimeInterval quietTimeInterval = new QuietTimeInterval.Builder()
                .setStartHour(startHr)
                .setStartMin(startMin)
                .setEndHour(endHr)
                .setEndMin(endMin)
                .build();

        preferenceDataStore.put(QUIET_TIME_INTERVAL, quietTimeInterval.toJsonValue());
        preferenceDataStore.remove(QuietTime.START_HOUR_KEY);
        preferenceDataStore.remove(QuietTime.START_MIN_KEY);
        preferenceDataStore.remove(QuietTime.END_HOUR_KEY);
        preferenceDataStore.remove(QuietTime.END_MIN_KEY);
    }
/**
     * Migrates the quiet time settings.
     */
Migrates the quiet time settings.
Migrates the quiet time settings .
void migrateQuietTimeSettings() {
        /*
         * We changed the quiet time enabled key without migrating it when we released 7.1.0. Migrate
         * the old quiet time key to the new key only if the new key is not yet set.
         */
        if (preferenceDataStore.getString(QUIET_TIME_ENABLED, null) == null) {
            preferenceDataStore.put(QUIET_TIME_ENABLED, preferenceDataStore.getBoolean(OLD_QUIET_TIME_ENABLED, false));
            preferenceDataStore.remove(OLD_QUIET_TIME_ENABLED);
        }
        int startHr = preferenceDataStore.getInt(QuietTime.START_HOUR_KEY, QuietTime.NOT_SET_VAL);
        int startMin = preferenceDataStore.getInt(QuietTime.START_MIN_KEY, QuietTime.NOT_SET_VAL);
        int endHr = preferenceDataStore.getInt(QuietTime.END_HOUR_KEY, QuietTime.NOT_SET_VAL);
        int endMin = preferenceDataStore.getInt(QuietTime.END_MIN_KEY, QuietTime.NOT_SET_VAL);
        if (startHr == QuietTime.NOT_SET_VAL || startMin == QuietTime.NOT_SET_VAL ||
                endHr == QuietTime.NOT_SET_VAL || endMin == QuietTime.NOT_SET_VAL) {
            return;
        }
        Logger.debug("Migrating quiet time interval");
        QuietTimeInterval quietTimeInterval = new QuietTimeInterval.Builder()
                .setStartHour(startHr)
                .setStartMin(startMin)
                .setEndHour(endHr)
                .setEndMin(endMin)
                .build();
        preferenceDataStore.put(QUIET_TIME_INTERVAL, quietTimeInterval.toJsonValue());
        preferenceDataStore.remove(QuietTime.START_HOUR_KEY);
        preferenceDataStore.remove(QuietTime.START_MIN_KEY);
        preferenceDataStore.remove(QuietTime.END_HOUR_KEY);
        preferenceDataStore.remove(QuietTime.END_MIN_KEY);
    }
void migrateQuietTimeSettings ( ) { /*
         * We changed the quiet time enabled key without migrating it when we released 7.1.0. Migrate
         * the old quiet time key to the new key only if the new key is not yet set.
         */ if ( preferenceDataStore . getString ( QUIET_TIME_ENABLED , null ) == null ) { preferenceDataStore . put ( QUIET_TIME_ENABLED , preferenceDataStore . getBoolean ( OLD_QUIET_TIME_ENABLED , false ) ) ; preferenceDataStore . remove ( OLD_QUIET_TIME_ENABLED ) ; } int startHr = preferenceDataStore . getInt ( QuietTime . START_HOUR_KEY , QuietTime . NOT_SET_VAL ) ; int startMin = preferenceDataStore . getInt ( QuietTime . START_MIN_KEY , QuietTime . NOT_SET_VAL ) ; int endHr = preferenceDataStore . getInt ( QuietTime . END_HOUR_KEY , QuietTime . NOT_SET_VAL ) ; int endMin = preferenceDataStore . getInt ( QuietTime . END_MIN_KEY , QuietTime . NOT_SET_VAL ) ; if ( startHr == QuietTime . NOT_SET_VAL || startMin == QuietTime . NOT_SET_VAL || endHr == QuietTime . NOT_SET_VAL || endMin == QuietTime . NOT_SET_VAL ) { return ; } Logger . debug ( "Migrating quiet time interval" ) ; QuietTimeInterval quietTimeInterval = new QuietTimeInterval . Builder ( ) . setStartHour ( startHr ) . setStartMin ( startMin ) . setEndHour ( endHr ) . setEndMin ( endMin ) . build ( ) ; preferenceDataStore . put ( QUIET_TIME_INTERVAL , quietTimeInterval . toJsonValue ( ) ) ; preferenceDataStore . remove ( QuietTime . START_HOUR_KEY ) ; preferenceDataStore . remove ( QuietTime . START_MIN_KEY ) ; preferenceDataStore . remove ( QuietTime . END_HOUR_KEY ) ; preferenceDataStore . remove ( QuietTime . END_MIN_KEY ) ; }
Migrates the quiet time settings.
Migrates the quiet time settings .
// Attempt to extract an old quiet time interval