Merge "Hook up the automatic storage manager settings with the flag." into nyc-mr1-dev

am: 4c5e2bb526

* commit '4c5e2bb526d93e3e5a3958f44a4fe2d012a6ffe7':
  Hook up the automatic storage manager settings with the flag.

Change-Id: Ia3be5191adf3eee5fcf407ced923c94435e9da73
This commit is contained in:
Daniel Nishi
2016-05-25 20:04:05 +00:00
committed by android-build-merger

View File

@@ -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