docs: protected void upgradePreferences() {
          String alarmDueElapsed = "com.cloudant.sync.replication.PeriodicReplicationService.alarmDueElapsed";
          if (mPrefs.contains(alarmDueElapsed)) {
              // These are old style preferences. We need to rewrite them in the new form that allows
              // multiple replication policies.
              String alarmDueClock = "com.cloudant.sync.replication.PeriodicReplicationService.alarmDueClock";
              String replicationsActive = "com.cloudant.sync.replication.PeriodicReplicationService.periodicReplicationsActive";
              long elapsed = mPrefs.getLong(alarmDueElapsed, 0);
              long clock = mPrefs.getLong(alarmDueClock, 0);
              boolean enabled = mPrefs.getBoolean(replicationsActive, false);
  
              SharedPreferences.Editor editor = mPrefs.edit();
              editor.putLong(constructKey(LAST_ALARM_ELAPSED_TIME_SUFFIX),
                  elapsed - (getIntervalInSeconds() * MILLISECONDS_IN_SECOND));
              editor.putLong(constructKey(LAST_ALARM_CLOCK_TIME_SUFFIX),
                  clock - (getIntervalInSeconds() * MILLISECONDS_IN_SECOND));
              editor.putBoolean(constructKey(PERIODIC_REPLICATION_ENABLED_SUFFIX), enabled);
  
              editor.remove(alarmDueElapsed);
              editor.remove(alarmDueClock);
              editor.remove(replicationsActive);
  
              editor.apply();
          }
      }