Merge "Update battery optimization strings" into mnc-dev

This commit is contained in:
Jason Monk
2015-07-27 17:39:54 +00:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 14 deletions

View File

@@ -24,10 +24,10 @@
<include
layout="@layout/radio_with_summary"
android:id="@+id/ignore_on" />
android:id="@+id/ignore_off" />
<include
layout="@layout/radio_with_summary"
android:id="@+id/ignore_off" />
android:id="@+id/ignore_on" />
</LinearLayout>

View File

@@ -6709,24 +6709,27 @@
<string name="process_format"><xliff:g id="app_name" example="Settings">%1$s</xliff:g> (<xliff:g id="count" example="3">%2$d</xliff:g>)</string>
<!-- Label for list to control apps that ignore battery saving restrictions [CHAR LIMIT=25]-->
<string name="high_power_apps">Ignore optimizations</string>
<string name="high_power_apps">Battery optimization</string>
<!-- Filter for apps allowed to use a lot of power [CHAR LIMIT=25] -->
<string name="high_power_filter_on">Allowed</string>
<string name="high_power_filter_on">Not optimized</string>
<!-- Summary of app allowed to use a lot of power [CHAR LIMIT=60] -->
<string name="high_power_on">Ignoring battery optimizations</string>
<string name="high_power_on">Ignoring battery optimization</string>
<!-- Summary of app not allowed to use a lot of power [CHAR LIMIT=60] -->
<string name="high_power_off">Not allowed</string>
<string name="high_power_off">Optimizing battery use</string>
<!-- Summary of app which doesn't have a battery optimization setting [CHAR LIMIT=60] -->
<string name="high_power_system">Battery optimization not available</string>
<!-- Description of high power switch [CHAR LIMIT=NONE] -->
<string name="high_power_desc">Don\u2019t apply battery optimizations. May drain your battery more quickly.</string>
<string name="high_power_desc">Don\u2019t apply battery optimization. May drain your battery more quickly.</string>
<!-- Description of number of apps with high power turned on [CHAR LIMIT=NONE] -->
<plurals name="high_power_count">
<item quantity="one">1 app allowed to ignore battery optimizations</item>
<item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> apps allowed to ignore battery optimizations</item>
<item quantity="one">1 app allowed to ignore battery optimization</item>
<item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> apps allowed to ignore battery optimization</item>
</plurals>
<!-- Summary of power usage for an app [CHAR LIMIT=NONE] -->
@@ -6855,10 +6858,10 @@
<string name="zen_access_warning_dialog_summary">The app will be able to turn on/off Do Not Disturb and make changes to related settings.</string>
<!-- Ignore battery optimizations on label [CHAR LIMIT=30] -->
<string name="ignore_optimizations_on">Allow</string>
<string name="ignore_optimizations_on">Don\u2019t optimize</string>
<!-- Ignore battery optimizations off label [CHAR LIMIT=30] -->
<string name="ignore_optimizations_off">Don\u2019t allow</string>
<string name="ignore_optimizations_off">Optimize</string>
<!-- Ignore battery optimizations on description [CHAR LIMIT=NONE] -->
<string name="ignore_optimizations_on_desc">May drain your battery more quickly</string>

View File

@@ -79,7 +79,7 @@ public class HighPowerDetail extends DialogFragment implements OnClickListener,
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder b = new AlertDialog.Builder(getContext())
.setTitle(getString(R.string.ignore_optimizations_title, mLabel))
.setTitle(mLabel)
.setNegativeButton(R.string.cancel, null)
.setView(R.layout.ignore_optimizations_content);
if (!mBackend.isSysWhitelisted(mPackageName)) {
@@ -141,8 +141,10 @@ public class HighPowerDetail extends DialogFragment implements OnClickListener,
}
public static CharSequence getSummary(Context context, String pkg) {
return context.getString(PowerWhitelistBackend.getInstance().isWhitelisted(pkg)
? R.string.high_power_on : R.string.high_power_off);
PowerWhitelistBackend powerWhitelist = PowerWhitelistBackend.getInstance();
return context.getString(powerWhitelist.isSysWhitelisted(pkg) ? R.string.high_power_system
: powerWhitelist.isWhitelisted(pkg) ? R.string.high_power_on
: R.string.high_power_off);
}
public static void show(Fragment caller, String packageName, int requestCode,