mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-24 15:21:19 +00:00
Add power saving to debug info
This commit is contained in:
parent
b765dcfdb8
commit
0a0f216861
1 changed files with 4 additions and 3 deletions
|
@ -610,10 +610,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);
|
||||
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
sb.append(String.format("Power saving %B\r\n", pm.isPowerSaveMode()));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||
sb.append(String.format("Battery optimizing %B\r\n", !pm.isIgnoringBatteryOptimizations(context.getPackageName())));
|
||||
}
|
||||
|
||||
if (sb.length() > 2)
|
||||
sb.setLength(sb.length() - 2);
|
||||
|
|
Loading…
Reference in a new issue