Loading core/java/android/net/ConnectivityManager.java +0 −44 Original line number Diff line number Diff line Loading @@ -1068,28 +1068,6 @@ public class ConnectivityManager { } } /** * Request that this callback be invoked at ConnectivityService's earliest * convenience with the current satisfying network's LinkProperties. * If no such network exists no callback invocation is performed. * * The callback must have been registered with #requestNetwork() or * #registerDefaultNetworkCallback(); callbacks registered with * registerNetworkCallback() are not specific to any particular Network so * do not cause any updates. * * TODO: Delete once callers are updated. * * @hide */ public void requestLinkProperties(NetworkCallback networkCallback) { try { mService.requestLinkProperties(networkCallback.networkRequest); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Get the {@link android.net.NetworkCapabilities} for the given {@link Network}. This * will return {@code null} if the network is unknown. Loading @@ -1107,28 +1085,6 @@ public class ConnectivityManager { } } /** * Request that this callback be invoked at ConnectivityService's earliest * convenience with the current satisfying network's NetworkCapabilities. * If no such network exists no callback invocation is performed. * * The callback must have been registered with #requestNetwork() or * #registerDefaultNetworkCallback(); callbacks registered with * registerNetworkCallback() are not specific to any particular Network so * do not cause any updates. * * TODO: Delete once callers are updated. * * @hide */ public void requestNetworkCapabilities(NetworkCallback networkCallback) { try { mService.requestNetworkCapabilities(networkCallback.networkRequest); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the URL that should be used for resolving whether a captive portal is present. * 1. This URL should respond with a 204 response to a GET request to indicate no captive Loading core/java/android/net/IConnectivityManager.aidl +0 −2 Original line number Diff line number Diff line Loading @@ -156,8 +156,6 @@ interface IConnectivityManager void pendingListenForNetwork(in NetworkCapabilities networkCapabilities, in PendingIntent operation); void requestLinkProperties(in NetworkRequest networkRequest); void requestNetworkCapabilities(in NetworkRequest networkRequest); void releaseNetworkRequest(in NetworkRequest networkRequest); void setAcceptUnvalidated(in Network network, boolean accept, boolean always); Loading services/core/java/com/android/server/ConnectivityService.java +0 −62 Original line number Diff line number Diff line Loading @@ -395,16 +395,6 @@ public class ConnectivityService extends IConnectivityManager.Stub */ private static final int EVENT_REGISTER_NETWORK_LISTENER_WITH_INTENT = 31; /** * Indicates a caller has requested to have its callback invoked with * the latest LinkProperties or NetworkCapabilities. * * arg1 = UID of caller * obj = NetworkRequest */ private static final int EVENT_REQUEST_LINKPROPERTIES = 32; private static final int EVENT_REQUEST_NETCAPABILITIES = 33; /** Handler thread used for both of the handlers below. */ @VisibleForTesting protected final HandlerThread mHandlerThread; Loading Loading @@ -2565,34 +2555,6 @@ public class ConnectivityService extends IConnectivityManager.Stub return nri; } private void handleRequestCallbackUpdate(NetworkRequest request, int callingUid, String description, int callbackType) { final NetworkRequestInfo nri = getNriForAppRequest(request, callingUid, description); if (nri == null) return; final NetworkAgentInfo nai = mNetworkForRequestId.get(nri.request.requestId); // The network that is satisfying this request may have changed since // the application requested the update. // // - If the request is no longer satisfied, don't send any updates. // - If the request is satisfied by a different network, it is the // caller's responsibility to check that the Network object in the // callback matches the network that was returned in the last // onAvailable() callback for this request. if (nai == null) return; callCallbackForRequest(nri, nai, callbackType, 0); } private void handleRequestLinkProperties(NetworkRequest request, int callingUid) { handleRequestCallbackUpdate(request, callingUid, "request LinkProperties", ConnectivityManager.CALLBACK_IP_CHANGED); } private void handleRequestNetworkCapabilities(NetworkRequest request, int callingUid) { handleRequestCallbackUpdate(request, callingUid, "request NetworkCapabilities", ConnectivityManager.CALLBACK_CAP_CHANGED); } private void handleTimedOutNetworkRequest(final NetworkRequestInfo nri) { if (mNetworkRequests.get(nri.request) != null && mNetworkForRequestId.get( nri.request.requestId) == null) { Loading Loading @@ -2986,12 +2948,6 @@ public class ConnectivityService extends IConnectivityManager.Stub handleMobileDataAlwaysOn(); break; } case EVENT_REQUEST_LINKPROPERTIES: handleRequestLinkProperties((NetworkRequest) msg.obj, msg.arg1); break; case EVENT_REQUEST_NETCAPABILITIES: handleRequestNetworkCapabilities((NetworkRequest) msg.obj, msg.arg1); break; // Sent by KeepaliveTracker to process an app request on the state machine thread. case NetworkAgent.CMD_START_PACKET_KEEPALIVE: { mKeepaliveTracker.handleStartKeepalive(msg); Loading Loading @@ -4351,24 +4307,6 @@ public class ConnectivityService extends IConnectivityManager.Stub mHandler.sendMessage(mHandler.obtainMessage(EVENT_REGISTER_NETWORK_LISTENER, nri)); } // TODO: Delete once callers are updated. @Override public void requestLinkProperties(NetworkRequest networkRequest) { ensureNetworkRequestHasType(networkRequest); if (networkRequest.type == NetworkRequest.Type.LISTEN) return; mHandler.sendMessage(mHandler.obtainMessage( EVENT_REQUEST_LINKPROPERTIES, getCallingUid(), 0, networkRequest)); } // TODO: Delete once callers are updated. @Override public void requestNetworkCapabilities(NetworkRequest networkRequest) { ensureNetworkRequestHasType(networkRequest); if (networkRequest.type == NetworkRequest.Type.LISTEN) return; mHandler.sendMessage(mHandler.obtainMessage( EVENT_REQUEST_NETCAPABILITIES, getCallingUid(), 0, networkRequest)); } @Override public void releaseNetworkRequest(NetworkRequest networkRequest) { ensureNetworkRequestHasType(networkRequest); Loading services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java +2 −8 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ public class UpstreamNetworkMonitor { switch (callbackType) { case CALLBACK_LISTEN_ALL: break; case CALLBACK_TRACK_DEFAULT: if (mDefaultNetworkCallback == null) { // The callback was unregistered in the interval between Loading @@ -198,11 +199,9 @@ public class UpstreamNetworkMonitor { // These request*() calls can be deleted post oag/339444. return; } cm().requestNetworkCapabilities(mDefaultNetworkCallback); cm().requestLinkProperties(mDefaultNetworkCallback); mCurrentDefault = network; break; case CALLBACK_MOBILE_REQUEST: if (mMobileNetworkCallback == null) { // The callback was unregistered in the interval between Loading @@ -211,13 +210,8 @@ public class UpstreamNetworkMonitor { // // Clean-up of this network entry is deferred to the // handling of onLost() by other callbacks. // // These request*() calls can be deleted post oag/339444. return; } cm().requestNetworkCapabilities(mMobileNetworkCallback); cm().requestLinkProperties(mMobileNetworkCallback); break; } Loading tests/net/java/com/android/server/ConnectivityServiceTest.java +0 −14 Original line number Diff line number Diff line Loading @@ -1933,20 +1933,6 @@ public class ConnectivityServiceTest extends AndroidTestCase { dfltNetworkCallback.expectAvailableAndSuspendedCallbacks(mCellNetworkAgent); dfltNetworkCallback.assertNoCallback(); // Request a NetworkCapabilities update; only the requesting callback is notified. // TODO: Delete this together with Connectivity{Manager,Service} code. mCm.requestNetworkCapabilities(dfltNetworkCallback); dfltNetworkCallback.expectCallback(CallbackState.NETWORK_CAPABILITIES, mCellNetworkAgent); cellNetworkCallback.assertNoCallback(); dfltNetworkCallback.assertNoCallback(); // Request a LinkProperties update; only the requesting callback is notified. // TODO: Delete this together with Connectivity{Manager,Service} code. mCm.requestLinkProperties(dfltNetworkCallback); dfltNetworkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent); cellNetworkCallback.assertNoCallback(); dfltNetworkCallback.assertNoCallback(); mCm.unregisterNetworkCallback(dfltNetworkCallback); mCm.unregisterNetworkCallback(cellNetworkCallback); } Loading Loading
core/java/android/net/ConnectivityManager.java +0 −44 Original line number Diff line number Diff line Loading @@ -1068,28 +1068,6 @@ public class ConnectivityManager { } } /** * Request that this callback be invoked at ConnectivityService's earliest * convenience with the current satisfying network's LinkProperties. * If no such network exists no callback invocation is performed. * * The callback must have been registered with #requestNetwork() or * #registerDefaultNetworkCallback(); callbacks registered with * registerNetworkCallback() are not specific to any particular Network so * do not cause any updates. * * TODO: Delete once callers are updated. * * @hide */ public void requestLinkProperties(NetworkCallback networkCallback) { try { mService.requestLinkProperties(networkCallback.networkRequest); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Get the {@link android.net.NetworkCapabilities} for the given {@link Network}. This * will return {@code null} if the network is unknown. Loading @@ -1107,28 +1085,6 @@ public class ConnectivityManager { } } /** * Request that this callback be invoked at ConnectivityService's earliest * convenience with the current satisfying network's NetworkCapabilities. * If no such network exists no callback invocation is performed. * * The callback must have been registered with #requestNetwork() or * #registerDefaultNetworkCallback(); callbacks registered with * registerNetworkCallback() are not specific to any particular Network so * do not cause any updates. * * TODO: Delete once callers are updated. * * @hide */ public void requestNetworkCapabilities(NetworkCallback networkCallback) { try { mService.requestNetworkCapabilities(networkCallback.networkRequest); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the URL that should be used for resolving whether a captive portal is present. * 1. This URL should respond with a 204 response to a GET request to indicate no captive Loading
core/java/android/net/IConnectivityManager.aidl +0 −2 Original line number Diff line number Diff line Loading @@ -156,8 +156,6 @@ interface IConnectivityManager void pendingListenForNetwork(in NetworkCapabilities networkCapabilities, in PendingIntent operation); void requestLinkProperties(in NetworkRequest networkRequest); void requestNetworkCapabilities(in NetworkRequest networkRequest); void releaseNetworkRequest(in NetworkRequest networkRequest); void setAcceptUnvalidated(in Network network, boolean accept, boolean always); Loading
services/core/java/com/android/server/ConnectivityService.java +0 −62 Original line number Diff line number Diff line Loading @@ -395,16 +395,6 @@ public class ConnectivityService extends IConnectivityManager.Stub */ private static final int EVENT_REGISTER_NETWORK_LISTENER_WITH_INTENT = 31; /** * Indicates a caller has requested to have its callback invoked with * the latest LinkProperties or NetworkCapabilities. * * arg1 = UID of caller * obj = NetworkRequest */ private static final int EVENT_REQUEST_LINKPROPERTIES = 32; private static final int EVENT_REQUEST_NETCAPABILITIES = 33; /** Handler thread used for both of the handlers below. */ @VisibleForTesting protected final HandlerThread mHandlerThread; Loading Loading @@ -2565,34 +2555,6 @@ public class ConnectivityService extends IConnectivityManager.Stub return nri; } private void handleRequestCallbackUpdate(NetworkRequest request, int callingUid, String description, int callbackType) { final NetworkRequestInfo nri = getNriForAppRequest(request, callingUid, description); if (nri == null) return; final NetworkAgentInfo nai = mNetworkForRequestId.get(nri.request.requestId); // The network that is satisfying this request may have changed since // the application requested the update. // // - If the request is no longer satisfied, don't send any updates. // - If the request is satisfied by a different network, it is the // caller's responsibility to check that the Network object in the // callback matches the network that was returned in the last // onAvailable() callback for this request. if (nai == null) return; callCallbackForRequest(nri, nai, callbackType, 0); } private void handleRequestLinkProperties(NetworkRequest request, int callingUid) { handleRequestCallbackUpdate(request, callingUid, "request LinkProperties", ConnectivityManager.CALLBACK_IP_CHANGED); } private void handleRequestNetworkCapabilities(NetworkRequest request, int callingUid) { handleRequestCallbackUpdate(request, callingUid, "request NetworkCapabilities", ConnectivityManager.CALLBACK_CAP_CHANGED); } private void handleTimedOutNetworkRequest(final NetworkRequestInfo nri) { if (mNetworkRequests.get(nri.request) != null && mNetworkForRequestId.get( nri.request.requestId) == null) { Loading Loading @@ -2986,12 +2948,6 @@ public class ConnectivityService extends IConnectivityManager.Stub handleMobileDataAlwaysOn(); break; } case EVENT_REQUEST_LINKPROPERTIES: handleRequestLinkProperties((NetworkRequest) msg.obj, msg.arg1); break; case EVENT_REQUEST_NETCAPABILITIES: handleRequestNetworkCapabilities((NetworkRequest) msg.obj, msg.arg1); break; // Sent by KeepaliveTracker to process an app request on the state machine thread. case NetworkAgent.CMD_START_PACKET_KEEPALIVE: { mKeepaliveTracker.handleStartKeepalive(msg); Loading Loading @@ -4351,24 +4307,6 @@ public class ConnectivityService extends IConnectivityManager.Stub mHandler.sendMessage(mHandler.obtainMessage(EVENT_REGISTER_NETWORK_LISTENER, nri)); } // TODO: Delete once callers are updated. @Override public void requestLinkProperties(NetworkRequest networkRequest) { ensureNetworkRequestHasType(networkRequest); if (networkRequest.type == NetworkRequest.Type.LISTEN) return; mHandler.sendMessage(mHandler.obtainMessage( EVENT_REQUEST_LINKPROPERTIES, getCallingUid(), 0, networkRequest)); } // TODO: Delete once callers are updated. @Override public void requestNetworkCapabilities(NetworkRequest networkRequest) { ensureNetworkRequestHasType(networkRequest); if (networkRequest.type == NetworkRequest.Type.LISTEN) return; mHandler.sendMessage(mHandler.obtainMessage( EVENT_REQUEST_NETCAPABILITIES, getCallingUid(), 0, networkRequest)); } @Override public void releaseNetworkRequest(NetworkRequest networkRequest) { ensureNetworkRequestHasType(networkRequest); Loading
services/core/java/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java +2 −8 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ public class UpstreamNetworkMonitor { switch (callbackType) { case CALLBACK_LISTEN_ALL: break; case CALLBACK_TRACK_DEFAULT: if (mDefaultNetworkCallback == null) { // The callback was unregistered in the interval between Loading @@ -198,11 +199,9 @@ public class UpstreamNetworkMonitor { // These request*() calls can be deleted post oag/339444. return; } cm().requestNetworkCapabilities(mDefaultNetworkCallback); cm().requestLinkProperties(mDefaultNetworkCallback); mCurrentDefault = network; break; case CALLBACK_MOBILE_REQUEST: if (mMobileNetworkCallback == null) { // The callback was unregistered in the interval between Loading @@ -211,13 +210,8 @@ public class UpstreamNetworkMonitor { // // Clean-up of this network entry is deferred to the // handling of onLost() by other callbacks. // // These request*() calls can be deleted post oag/339444. return; } cm().requestNetworkCapabilities(mMobileNetworkCallback); cm().requestLinkProperties(mMobileNetworkCallback); break; } Loading
tests/net/java/com/android/server/ConnectivityServiceTest.java +0 −14 Original line number Diff line number Diff line Loading @@ -1933,20 +1933,6 @@ public class ConnectivityServiceTest extends AndroidTestCase { dfltNetworkCallback.expectAvailableAndSuspendedCallbacks(mCellNetworkAgent); dfltNetworkCallback.assertNoCallback(); // Request a NetworkCapabilities update; only the requesting callback is notified. // TODO: Delete this together with Connectivity{Manager,Service} code. mCm.requestNetworkCapabilities(dfltNetworkCallback); dfltNetworkCallback.expectCallback(CallbackState.NETWORK_CAPABILITIES, mCellNetworkAgent); cellNetworkCallback.assertNoCallback(); dfltNetworkCallback.assertNoCallback(); // Request a LinkProperties update; only the requesting callback is notified. // TODO: Delete this together with Connectivity{Manager,Service} code. mCm.requestLinkProperties(dfltNetworkCallback); dfltNetworkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent); cellNetworkCallback.assertNoCallback(); dfltNetworkCallback.assertNoCallback(); mCm.unregisterNetworkCallback(dfltNetworkCallback); mCm.unregisterNetworkCallback(cellNetworkCallback); } Loading