|
|
|
@ -42,7 +42,6 @@ import android.net.Network;
|
|
|
|
|
import android.net.NetworkCapabilities;
|
|
|
|
|
import android.net.NetworkInfo;
|
|
|
|
|
import android.os.BadParcelableException;
|
|
|
|
|
import android.os.BatteryManager;
|
|
|
|
|
import android.os.Build;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.os.DeadObjectException;
|
|
|
|
@ -1761,9 +1760,8 @@ public class Log {
|
|
|
|
|
sb.append(String.format("Battery optimizations: %s\r\n",
|
|
|
|
|
ignoring == null ? null : Boolean.toString(!ignoring)));
|
|
|
|
|
|
|
|
|
|
BatteryManager bm = (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE);
|
|
|
|
|
int batlevel = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
|
|
|
|
|
sb.append(String.format("Charging: %b; level: %d\r\n", Helper.isCharging(context), batlevel));
|
|
|
|
|
sb.append(String.format("Charging: %b; level: %d\r\n",
|
|
|
|
|
Helper.isCharging(context), Helper.getBatteryLevel(context)));
|
|
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
|
|
UsageStatsManager usm = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE);
|
|
|
|
|