Add battery optimization to debug info

This commit is contained in:
M66B 2016-03-11 12:03:29 +01:00
parent ef133b8bbc
commit bf2a12ca3b
1 changed files with 5 additions and 0 deletions

View File

@ -595,6 +595,11 @@ public class Util {
sb.append(String.format("Network %s/%s/%s\r\n", tm.getNetworkCountryIso(), tm.getNetworkOperatorName(), tm.getNetworkOperator()));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
sb.append(String.format("Battery optimizing %B\r\n", !pm.isIgnoringBatteryOptimizations(context.getPackageName())));
}
if (sb.length() > 2)
sb.setLength(sb.length() - 2);