Loading src/java/com/android/internal/telephony/data/DataNetwork.java +20 −9 Original line number Diff line number Diff line Loading @@ -999,6 +999,7 @@ public class DataNetwork extends StateMachine { networkRequest.setState(TelephonyNetworkRequest.REQUEST_STATE_UNSATISFIED); networkRequest.setAttachedNetwork(null); } log("All network requests detached."); mAttachedNetworkRequestList.clear(); break; } Loading Loading @@ -1400,6 +1401,24 @@ public class DataNetwork extends StateMachine { @Override public void enter() { logl("Data network disconnected. mEverConnected=" + mEverConnected); // Preserve the list for onSetupDataFailed callback, because we need to pass that list // back to DataNetworkController, but after EVENT_DETACH_ALL_NETWORK_REQUESTS gets // processed, the network request list would become empty. NetworkRequestList requestList = new NetworkRequestList(mAttachedNetworkRequestList); // The detach all network requests must be the last message to handle. sendMessage(EVENT_DETACH_ALL_NETWORK_REQUESTS); // Gracefully handle all the un-processed events then quit the state machine. // quit() throws a QUIT event to the end of message queue. All the events before quit() // will be processed. Events after quit() will not be processed. quit(); //************************************************************// // DO NOT POST ANY EVENTS AFTER HERE. // // THE STATE MACHINE WONT PROCESS EVENTS AFTER QUIT. // // ONLY CLEANUP SHOULD BE PERFORMED AFTER THIS. // //************************************************************// if (mEverConnected) { mDataNetworkCallback.invokeFromExecutor(() -> mDataNetworkCallback .onDisconnected(DataNetwork.this, mFailCause)); Loading @@ -1409,15 +1428,8 @@ public class DataNetwork extends StateMachine { } else { mDataNetworkCallback.invokeFromExecutor(() -> mDataNetworkCallback .onSetupDataFailed(DataNetwork.this, new NetworkRequestList(mAttachedNetworkRequestList), mFailCause, mRetryDelayMillis)); requestList, mFailCause, mRetryDelayMillis)); } // The detach all network requests must be the last message to handle. sendMessage(EVENT_DETACH_ALL_NETWORK_REQUESTS); // Gracefully handle all the un-processed events then quit the state machine. // quit() throws a QUIT event to the end of message queue. All the events before quit() // will be processed. Events after quit() will not be processed. quit(); notifyPreciseDataConnectionState(); mNetworkAgent.unregister(); mDataCallSessionStats.onDataCallDisconnected(mFailCause); Loading Loading @@ -1525,7 +1537,6 @@ public class DataNetwork extends StateMachine { */ public void detachNetworkRequest(@NonNull TelephonyNetworkRequest networkRequest) { if (getCurrentState() == null || isDisconnected()) { mAttachedNetworkRequestList.remove(networkRequest); return; } sendMessage(obtainMessage(EVENT_DETACH_NETWORK_REQUEST, networkRequest)); Loading tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,7 @@ public abstract class TelephonyTest { Settings.Global.putInt(resolver, Settings.Global.DEVICE_PROVISIONED, 1); Settings.Global.putInt(resolver, Settings.Global.DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, 1); Settings.Global.putInt(resolver, Settings.Global.DATA_ROAMING, 0); doReturn(mDataThrottler).when(mDcTracker).getDataThrottler(); doReturn(-1L).when(mDataThrottler).getRetryTime(anyInt()); Loading Loading
src/java/com/android/internal/telephony/data/DataNetwork.java +20 −9 Original line number Diff line number Diff line Loading @@ -999,6 +999,7 @@ public class DataNetwork extends StateMachine { networkRequest.setState(TelephonyNetworkRequest.REQUEST_STATE_UNSATISFIED); networkRequest.setAttachedNetwork(null); } log("All network requests detached."); mAttachedNetworkRequestList.clear(); break; } Loading Loading @@ -1400,6 +1401,24 @@ public class DataNetwork extends StateMachine { @Override public void enter() { logl("Data network disconnected. mEverConnected=" + mEverConnected); // Preserve the list for onSetupDataFailed callback, because we need to pass that list // back to DataNetworkController, but after EVENT_DETACH_ALL_NETWORK_REQUESTS gets // processed, the network request list would become empty. NetworkRequestList requestList = new NetworkRequestList(mAttachedNetworkRequestList); // The detach all network requests must be the last message to handle. sendMessage(EVENT_DETACH_ALL_NETWORK_REQUESTS); // Gracefully handle all the un-processed events then quit the state machine. // quit() throws a QUIT event to the end of message queue. All the events before quit() // will be processed. Events after quit() will not be processed. quit(); //************************************************************// // DO NOT POST ANY EVENTS AFTER HERE. // // THE STATE MACHINE WONT PROCESS EVENTS AFTER QUIT. // // ONLY CLEANUP SHOULD BE PERFORMED AFTER THIS. // //************************************************************// if (mEverConnected) { mDataNetworkCallback.invokeFromExecutor(() -> mDataNetworkCallback .onDisconnected(DataNetwork.this, mFailCause)); Loading @@ -1409,15 +1428,8 @@ public class DataNetwork extends StateMachine { } else { mDataNetworkCallback.invokeFromExecutor(() -> mDataNetworkCallback .onSetupDataFailed(DataNetwork.this, new NetworkRequestList(mAttachedNetworkRequestList), mFailCause, mRetryDelayMillis)); requestList, mFailCause, mRetryDelayMillis)); } // The detach all network requests must be the last message to handle. sendMessage(EVENT_DETACH_ALL_NETWORK_REQUESTS); // Gracefully handle all the un-processed events then quit the state machine. // quit() throws a QUIT event to the end of message queue. All the events before quit() // will be processed. Events after quit() will not be processed. quit(); notifyPreciseDataConnectionState(); mNetworkAgent.unregister(); mDataCallSessionStats.onDataCallDisconnected(mFailCause); Loading Loading @@ -1525,7 +1537,6 @@ public class DataNetwork extends StateMachine { */ public void detachNetworkRequest(@NonNull TelephonyNetworkRequest networkRequest) { if (getCurrentState() == null || isDisconnected()) { mAttachedNetworkRequestList.remove(networkRequest); return; } sendMessage(obtainMessage(EVENT_DETACH_NETWORK_REQUEST, networkRequest)); Loading
tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,7 @@ public abstract class TelephonyTest { Settings.Global.putInt(resolver, Settings.Global.DEVICE_PROVISIONED, 1); Settings.Global.putInt(resolver, Settings.Global.DEVICE_PROVISIONING_MOBILE_DATA_ENABLED, 1); Settings.Global.putInt(resolver, Settings.Global.DATA_ROAMING, 0); doReturn(mDataThrottler).when(mDcTracker).getDataThrottler(); doReturn(-1L).when(mDataThrottler).getRetryTime(anyInt()); Loading