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:
parent
ef133b8bbc
commit
bf2a12ca3b
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue