|
|
|
@ -48,7 +48,6 @@ import android.os.DeadObjectException;
|
|
|
|
|
import android.os.DeadSystemException;
|
|
|
|
|
import android.os.Debug;
|
|
|
|
|
import android.os.OperationCanceledException;
|
|
|
|
|
import android.os.PowerManager;
|
|
|
|
|
import android.os.RemoteException;
|
|
|
|
|
import android.os.TransactionTooLargeException;
|
|
|
|
|
import android.text.TextUtils;
|
|
|
|
@ -1747,11 +1746,10 @@ public class Log {
|
|
|
|
|
sb.append(ex.toString()).append("\r\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PowerManager power = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
|
|
|
|
boolean ignoring = true;
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
|
|
|
|
ignoring = power.isIgnoringBatteryOptimizations(BuildConfig.APPLICATION_ID);
|
|
|
|
|
sb.append(String.format("Battery optimizations: %b\r\n", !ignoring));
|
|
|
|
|
Boolean ignoring = Helper.isIgnoringOptimizations(context);
|
|
|
|
|
sb.append(String.format("Battery optimizations: %s\r\n",
|
|
|
|
|
ignoring == null ? null : Boolean.toString(!ignoring)));
|
|
|
|
|
|
|
|
|
|
sb.append(String.format("Charging: %b\r\n", Helper.isCharging(context)));
|
|
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
|
@ -1868,11 +1866,14 @@ public class Log {
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
boolean enabled = prefs.getBoolean("enabled", true);
|
|
|
|
|
int pollInterval = ServiceSynchronize.getPollInterval(context);
|
|
|
|
|
Boolean ignoring = Helper.isIgnoringOptimizations(context);
|
|
|
|
|
boolean schedule = prefs.getBoolean("schedule", false);
|
|
|
|
|
|
|
|
|
|
size += write(os, "accounts=" + accounts.size() +
|
|
|
|
|
" enabled=" + enabled +
|
|
|
|
|
" interval=" + pollInterval + "\r\n\r\n");
|
|
|
|
|
" interval=" + pollInterval +
|
|
|
|
|
" optimizing=" + (ignoring == null ? null : !ignoring) +
|
|
|
|
|
"\r\n\r\n");
|
|
|
|
|
|
|
|
|
|
if (schedule) {
|
|
|
|
|
int minuteStart = prefs.getInt("schedule_start", 0);
|
|
|
|
@ -1920,6 +1921,7 @@ public class Log {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (EntityAccount account : accounts)
|
|
|
|
|
if (account.synchronize)
|
|
|
|
|
try {
|
|
|
|
|
JSONObject jaccount = account.toJSON();
|
|
|
|
|
jaccount.put("state", account.state == null ? "null" : account.state);
|
|
|
|
|