1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-31 20:25:38 +00:00

Added power saving to debug info

This commit is contained in:
M66B 2022-01-17 18:43:13 +01:00
parent 75fcc16c8b
commit 1a40bf5109

View file

@ -51,6 +51,7 @@ import android.os.DeadSystemException;
import android.os.Debug;
import android.os.IBinder;
import android.os.OperationCanceledException;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.TransactionTooLargeException;
import android.provider.Settings;
@ -1921,6 +1922,10 @@ public class Log {
ignoring == null ? null : Boolean.toString(!ignoring),
Boolean.FALSE.equals(ignoring) ? "!!!" : ""));
PowerManager power = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
boolean psaving = power.isPowerSaveMode();
sb.append(String.format("Battery saving: %s %s\r\n", psaving, psaving ? "!!!" : ""));
sb.append(String.format("Charging: %b; level: %d\r\n",
Helper.isCharging(context), Helper.getBatteryLevel(context)));