@Test public void testGetParameters_withSettingChangeBeforeStart_updatesValues() { mParameters.stop(); long testTimeout = BackupAgentTimeoutParameters.DEFAULT_KV_BACKUP_AGENT_TIMEOUT_MILLIS * 2; final String setting = BackupAgentTimeoutParameters.SETTING_KV_BACKUP_AGENT_TIMEOUT_MILLIS + "=" + testTimeout; putStringAndNotify(setting); mParameters.start(); long kvBackupAgentTimeoutMillis = mParameters.getKvBackupAgentTimeoutMillis(); assertEquals(testTimeout, kvBackupAgentTimeoutMillis); }
public long getKvBackupAgentTimeoutMillis() { synchronized (mLock) { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v(TAG, "getKvBackupAgentTimeoutMillis(): " + mKvBackupAgentTimeoutMillis); } return mKvBackupAgentTimeoutMillis; } }
BackupAgentTimeoutParameters extends KeyValueSettingObserver { public long getKvBackupAgentTimeoutMillis() { synchronized (mLock) { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v(TAG, "getKvBackupAgentTimeoutMillis(): " + mKvBackupAgentTimeoutMillis); } return mKvBackupAgentTimeoutMillis; } } }
BackupAgentTimeoutParameters extends KeyValueSettingObserver { public long getKvBackupAgentTimeoutMillis() { synchronized (mLock) { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v(TAG, "getKvBackupAgentTimeoutMillis(): " + mKvBackupAgentTimeoutMillis); } return mKvBackupAgentTimeoutMillis; } } BackupAgentTimeoutParameters(Handler handler, ContentResolver resolver); }
BackupAgentTimeoutParameters extends KeyValueSettingObserver { public long getKvBackupAgentTimeoutMillis() { synchronized (mLock) { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v(TAG, "getKvBackupAgentTimeoutMillis(): " + mKvBackupAgentTimeoutMillis); } return mKvBackupAgentTimeoutMillis; } } BackupAgentTimeoutParameters(Handler handler, ContentResolver resolver); String getSettingValue(ContentResolver resolver); void update(KeyValueListParser parser); long getKvBackupAgentTimeoutMillis(); long getFullBackupAgentTimeoutMillis(); long getSharedBackupAgentTimeoutMillis(); long getRestoreAgentTimeoutMillis(); long getRestoreAgentFinishedTimeoutMillis(); }
BackupAgentTimeoutParameters extends KeyValueSettingObserver { public long getKvBackupAgentTimeoutMillis() { synchronized (mLock) { if (BackupManagerService.DEBUG_SCHEDULING) { Slog.v(TAG, "getKvBackupAgentTimeoutMillis(): " + mKvBackupAgentTimeoutMillis); } return mKvBackupAgentTimeoutMillis; } } BackupAgentTimeoutParameters(Handler handler, ContentResolver resolver); String getSettingValue(ContentResolver resolver); void update(KeyValueListParser parser); long getKvBackupAgentTimeoutMillis(); long getFullBackupAgentTimeoutMillis(); long getSharedBackupAgentTimeoutMillis(); long getRestoreAgentTimeoutMillis(); long getRestoreAgentFinishedTimeoutMillis(); @VisibleForTesting
    static final String SETTING; @VisibleForTesting
    static final String SETTING_KV_BACKUP_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final String SETTING_FULL_BACKUP_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final String SETTING_SHARED_BACKUP_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final String SETTING_RESTORE_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final String SETTING_RESTORE_AGENT_FINISHED_TIMEOUT_MILLIS; @VisibleForTesting static final long DEFAULT_KV_BACKUP_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final long DEFAULT_FULL_BACKUP_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final long DEFAULT_SHARED_BACKUP_AGENT_TIMEOUT_MILLIS; @VisibleForTesting static final long DEFAULT_RESTORE_AGENT_TIMEOUT_MILLIS; @VisibleForTesting
    static final long DEFAULT_RESTORE_AGENT_FINISHED_TIMEOUT_MILLIS; }