### Question:
BackupAgentTimeoutParameters extends KeyValueSettingObserver { public long getKvBackupAgentTimeoutMillis() { synchronized (mLock) { if (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(); long getQuotaExceededTimeoutMillis(); @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 String SETTING_QUOTA_EXCEEDED_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; @VisibleForTesting
    static final long DEFAULT_QUOTA_EXCEEDED_TIMEOUT_MILLIS; }### Answer:
@Test public void testGetParameters_withSettingChangeBeforeStart_updatesValues() { 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); }
@Test public void testGetParameters_withSettingChangeAfterStart_updatesValues() { mParameters.start(); long testTimeout = BackupAgentTimeoutParameters.DEFAULT_KV_BACKUP_AGENT_TIMEOUT_MILLIS * 2; final String setting = BackupAgentTimeoutParameters.SETTING_KV_BACKUP_AGENT_TIMEOUT_MILLIS + "=" + testTimeout; putStringAndNotify(setting); long kvBackupAgentTimeoutMillis = mParameters.getKvBackupAgentTimeoutMillis(); assertEquals(testTimeout, kvBackupAgentTimeoutMillis); }