标题: 再次追踪RJ45插入流程 [打印本页] 作者: zangcf 时间: 2016-4-11 13:11 标题: 再次追踪RJ45插入流程 public void run() {
//noinspection InfiniteLoopStatement
for (;;) {
int index;
int i;
int cmd;
String dev;
if (localLOGV) Slog.v(TAG, "zcfdebug go poll events");
String eventName = EthernetNative.waitForEvent();
if (eventName == null) {
if (localLOGV) Slog.v(TAG, "zcfdebug no ethernet monitor events");
continue;
}
if (localLOGV) Slog.v(TAG, "zcfdebug get event " + eventName);
/*
* Map event name into event enum
*/
if (eventName.length()==0) {
EthUeventFail=true;
Slog.v(TAG, "the eventName length is " + eventName.length());
}
i = 0;
while (i < eventName.length()) {
index = eventName.substring(i).indexOf(":");
if (index == -1)
break;
dev = eventName.substring(i, index);
i += index + 1;
index = eventName.substring(i).indexOf(":");
if (index == -1)
break;
cmd = Integer.parseInt(eventName.substring(i, i+index));
i += index + 1;
if (localLOGV) Slog.v(TAG, "zcfdebug dev: " + dev + " ev " + cmd);
switch (cmd) {
case DEL_LINK:
handleEvent(dev, DISCONNECTED);
break;
case ADD_ADDR:
handleEvent(dev, CONNECTED);
break;
case NEW_LINK:
handleEvent(dev, PHYUP);
break;
}
}
if (info.getDetailedState() ==
NetworkInfo.DetailedState.FAILED) {
handleConnectionFailure(info);
} else if (info.getDetailedState() ==
DetailedState.CAPTIVE_PORTAL_CHECK) {
handleCaptivePortalTrackerCheck(info);
} else if (state == NetworkInfo.State.DISCONNECTED) {
handleDisconnect(info);
} else if (state == NetworkInfo.State.SUSPENDED) {
// TODO: need to think this over.
// the logic here is, handle SUSPENDED the same as
// DISCONNECTED. The only difference being we are
// broadcasting an intent with NetworkInfo that's
// suspended. This allows the applications an
// opportunity to handle DISCONNECTED and SUSPENDED
// differently, or not.
Slog.d(TAG, "Change to Suspend_State due to reason=" + info.getReason() + " with network=" + info.getSubtypeName()) ;
if (((info.getReason() != null) && info.getReason().equals(Phone.REASON_VOICE_CALL_STARTED))
&& (info.getSubtype() == TelephonyManager.NETWORK_TYPE_GPRS
|| info.getSubtype() == TelephonyManager.NETWORK_TYPE_EDGE
|| info.getSubtype() == TelephonyManager.NETWORK_TYPE_UNKNOWN)) {
Xlog.e(MTK_TAG, "Suspend PS TX/RX Temporarily without deactivating PDP context");
sendSuspendedBroadcast(info);
} else {
Xlog.e(MTK_TAG, "Switch to Suspend:invoke handleDisconnect()");
handleDisconnect(info);
}
} else if (state == NetworkInfo.State.CONNECTED) {
handleConnect(info);
}
if (mLockdownTracker != null) {
mLockdownTracker.onNetworkInfoChanged(info);
}
break;
=================这个msg和上面的有什么差别呢?
作者: zangcf 时间: 2016-4-11 22:18
E/zcfdebug EthernetStateTracker( 460): Ethernet connect in EthernetStateTracker!
D/zcfdebug EthernetStateTracker( 460): Send Message to EVENT_STATE_CHANGED
V/ActivityManager( 460): Broadcast sticky: Intent { act=android.net.conn.TETHER_STATE_CHANGED flg=0x28000010 (has extras) } ordered=false userid=-1 callerApp=ProcessRecord{4146d450 460:system/1000}
D/zcfdebug ConnectivityService( 460): handleConnectivityChange: changed linkProperty[9]: doReset=false resetMask=0
D/zcfdebug ConnectivityService( 460): curLp=null
D/zcfdebug ConnectivityService( 460): newLp=LinkAddresses: [] Routes: [] DnsAddresses: []
D/zcfdebug ConnectivityService( 460): net Type is ConnectivityManager.TYPE_ETHERNET 9 Setting mGlobalProxy
D/zcfdebug ConnectivityService( 460): zcfdebug handle EVENT_STATE_CHANGED message!
E/zcfdebug( 460): The NetworkInfo.State state is CONNECTED
D/zcfdebug ConnectivityService( 460): ConnectivityChange for ETH: CONNECTED/CONNECTED
D/zcfdebug ConnectivityService( 460): zcfdebug in handleConnect!
D/zcfdebug ConnectivityService( 460): zcfdebug newNetType value is 9
D/zcfdebug ConnectivityService( 460): zcfdebug in mNetConfigs[newNetType].isDefault()
D/zcfdebug ConnectivityService( 460): zcfdebug ConnectivityService newNetType value is 9 mActiveDefaultNetwork = newNetType
D/zcfdebug ConnectivityService( 460): zcfdebug ConnectivityService mActiveDefaultNetwork is 9
D/zcfdebug ConnectivityService( 460): Setting TCP values: [4096,87380,524288,4096,16384,524288] which comes from [net.tcp.buffersize.default]
D/zcfdebug Tethering( 460): sendTetherStateChangedBroadcast 1, 0, 0
D/zcfdebug ConnectivityService( 460): MTU is only applied to mobile/MMS
D/zcfdebug Tethering( 460): Skip the state:0
D/zcfdebug Tethering( 460): we will broadcast rj45 plug in!
V/ActivityManager( 460): Broadcast sticky: Intent { act=android.hardware.rj45.action.PLUG_IN flg=0x10 } ordered=false userid=-1 callerApp=ProcessRecord{4146d450 460:system/1000}
D/BroadcastQueue( 460): BDC-Delivered broadcast: Intent { act=android.hardware.rj45.action.PLUG_IN flg=0x10 cmp=com.mediatek.oobe/.RJ45PlugInReceiver }, ordered=true, app=ProcessRecord{4126f338 748:com.mediatek.oobe/1000}, receiver=android.os.BinderProxy@4133e6c0
D/zcfdebug ConnectivityService( 460): handleConnectivityChange: changed linkProperty[9]: doReset=false resetMask=0
D/zcfdebug ConnectivityService( 460): curLp=LinkAddresses: [] Routes: [] DnsAddresses: []
D/zcfdebug ConnectivityService( 460): newLp=LinkAddresses: [] Routes: [] DnsAddresses: []
D/zcfdebug ConnectivityService( 460): handleConnectivityChange: address are the same reset per doReset linkProperty[9]: resetMask=0
D/zcfdebug ConnectivityService( 460): net Type is ConnectivityManager.TYPE_ETHERNET 9 Setting mGlobalProxy
V/Provider/Settings( 460): from settings cache , name = connectivity_change_delay , value = null
D/zcfdebug ConnectivityService( 460): sendStickyBroadcast: action=android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE
V/ActivityManager( 460): Broadcast sticky: Intent { act=android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE flg=0x8000010 (has extras) } ordered=false userid=-1 callerApp=ProcessRecord{4146d450 460:system/1000}
D/zcfdebug ConnectivityService( 460): sendStickyBroadcastDelayed: delayMs=3000, action=android.net.conn.CONNECTIVITY_CHANGE
================
这个地方是有毛病的,好像执行了两次这个东西