1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-26 01:38:07 +00:00

Add battery optimization to debug info

This commit is contained in:
M66B 2016-03-11 12:03:29 +01:00
parent ef133b8bbc
commit bf2a12ca3b

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())); 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) if (sb.length() > 2)
sb.setLength(sb.length() - 2); sb.setLength(sb.length() - 2);