Loading core/java/android/net/INetworkManagementEventObserver.aidl +3 −12 Original line number Diff line number Diff line Loading @@ -23,21 +23,12 @@ package android.net; */ interface INetworkManagementEventObserver { /** * Interface configuration status has changed. * Interface link status has changed. * * @param iface The interface. * @param up True if the interface has been enabled. * @param link True if link is up. */ void interfaceStatusChanged(String iface, boolean up); /** * Interface physical-layer link status has changed. For Ethernet, * this method is invoked when the cable is plugged in or unplugged. * * @param iface The interface. * @param up True if the physical link-layer connection signal is valid. */ void interfaceLinkStateChanged(String iface, boolean up); void interfaceLinkStatusChanged(String iface, boolean link); /** * An interface has been added to the system Loading services/java/com/android/server/NetworkManagementService.java +4 −22 Original line number Diff line number Diff line Loading @@ -131,26 +131,12 @@ class NetworkManagementService extends INetworkManagementService.Stub { } /** * Notify our observers of an interface status change * Notify our observers of an interface link status change */ private void notifyInterfaceStatusChanged(String iface, boolean up) { private void notifyInterfaceLinkStatusChanged(String iface, boolean link) { for (INetworkManagementEventObserver obs : mObservers) { try { obs.interfaceStatusChanged(iface, up); } catch (Exception ex) { Slog.w(TAG, "Observer notifier failed", ex); } } } /** * Notify our observers of an interface link status change. * (typically, an Ethernet cable has been plugged-in or unplugged). */ private void notifyInterfaceLinkStateChanged(String iface, boolean up) { for (INetworkManagementEventObserver obs : mObservers) { try { obs.interfaceLinkStateChanged(iface, up); obs.interfaceLinkStatusChanged(iface, link); } catch (Exception ex) { Slog.w(TAG, "Observer notifier failed", ex); } Loading Loading @@ -211,7 +197,6 @@ class NetworkManagementService extends INetworkManagementService.Stub { * Format: "NNN Iface added <name>" * "NNN Iface removed <name>" * "NNN Iface changed <name> <up/down>" * "NNN Iface linkstatus <name> <up/down>" */ if (cooked.length < 4 || !cooked[1].equals("Iface")) { throw new IllegalStateException( Loading @@ -224,10 +209,7 @@ class NetworkManagementService extends INetworkManagementService.Stub { notifyInterfaceRemoved(cooked[3]); return true; } else if (cooked[2].equals("changed") && cooked.length == 5) { notifyInterfaceStatusChanged(cooked[3], cooked[4].equals("up")); return true; } else if (cooked[2].equals("linkstatus") && cooked.length == 5) { notifyInterfaceLinkStateChanged(cooked[3], cooked[4].equals("up")); notifyInterfaceLinkStatusChanged(cooked[3], cooked[4].equals("up")); return true; } throw new IllegalStateException( Loading services/java/com/android/server/ThrottleService.java +1 −3 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public class ThrottleService extends IThrottleManager.Stub { mIface = iface; } public void interfaceStatusChanged(String iface, boolean link) { public void interfaceLinkStatusChanged(String iface, boolean link) { if (link) { if (TextUtils.equals(iface, mIface)) { mHandler.obtainMessage(mMsg).sendToTarget(); Loading @@ -176,8 +176,6 @@ public class ThrottleService extends IThrottleManager.Stub { } } public void interfaceLinkStateChanged(String iface, boolean linkState) {} public void interfaceRemoved(String iface) {} } Loading services/java/com/android/server/connectivity/Tethering.java +3 −6 Original line number Diff line number Diff line Loading @@ -202,11 +202,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub { mDnsServers[1] = DNS_DEFAULT_SERVER2; } public void interfaceLinkStateChanged(String iface, boolean up) { } public void interfaceStatusChanged(String iface, boolean up) { if (DEBUG) Log.d(TAG, "interfaceStatusChanged " + iface + ", " + up); public void interfaceLinkStatusChanged(String iface, boolean link) { if (DEBUG) Log.d(TAG, "interfaceLinkStatusChanged " + iface + ", " + link); boolean found = false; boolean usb = false; if (isWifi(iface)) { Loading @@ -221,7 +218,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub { synchronized (mIfaces) { TetherInterfaceSM sm = mIfaces.get(iface); if (up) { if (link) { if (sm == null) { sm = new TetherInterfaceSM(iface, mLooper, usb); mIfaces.put(iface, sm); Loading Loading
core/java/android/net/INetworkManagementEventObserver.aidl +3 −12 Original line number Diff line number Diff line Loading @@ -23,21 +23,12 @@ package android.net; */ interface INetworkManagementEventObserver { /** * Interface configuration status has changed. * Interface link status has changed. * * @param iface The interface. * @param up True if the interface has been enabled. * @param link True if link is up. */ void interfaceStatusChanged(String iface, boolean up); /** * Interface physical-layer link status has changed. For Ethernet, * this method is invoked when the cable is plugged in or unplugged. * * @param iface The interface. * @param up True if the physical link-layer connection signal is valid. */ void interfaceLinkStateChanged(String iface, boolean up); void interfaceLinkStatusChanged(String iface, boolean link); /** * An interface has been added to the system Loading
services/java/com/android/server/NetworkManagementService.java +4 −22 Original line number Diff line number Diff line Loading @@ -131,26 +131,12 @@ class NetworkManagementService extends INetworkManagementService.Stub { } /** * Notify our observers of an interface status change * Notify our observers of an interface link status change */ private void notifyInterfaceStatusChanged(String iface, boolean up) { private void notifyInterfaceLinkStatusChanged(String iface, boolean link) { for (INetworkManagementEventObserver obs : mObservers) { try { obs.interfaceStatusChanged(iface, up); } catch (Exception ex) { Slog.w(TAG, "Observer notifier failed", ex); } } } /** * Notify our observers of an interface link status change. * (typically, an Ethernet cable has been plugged-in or unplugged). */ private void notifyInterfaceLinkStateChanged(String iface, boolean up) { for (INetworkManagementEventObserver obs : mObservers) { try { obs.interfaceLinkStateChanged(iface, up); obs.interfaceLinkStatusChanged(iface, link); } catch (Exception ex) { Slog.w(TAG, "Observer notifier failed", ex); } Loading Loading @@ -211,7 +197,6 @@ class NetworkManagementService extends INetworkManagementService.Stub { * Format: "NNN Iface added <name>" * "NNN Iface removed <name>" * "NNN Iface changed <name> <up/down>" * "NNN Iface linkstatus <name> <up/down>" */ if (cooked.length < 4 || !cooked[1].equals("Iface")) { throw new IllegalStateException( Loading @@ -224,10 +209,7 @@ class NetworkManagementService extends INetworkManagementService.Stub { notifyInterfaceRemoved(cooked[3]); return true; } else if (cooked[2].equals("changed") && cooked.length == 5) { notifyInterfaceStatusChanged(cooked[3], cooked[4].equals("up")); return true; } else if (cooked[2].equals("linkstatus") && cooked.length == 5) { notifyInterfaceLinkStateChanged(cooked[3], cooked[4].equals("up")); notifyInterfaceLinkStatusChanged(cooked[3], cooked[4].equals("up")); return true; } throw new IllegalStateException( Loading
services/java/com/android/server/ThrottleService.java +1 −3 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public class ThrottleService extends IThrottleManager.Stub { mIface = iface; } public void interfaceStatusChanged(String iface, boolean link) { public void interfaceLinkStatusChanged(String iface, boolean link) { if (link) { if (TextUtils.equals(iface, mIface)) { mHandler.obtainMessage(mMsg).sendToTarget(); Loading @@ -176,8 +176,6 @@ public class ThrottleService extends IThrottleManager.Stub { } } public void interfaceLinkStateChanged(String iface, boolean linkState) {} public void interfaceRemoved(String iface) {} } Loading
services/java/com/android/server/connectivity/Tethering.java +3 −6 Original line number Diff line number Diff line Loading @@ -202,11 +202,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub { mDnsServers[1] = DNS_DEFAULT_SERVER2; } public void interfaceLinkStateChanged(String iface, boolean up) { } public void interfaceStatusChanged(String iface, boolean up) { if (DEBUG) Log.d(TAG, "interfaceStatusChanged " + iface + ", " + up); public void interfaceLinkStatusChanged(String iface, boolean link) { if (DEBUG) Log.d(TAG, "interfaceLinkStatusChanged " + iface + ", " + link); boolean found = false; boolean usb = false; if (isWifi(iface)) { Loading @@ -221,7 +218,7 @@ public class Tethering extends INetworkManagementEventObserver.Stub { synchronized (mIfaces) { TetherInterfaceSM sm = mIfaces.get(iface); if (up) { if (link) { if (sm == null) { sm = new TetherInterfaceSM(iface, mLooper, usb); mIfaces.put(iface, sm); Loading