resolved conflicts for merge of 20979077 to master
Change-Id: Ica492307505d53e57863d4363b5f75abd798bcd8
This commit is contained in:
@@ -58,6 +58,7 @@ import java.net.InetAddress;
|
|||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
@@ -129,6 +130,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
|
|
||||||
private InetAddress mDefaultDns;
|
private InetAddress mDefaultDns;
|
||||||
|
|
||||||
|
// used in DBG mode to track inet condition reports
|
||||||
|
private static final int INET_CONDITION_LOG_MAX_SIZE = 15;
|
||||||
|
private ArrayList mInetLog;
|
||||||
|
|
||||||
private static class NetworkAttributes {
|
private static class NetworkAttributes {
|
||||||
/**
|
/**
|
||||||
* Class for holding settings read from resources.
|
* Class for holding settings read from resources.
|
||||||
@@ -339,6 +344,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
mTethering.getTetherableBluetoothRegexs().length != 0) &&
|
mTethering.getTetherableBluetoothRegexs().length != 0) &&
|
||||||
mTethering.getUpstreamIfaceRegexs().length != 0);
|
mTethering.getUpstreamIfaceRegexs().length != 0);
|
||||||
|
|
||||||
|
if (DBG) {
|
||||||
|
mInetLog = new ArrayList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1598,6 +1606,14 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
pw.println();
|
pw.println();
|
||||||
|
|
||||||
mTethering.dump(fd, pw, args);
|
mTethering.dump(fd, pw, args);
|
||||||
|
|
||||||
|
if (mInetLog != null) {
|
||||||
|
pw.println();
|
||||||
|
pw.println("Inet condition reports:");
|
||||||
|
for(int i = 0; i < mInetLog.size(); i++) {
|
||||||
|
pw.println(mInetLog.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// must be stateless - things change under us.
|
// must be stateless - things change under us.
|
||||||
@@ -1874,6 +1890,17 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
android.Manifest.permission.STATUS_BAR,
|
android.Manifest.permission.STATUS_BAR,
|
||||||
"ConnectivityService");
|
"ConnectivityService");
|
||||||
|
|
||||||
|
if (DBG) {
|
||||||
|
int pid = getCallingPid();
|
||||||
|
int uid = getCallingUid();
|
||||||
|
String s = pid + "(" + uid + ") reports inet is " +
|
||||||
|
(percentage > 50 ? "connected" : "disconnected") + " (" + percentage + ") on " +
|
||||||
|
"network Type " + networkType + " at " + GregorianCalendar.getInstance().getTime();
|
||||||
|
mInetLog.add(s);
|
||||||
|
while(mInetLog.size() > INET_CONDITION_LOG_MAX_SIZE) {
|
||||||
|
mInetLog.remove(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(
|
mHandler.sendMessage(mHandler.obtainMessage(
|
||||||
NetworkStateTracker.EVENT_INET_CONDITION_CHANGE, networkType, percentage));
|
NetworkStateTracker.EVENT_INET_CONDITION_CHANGE, networkType, percentage));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user