am ebefd240: am f0b615de: am b322fdf5: am 08cb3983: Merge "Update battery optimization strings" into mnc-dev

* commit 'ebefd240b6dd90a5ccc3da8f74cdc42e8c808ba7':
  Update battery optimization strings
This commit is contained in:
Jason Monk
2015-07-27 18:47:32 +00:00
committed by Android Git Automerger
3 changed files with 19 additions and 14 deletions

View File

@@ -24,10 +24,10 @@
<include <include
layout="@layout/radio_with_summary" layout="@layout/radio_with_summary"
android:id="@+id/ignore_on" /> android:id="@+id/ignore_off" />
<include <include
layout="@layout/radio_with_summary" layout="@layout/radio_with_summary"
android:id="@+id/ignore_off" /> android:id="@+id/ignore_on" />
</LinearLayout> </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> <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]--> <!-- 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] --> <!-- 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] --> <!-- 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] --> <!-- 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] --> <!-- 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] --> <!-- Description of number of apps with high power turned on [CHAR LIMIT=NONE] -->
<plurals name="high_power_count"> <plurals name="high_power_count">
<item quantity="one">1 app 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 optimizations</item> <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> apps allowed to ignore battery optimization</item>
</plurals> </plurals>
<!-- Summary of power usage for an app [CHAR LIMIT=NONE] --> <!-- 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> <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] --> <!-- 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] --> <!-- 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] --> <!-- Ignore battery optimizations on description [CHAR LIMIT=NONE] -->
<string name="ignore_optimizations_on_desc">May drain your battery more quickly</string> <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 @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder b = new AlertDialog.Builder(getContext()) AlertDialog.Builder b = new AlertDialog.Builder(getContext())
.setTitle(getString(R.string.ignore_optimizations_title, mLabel)) .setTitle(mLabel)
.setNegativeButton(R.string.cancel, null) .setNegativeButton(R.string.cancel, null)
.setView(R.layout.ignore_optimizations_content); .setView(R.layout.ignore_optimizations_content);
if (!mBackend.isSysWhitelisted(mPackageName)) { if (!mBackend.isSysWhitelisted(mPackageName)) {
@@ -141,8 +141,10 @@ public class HighPowerDetail extends DialogFragment implements OnClickListener,
} }
public static CharSequence getSummary(Context context, String pkg) { public static CharSequence getSummary(Context context, String pkg) {
return context.getString(PowerWhitelistBackend.getInstance().isWhitelisted(pkg) PowerWhitelistBackend powerWhitelist = PowerWhitelistBackend.getInstance();
? R.string.high_power_on : R.string.high_power_off); 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, public static void show(Fragment caller, String packageName, int requestCode,