Loading services/net/java/android/net/ip/IpManager.java +10 −22 Original line number Original line Diff line number Diff line Loading @@ -241,15 +241,22 @@ public class IpManager extends StateMachine { public IpManager(Context context, String ifName, Callback callback) public IpManager(Context context, String ifName, Callback callback) throws IllegalArgumentException { throws IllegalArgumentException { this(context, ifName, callback, INetworkManagementService.Stub.asInterface( ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE))); } /** * An expanded constructor, useful for dependency injection. */ public IpManager(Context context, String ifName, Callback callback, INetworkManagementService nwService) throws IllegalArgumentException { super(IpManager.class.getSimpleName() + "." + ifName); super(IpManager.class.getSimpleName() + "." + ifName); mTag = getName(); mTag = getName(); mContext = context; mContext = context; mInterfaceName = ifName; mInterfaceName = ifName; mCallback = callback; mCallback = callback; mNwService = nwService; mNwService = INetworkManagementService.Stub.asInterface( ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE)); mNetlinkTracker = new NetlinkTracker( mNetlinkTracker = new NetlinkTracker( mInterfaceName, mInterfaceName, Loading Loading @@ -277,25 +284,6 @@ public class IpManager extends StateMachine { super.start(); super.start(); } } /** * A special constructor for use in testing that bypasses some of the more * complicated setup bits. * * TODO: Figure out how to delete this yet preserve testability. */ @VisibleForTesting protected IpManager(String ifName, Callback callback) { super(IpManager.class.getSimpleName() + ".test-" + ifName); mTag = getName(); mInterfaceName = ifName; mCallback = callback; mContext = null; mNwService = null; mNetlinkTracker = null; } @Override @Override protected void onQuitting() { protected void onQuitting() { mCallback.onQuit(); mCallback.onQuit(); Loading Loading
services/net/java/android/net/ip/IpManager.java +10 −22 Original line number Original line Diff line number Diff line Loading @@ -241,15 +241,22 @@ public class IpManager extends StateMachine { public IpManager(Context context, String ifName, Callback callback) public IpManager(Context context, String ifName, Callback callback) throws IllegalArgumentException { throws IllegalArgumentException { this(context, ifName, callback, INetworkManagementService.Stub.asInterface( ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE))); } /** * An expanded constructor, useful for dependency injection. */ public IpManager(Context context, String ifName, Callback callback, INetworkManagementService nwService) throws IllegalArgumentException { super(IpManager.class.getSimpleName() + "." + ifName); super(IpManager.class.getSimpleName() + "." + ifName); mTag = getName(); mTag = getName(); mContext = context; mContext = context; mInterfaceName = ifName; mInterfaceName = ifName; mCallback = callback; mCallback = callback; mNwService = nwService; mNwService = INetworkManagementService.Stub.asInterface( ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE)); mNetlinkTracker = new NetlinkTracker( mNetlinkTracker = new NetlinkTracker( mInterfaceName, mInterfaceName, Loading Loading @@ -277,25 +284,6 @@ public class IpManager extends StateMachine { super.start(); super.start(); } } /** * A special constructor for use in testing that bypasses some of the more * complicated setup bits. * * TODO: Figure out how to delete this yet preserve testability. */ @VisibleForTesting protected IpManager(String ifName, Callback callback) { super(IpManager.class.getSimpleName() + ".test-" + ifName); mTag = getName(); mInterfaceName = ifName; mCallback = callback; mContext = null; mNwService = null; mNetlinkTracker = null; } @Override @Override protected void onQuitting() { protected void onQuitting() { mCallback.onQuit(); mCallback.onQuit(); Loading