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

        if (preferenceDataStore.getBoolean(PUSH_ENABLED_SETTINGS_MIGRATED_KEY, false)) {
            return;
        }

        Logger.debug("Migrating push enabled preferences");

        // get old push enabled value, defaulting to false as before
        boolean oldPushEnabled = this.preferenceDataStore.getBoolean(PUSH_ENABLED_KEY, false);

        // copy old push enabled value to user notifications enabled slot
        Logger.debug("Setting user notifications enabled to " + Boolean.toString(oldPushEnabled));
        preferenceDataStore.put(USER_NOTIFICATIONS_ENABLED_KEY, oldPushEnabled);

        if (!oldPushEnabled) {
            Logger.info("Push is now enabled. You can continue to toggle the opt-in state by " +
                    "enabling or disabling user notifications");
        }

        // set push enabled to true
        preferenceDataStore.put(PUSH_ENABLED_KEY, true);
        preferenceDataStore.put(PUSH_ENABLED_SETTINGS_MIGRATED_KEY, true);
    }
/**
     * Migrates the old push enabled setting to the new user notifications enabled
     * setting, and enables push by default. This was introduced in version 5.0.0.
     */
Migrates the old push enabled setting to the new user notifications enabled
setting, and enables push by default. This was introduced in version 5.0.0.
Migrates the old push enabled setting to the new user notifications enabled setting and enables push by default . This was introduced in version 5 . 0 . 0 .
void migratePushEnabledSettings() {
        if (preferenceDataStore.getBoolean(PUSH_ENABLED_SETTINGS_MIGRATED_KEY, false)) {
            return;
        }
        Logger.debug("Migrating push enabled preferences");
        boolean oldPushEnabled = this.preferenceDataStore.getBoolean(PUSH_ENABLED_KEY, false);
        Logger.debug("Setting user notifications enabled to " + Boolean.toString(oldPushEnabled));
        preferenceDataStore.put(USER_NOTIFICATIONS_ENABLED_KEY, oldPushEnabled);
        if (!oldPushEnabled) {
            Logger.info("Push is now enabled. You can continue to toggle the opt-in state by " +
                    "enabling or disabling user notifications");
        }
        preferenceDataStore.put(PUSH_ENABLED_KEY, true);
        preferenceDataStore.put(PUSH_ENABLED_SETTINGS_MIGRATED_KEY, true);
    }
void migratePushEnabledSettings ( ) { if ( preferenceDataStore . getBoolean ( PUSH_ENABLED_SETTINGS_MIGRATED_KEY , false ) ) { return ; } Logger . debug ( "Migrating push enabled preferences" ) ; boolean oldPushEnabled = this . preferenceDataStore . getBoolean ( PUSH_ENABLED_KEY , false ) ; Logger . debug ( "Setting user notifications enabled to " + Boolean . toString ( oldPushEnabled ) ) ; preferenceDataStore . put ( USER_NOTIFICATIONS_ENABLED_KEY , oldPushEnabled ) ; if ( ! oldPushEnabled ) { Logger . info ( "Push is now enabled. You can continue to toggle the opt-in state by " + "enabling or disabling user notifications" ) ; } preferenceDataStore . put ( PUSH_ENABLED_KEY , true ) ; preferenceDataStore . put ( PUSH_ENABLED_SETTINGS_MIGRATED_KEY , true ) ; }
Migrates the old push enabled setting to the new user notifications enabled
 setting, and enables push by default.
Migrates the old push enabled setting to the new user notifications enabled setting and enables push by default .
// get old push enabled value, defaulting to false as before // copy old push enabled value to user notifications enabled slot // set push enabled to true