@Test public void testGetConstant_whenSettingIsMalformed_doesNotUpdateParamsOrThrow() { long testFuzz = BackupManagerConstants.DEFAULT_KEY_VALUE_BACKUP_FUZZ_MILLISECONDS * 2; final String invalidSettingFormat = BackupManagerConstants.KEY_VALUE_BACKUP_FUZZ_MILLISECONDS + "=," + testFuzz; putStringAndNotify(invalidSettingFormat); long keyValueBackupFuzzMilliseconds = mConstants.getKeyValueBackupFuzzMilliseconds(); assertThat(keyValueBackupFuzzMilliseconds) .isEqualTo(BackupManagerConstants.DEFAULT_KEY_VALUE_BACKUP_FUZZ_MILLISECONDS); }
public synchronized long getKeyValueBackupFuzzMilliseconds() { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v( TAG, "getKeyValueBackupFuzzMilliseconds(...) returns " + mKeyValueBackupFuzzMilliseconds); } return mKeyValueBackupFuzzMilliseconds; }
BackupManagerConstants extends KeyValueSettingObserver { public synchronized long getKeyValueBackupFuzzMilliseconds() { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v( TAG, "getKeyValueBackupFuzzMilliseconds(...) returns " + mKeyValueBackupFuzzMilliseconds); } return mKeyValueBackupFuzzMilliseconds; } }
BackupManagerConstants extends KeyValueSettingObserver { public synchronized long getKeyValueBackupFuzzMilliseconds() { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v( TAG, "getKeyValueBackupFuzzMilliseconds(...) returns " + mKeyValueBackupFuzzMilliseconds); } return mKeyValueBackupFuzzMilliseconds; } BackupManagerConstants(Handler handler, ContentResolver resolver); }
BackupManagerConstants extends KeyValueSettingObserver { public synchronized long getKeyValueBackupFuzzMilliseconds() { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v( TAG, "getKeyValueBackupFuzzMilliseconds(...) returns " + mKeyValueBackupFuzzMilliseconds); } return mKeyValueBackupFuzzMilliseconds; } BackupManagerConstants(Handler handler, ContentResolver resolver); String getSettingValue(ContentResolver resolver); synchronized void update(KeyValueListParser parser); synchronized long getKeyValueBackupIntervalMilliseconds(); synchronized long getKeyValueBackupFuzzMilliseconds(); synchronized boolean getKeyValueBackupRequireCharging(); synchronized int getKeyValueBackupRequiredNetworkType(); synchronized long getFullBackupIntervalMilliseconds(); synchronized boolean getFullBackupRequireCharging(); synchronized int getFullBackupRequiredNetworkType(); synchronized String[] getBackupFinishedNotificationReceivers(); }
BackupManagerConstants extends KeyValueSettingObserver { public synchronized long getKeyValueBackupFuzzMilliseconds() { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v( TAG, "getKeyValueBackupFuzzMilliseconds(...) returns " + mKeyValueBackupFuzzMilliseconds); } return mKeyValueBackupFuzzMilliseconds; } BackupManagerConstants(Handler handler, ContentResolver resolver); String getSettingValue(ContentResolver resolver); synchronized void update(KeyValueListParser parser); synchronized long getKeyValueBackupIntervalMilliseconds(); synchronized long getKeyValueBackupFuzzMilliseconds(); synchronized boolean getKeyValueBackupRequireCharging(); synchronized int getKeyValueBackupRequiredNetworkType(); synchronized long getFullBackupIntervalMilliseconds(); synchronized boolean getFullBackupRequireCharging(); synchronized int getFullBackupRequiredNetworkType(); synchronized String[] getBackupFinishedNotificationReceivers(); @VisibleForTesting
    static final String KEY_VALUE_BACKUP_INTERVAL_MILLISECONDS; @VisibleForTesting
    static final String KEY_VALUE_BACKUP_FUZZ_MILLISECONDS; @VisibleForTesting
    static final String KEY_VALUE_BACKUP_REQUIRE_CHARGING; @VisibleForTesting
    static final String KEY_VALUE_BACKUP_REQUIRED_NETWORK_TYPE; @VisibleForTesting
    static final String FULL_BACKUP_INTERVAL_MILLISECONDS; @VisibleForTesting
    static final String FULL_BACKUP_REQUIRE_CHARGING; @VisibleForTesting
    static final String FULL_BACKUP_REQUIRED_NETWORK_TYPE; @VisibleForTesting
    static final String BACKUP_FINISHED_NOTIFICATION_RECEIVERS; @VisibleForTesting
    static final long DEFAULT_KEY_VALUE_BACKUP_INTERVAL_MILLISECONDS; @VisibleForTesting
    static final long DEFAULT_KEY_VALUE_BACKUP_FUZZ_MILLISECONDS; @VisibleForTesting static final boolean DEFAULT_KEY_VALUE_BACKUP_REQUIRE_CHARGING; @VisibleForTesting static final int DEFAULT_KEY_VALUE_BACKUP_REQUIRED_NETWORK_TYPE; @VisibleForTesting
    static final long DEFAULT_FULL_BACKUP_INTERVAL_MILLISECONDS; @VisibleForTesting static final boolean DEFAULT_FULL_BACKUP_REQUIRE_CHARGING; @VisibleForTesting static final int DEFAULT_FULL_BACKUP_REQUIRED_NETWORK_TYPE; @VisibleForTesting
    static final String DEFAULT_BACKUP_FINISHED_NOTIFICATION_RECEIVERS; }