Improve debug info

This commit is contained in:
Ricki Hirner 2017-07-21 14:08:50 +02:00
parent 4be6a25eb6
commit b638c2584b
3 changed files with 31 additions and 1 deletions

View File

@ -20,6 +20,9 @@ import android.content.Context;
import android.content.Intent;
import android.content.Loader;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.ProxyInfo;
import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
@ -222,6 +225,30 @@ public class DebugInfoActivity extends AppCompatActivity implements LoaderManage
App.log.log(Level.SEVERE, "Couldn't get software information", ex);
}
report.append("CONNECTIVITY (at the moment)\n");
ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
report.append("Active connection: ");
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
if (networkInfo != null) {
String type;
switch (networkInfo.getType()) {
case ConnectivityManager.TYPE_WIFI: type = "WiFI"; break;
case ConnectivityManager.TYPE_MOBILE: type = "mobile"; break;
default: type = "type: " + String.valueOf(networkInfo.getType());
}
report .append(type).append(", ")
.append(networkInfo.getDetailedState().toString());
} else
report.append("none");
report.append("\n");
if (Build.VERSION.SDK_INT >= 23) {
ProxyInfo proxy = cm.getDefaultProxy();
report .append("System default proxy: ")
.append(proxy == null ? "none" : proxy.getHost()+":"+proxy.getPort())
.append("\n");
}
report.append("\n");
report.append("CONFIGURATION\n");
// power saving
PowerManager powerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE);

@ -1 +1 @@
Subproject commit f140ee2ebc6cd075a16e0f704673e288a47b2a0d
Subproject commit 4b136453631ae7d0fe8666d2aa5d7196969ef249

3
scripts/adb-log.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
adb shell setprop log.tag.davdroid VERBOSE
adb shell setprop log.tag.dav4android VERBOSE