Merge "Hook up the automatic storage manager settings with the flag." into nyc-mr1-dev am: 4c5e2bb526
am: 606f1fc7cc
* commit '606f1fc7cca3b61a9bdc04b6aecf56c00b74c01c':
Hook up the automatic storage manager settings with the flag.
Change-Id: I244abd674cbc632607357f7c2b319752e2db6b00
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.deletionhelper;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Switch;
|
||||
@@ -64,6 +65,10 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
|
||||
mDeletionHelper.setOnPreferenceClickListener(this);
|
||||
|
||||
mStorageManagerSwitch = (SwitchPreference) findPreference(KEY_STORAGE_MANAGER_SWITCH);
|
||||
boolean isChecked =
|
||||
Settings.Secure.getInt(getContentResolver(),
|
||||
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED, 0) != 0;
|
||||
mStorageManagerSwitch.setChecked(isChecked);
|
||||
mStorageManagerSwitch.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@@ -79,6 +84,8 @@ public class AutomaticStorageManagerSettings extends SettingsPreferenceFragment
|
||||
case KEY_STORAGE_MANAGER_SWITCH:
|
||||
boolean checked = (boolean) newValue;
|
||||
mDaysToRetain.setEnabled(checked);
|
||||
Settings.Secure.putInt(getContentResolver(),
|
||||
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED, checked ? 1 : 0);
|
||||
break;
|
||||
case KEY_DAYS:
|
||||
// TODO: Configure a setting which controls how many days of data the storage manager
|
||||
|
Reference in New Issue
Block a user