Settings: Battery saver settings sub-page.

New battery saver settings page, accessed via
the power usage settings overflow menu.

The settings page has a master switch to toggle
battery saver mode, feature disclosure text,
and a preference to configure the automatic
trigger level.

Remove developer checkbox now that this option
has a real home.

NO_SQ: multi project change
Bug:13329308
Change-Id: Iac54238f3406439711b44a3c17f220ac5e370a37
This commit is contained in:
John Spurlock
2014-06-04 19:11:22 -04:00
parent 2eae7a4022
commit c7f8e8ce69
14 changed files with 301 additions and 33 deletions

View File

@@ -21,6 +21,7 @@ import static com.android.settings.notification.SettingPref.TYPE_SYSTEM;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.media.AudioManager;
import android.net.Uri;
@@ -114,10 +115,15 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
}
@Override
protected int getResId(Context context, int value) {
if (value == DOCK_AUDIO_MEDIA_DISABLED) return R.string.dock_audio_media_disabled;
if (value == DOCK_AUDIO_MEDIA_ENABLED) return R.string.dock_audio_media_enabled;
throw new IllegalArgumentException();
protected String getCaption(Resources res, int value) {
switch(value) {
case DOCK_AUDIO_MEDIA_DISABLED:
return res.getString(R.string.dock_audio_media_disabled);
case DOCK_AUDIO_MEDIA_ENABLED:
return res.getString(R.string.dock_audio_media_enabled);
default:
throw new IllegalArgumentException();
}
}
};
@@ -131,11 +137,17 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
}
@Override
protected int getResId(Context context, int value) {
if (value == EMERGENCY_TONE_SILENT) return R.string.emergency_tone_silent;
if (value == EMERGENCY_TONE_ALERT) return R.string.emergency_tone_alert;
if (value == EMERGENCY_TONE_VIBRATE) return R.string.emergency_tone_vibrate;
throw new IllegalArgumentException();
protected String getCaption(Resources res, int value) {
switch(value) {
case EMERGENCY_TONE_SILENT:
return res.getString(R.string.emergency_tone_silent);
case EMERGENCY_TONE_ALERT:
return res.getString(R.string.emergency_tone_alert);
case EMERGENCY_TONE_VIBRATE:
return res.getString(R.string.emergency_tone_vibrate);
default:
throw new IllegalArgumentException();
}
}
};