mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-02 13:14:39 +00:00
Added active network info to debug info
This commit is contained in:
parent
ab8fd37d82
commit
fbc1bcd9b3
1 changed files with 5 additions and 0 deletions
|
@ -29,6 +29,7 @@ import android.graphics.Point;
|
|||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.DeadObjectException;
|
||||
|
@ -682,6 +683,10 @@ public class Log {
|
|||
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) {
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
NetworkInfo ani = cm.getActiveNetworkInfo();
|
||||
if (ani != null)
|
||||
size += write(os, ani.toString() + " metered=" + cm.isActiveNetworkMetered() + "\r\n\r\n");
|
||||
|
||||
Network active = null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||
active = cm.getActiveNetwork();
|
||||
|
|
Loading…
Reference in a new issue