1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 01:06:04 +00:00

Improved debug info

This commit is contained in:
M66B 2020-10-27 15:35:28 +01:00
parent c51fd1c1ee
commit 962e637aee

View file

@ -33,6 +33,7 @@ import android.content.res.Configuration;
import android.database.sqlite.SQLiteFullException; import android.database.sqlite.SQLiteFullException;
import android.graphics.Point; import android.graphics.Point;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.Network; import android.net.Network;
import android.net.NetworkCapabilities; import android.net.NetworkCapabilities;
import android.net.NetworkInfo; import android.net.NetworkInfo;
@ -1502,14 +1503,17 @@ public class Log {
" type=" + ani.getType() + "/" + ani.getTypeName() + " type=" + ani.getType() + "/" + ani.getTypeName() +
"\r\n\r\n"); "\r\n\r\n");
Network active = null; Network active = ConnectionHelper.getActiveNetwork(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
active = cm.getActiveNetwork();
for (Network network : cm.getAllNetworks()) { for (Network network : cm.getAllNetworks()) {
size += write(os, (network.equals(active) ? "active=" : "network=") + network + "\r\n");
NetworkCapabilities caps = cm.getNetworkCapabilities(network); NetworkCapabilities caps = cm.getNetworkCapabilities(network);
size += write(os, (network.equals(active) ? "active=" : "network=") + network + size += write(os, " caps=" + caps + "\r\n");
" capabilities=" + caps + "\r\n\r\n");
LinkProperties props = cm.getLinkProperties(network);
size += write(os, " props=" + props + "\r\n");
size += write(os, "\r\n");
} }
size += write(os, "VPN active=" + ConnectionHelper.vpnActive(context) + "\r\n\r\n"); size += write(os, "VPN active=" + ConnectionHelper.vpnActive(context) + "\r\n\r\n");