Loading src/java/com/android/internal/telephony/PhoneSwitcher.java +34 −34 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ import java.util.concurrent.CompletableFuture; */ public class PhoneSwitcher extends Handler { private static final String LOG_TAG = "PhoneSwitcher"; private static final boolean VDBG = false; protected static final boolean VDBG = false; private static final int DEFAULT_NETWORK_CHANGE_TIMEOUT_MS = 5000; private static final int MODEM_COMMAND_RETRY_PERIOD_MS = 5000; Loading Loading @@ -154,17 +154,17 @@ public class PhoneSwitcher extends Handler { } } private final List<DcRequest> mPrioritizedDcRequests = new ArrayList<>(); private final RegistrantList mActivePhoneRegistrants; private final SubscriptionController mSubscriptionController; private final Context mContext; protected final List<DcRequest> mPrioritizedDcRequests = new ArrayList<DcRequest>(); protected final RegistrantList mActivePhoneRegistrants; protected final SubscriptionController mSubscriptionController; protected final Context mContext; private final LocalLog mLocalLog; private PhoneState[] mPhoneStates; private int[] mPhoneSubscriptions; private final CellularNetworkValidator mValidator; protected PhoneState[] mPhoneStates; protected int[] mPhoneSubscriptions; @VisibleForTesting protected final CellularNetworkValidator mValidator; private int mPendingSwitchSubId = INVALID_SUBSCRIPTION_ID; private boolean mPendingSwitchNeedValidation; @VisibleForTesting public final CellularNetworkValidator.ValidationCallback mValidationCallback = new CellularNetworkValidator.ValidationCallback() { Loading @@ -185,16 +185,16 @@ public class PhoneSwitcher extends Handler { @UnsupportedAppUsage // How many phones (correspondingly logical modems) are allowed for PS attach. This is used // when we specifically use setDataAllowed to initiate on-demand PS(data) attach for each phone. private int mMaxDataAttachModemCount; protected int mMaxDataAttachModemCount; // Local cache of TelephonyManager#getActiveModemCount(). 1 if in single SIM mode, 2 if in dual // SIM mode. private int mActiveModemCount; private static PhoneSwitcher sPhoneSwitcher = null; protected int mActiveModemCount; protected static PhoneSwitcher sPhoneSwitcher = null; // Which primary (non-opportunistic) subscription is set as data subscription among all primary // subscriptions. This value usually comes from user setting, and it's the subscription used for // Internet data if mOpptDataSubId is not set. private int mPrimaryDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; protected int mPrimaryDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; // mOpptDataSubId must be an active subscription. If it's set, it overrides mPrimaryDataSubId // to be used for Internet data. Loading @@ -202,7 +202,7 @@ public class PhoneSwitcher extends Handler { // The phone ID that has an active voice call. If set, and its mobile data setting is on, // it will become the mPreferredDataPhoneId. private int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX; protected int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX; @VisibleForTesting // It decides: Loading @@ -214,7 +214,7 @@ public class PhoneSwitcher extends Handler { protected int mPreferredDataPhoneId = SubscriptionManager.INVALID_PHONE_INDEX; // Subscription ID corresponds to mPreferredDataPhoneId. private int mPreferredDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; protected int mPreferredDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; // If non-null, An emergency call is about to be started, is ongoing, or has just ended and we // are overriding the DDS. Loading @@ -224,7 +224,7 @@ public class PhoneSwitcher extends Handler { private ISetOpportunisticDataCallback mSetOpptSubCallback; private static final int EVENT_PRIMARY_DATA_SUB_CHANGED = 101; private static final int EVENT_SUBSCRIPTION_CHANGED = 102; protected static final int EVENT_SUBSCRIPTION_CHANGED = 102; private static final int EVENT_REQUEST_NETWORK = 103; private static final int EVENT_RELEASE_NETWORK = 104; // ECBM has started/ended. If we just ended an emergency call and mEmergencyOverride is not Loading Loading @@ -262,12 +262,12 @@ public class PhoneSwitcher extends Handler { // Depending on version of IRadioConfig, we need to send either RIL_REQUEST_ALLOW_DATA if it's // 1.0, or RIL_REQUEST_SET_PREFERRED_DATA if it's 1.1 or later. So internally mHalCommandToUse // will be either HAL_COMMAND_ALLOW_DATA or HAL_COMMAND_ALLOW_DATA or HAL_COMMAND_UNKNOWN. private static final int HAL_COMMAND_UNKNOWN = 0; private static final int HAL_COMMAND_ALLOW_DATA = 1; private static final int HAL_COMMAND_PREFERRED_DATA = 2; private int mHalCommandToUse = HAL_COMMAND_UNKNOWN; protected static final int HAL_COMMAND_UNKNOWN = 0; protected static final int HAL_COMMAND_ALLOW_DATA = 1; protected static final int HAL_COMMAND_PREFERRED_DATA = 2; protected int mHalCommandToUse = HAL_COMMAND_UNKNOWN; private RadioConfig mRadioConfig; protected RadioConfig mRadioConfig; private final static int MAX_LOCAL_LOG_LINES = 30; Loading Loading @@ -768,8 +768,8 @@ public class PhoneSwitcher extends Handler { return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } private static final boolean REQUESTS_CHANGED = true; private static final boolean REQUESTS_UNCHANGED = false; protected static final boolean REQUESTS_CHANGED = true; protected static final boolean REQUESTS_UNCHANGED = false; /** * Re-evaluate things. Do nothing if nothing's changed. * Loading @@ -779,7 +779,7 @@ public class PhoneSwitcher extends Handler { * * @return {@code True} if the default data subscription need to be changed. */ private boolean onEvaluate(boolean requestsChanged, String reason) { protected boolean onEvaluate(boolean requestsChanged, String reason) { StringBuilder sb = new StringBuilder(reason); // If we use HAL_COMMAND_PREFERRED_DATA, Loading Loading @@ -907,18 +907,18 @@ public class PhoneSwitcher extends Handler { return diffDetected; } private static class PhoneState { protected static class PhoneState { public volatile boolean active = false; public long lastRequested = 0; } @UnsupportedAppUsage private void activate(int phoneId) { protected void activate(int phoneId) { switchPhone(phoneId, true); } @UnsupportedAppUsage private void deactivate(int phoneId) { protected void deactivate(int phoneId) { switchPhone(phoneId, false); } Loading Loading @@ -971,7 +971,7 @@ public class PhoneSwitcher extends Handler { msg.sendToTarget(); } private void sendRilCommands(int phoneId) { protected void sendRilCommands(int phoneId) { if (!SubscriptionManager.isValidPhoneId(phoneId)) return; Message message = Message.obtain(this, EVENT_MODEM_COMMAND_DONE, phoneId); Loading Loading @@ -1030,7 +1030,7 @@ public class PhoneSwitcher extends Handler { return phoneId; } private int getSubIdFromNetworkSpecifier(NetworkSpecifier specifier) { protected int getSubIdFromNetworkSpecifier(NetworkSpecifier specifier) { if (specifier == null) { return DEFAULT_SUBSCRIPTION_ID; } Loading @@ -1050,7 +1050,7 @@ public class PhoneSwitcher extends Handler { // This updates mPreferredDataPhoneId which decides which phone should handle default network // requests. private void updatePreferredDataPhoneId() { protected void updatePreferredDataPhoneId() { Phone voicePhone = findPhoneById(mPhoneIdInVoiceCall); if (mEmergencyOverride != null && findPhoneById(mEmergencyOverride.mPhoneId) != null) { // Override DDS for emergency even if user data is not enabled, since it is an Loading Loading @@ -1086,7 +1086,7 @@ public class PhoneSwitcher extends Handler { mPreferredDataSubId = mSubscriptionController.getSubIdUsingPhoneId(mPreferredDataPhoneId); } private void transitionToEmergencyPhone() { protected void transitionToEmergencyPhone() { if (mActiveModemCount <= 0) { log("No phones: unable to reset preferred phone for emergency"); return; Loading Loading @@ -1324,7 +1324,7 @@ public class PhoneSwitcher extends Handler { subId, needValidation ? 1 : 0, callback).sendToTarget(); } private boolean isPhoneInVoiceCall(Phone phone) { protected boolean isPhoneInVoiceCall(Phone phone) { if (phone == null) { return false; } Loading Loading @@ -1354,7 +1354,7 @@ public class PhoneSwitcher extends Handler { } @UnsupportedAppUsage private void log(String l) { protected void log(String l) { Rlog.d(LOG_TAG, l); mLocalLog.log(l); } Loading @@ -1370,7 +1370,7 @@ public class PhoneSwitcher extends Handler { /** * See {@link PhoneStateListener#LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE}. */ private void notifyPreferredDataSubIdChanged() { protected void notifyPreferredDataSubIdChanged() { TelephonyRegistryManager telephonyRegistryManager = (TelephonyRegistryManager) mContext .getSystemService(Context.TELEPHONY_REGISTRY_SERVICE); log("notifyPreferredDataSubIdChanged to " + mPreferredDataSubId); Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +16 −16 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ import java.util.stream.Collectors; * {@hide} */ public class DcTracker extends Handler { private static final boolean DBG = true; protected static final boolean DBG = true; private static final boolean VDBG = false; // STOPSHIP if true private static final boolean VDBG_STALL = false; // STOPSHIP if true private static final boolean RADIO_TESTS = false; Loading Loading @@ -238,7 +238,7 @@ public class DcTracker extends Handler { private static final int DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT = 1000 * 60; private static final boolean DATA_STALL_SUSPECTED = true; private static final boolean DATA_STALL_NOT_SUSPECTED = false; protected static final boolean DATA_STALL_NOT_SUSPECTED = false; private static final String INTENT_DATA_STALL_ALARM = "com.android.internal.telephony.data-stall"; Loading Loading @@ -568,10 +568,10 @@ public class DcTracker extends Handler { // True if data stall detection is enabled private volatile boolean mDataStallNoRxEnabled = true; private volatile boolean mFailFast = false; protected volatile boolean mFailFast = false; // True when in voice call private boolean mInVoiceCall = false; protected boolean mInVoiceCall = false; /** Intent sent when the reconnect alarm fires. */ private PendingIntent mReconnectIntent = null; Loading @@ -596,7 +596,7 @@ public class DcTracker extends Handler { private HashMap<String, Integer> mApnToDataConnectionId = new HashMap<String, Integer>(); /** Phone.APN_TYPE_* ===> ApnContext */ private ConcurrentHashMap<String, ApnContext> mApnContexts = protected ConcurrentHashMap<String, ApnContext> mApnContexts = new ConcurrentHashMap<String, ApnContext>(); private SparseArray<ApnContext> mApnContextsByType = new SparseArray<ApnContext>(); Loading Loading @@ -1484,7 +1484,7 @@ public class DcTracker extends Handler { } } private void setupDataOnConnectableApn(ApnContext apnContext, String reason, protected void setupDataOnConnectableApn(ApnContext apnContext, String reason, RetryFailures retryFailures) { if (VDBG) log("setupDataOnAllConnectableApns: apnContext " + apnContext); Loading Loading @@ -2229,7 +2229,7 @@ public class DcTracker extends Handler { return retry; } private void startReconnect(long delay, ApnContext apnContext) { protected void startReconnect(long delay, ApnContext apnContext) { Message msg = obtainMessage(DctConstants.EVENT_DATA_RECONNECT, mPhone.getSubId(), mTransportType, apnContext); cancelReconnect(apnContext); Loading @@ -2247,7 +2247,7 @@ public class DcTracker extends Handler { * * @param apnContext on which the alarm should be stopped. */ private void cancelReconnect(ApnContext apnContext) { protected void cancelReconnect(ApnContext apnContext) { if (apnContext == null) return; if (DBG) { Loading Loading @@ -2787,7 +2787,7 @@ public class DcTracker extends Handler { * A SETUP (aka bringUp) has completed, possibly with an error. If * there is an error this method will call {@link #onDataSetupCompleteError}. */ private void onDataSetupComplete(ApnContext apnContext, boolean success, int cause, protected void onDataSetupComplete(ApnContext apnContext, boolean success, int cause, @RequestNetworkType int requestType) { int apnType = ApnSetting.getApnTypesBitmaskFromString(apnContext.getApnType()); List<Message> messageList = mRequestNetworkCompletionMsgs.get(apnType); Loading Loading @@ -2969,7 +2969,7 @@ public class DcTracker extends Handler { * beginning if the list is empty. Between each SETUP request there will * be a delay defined by {@link #getApnDelay()}. */ private void onDataSetupCompleteError(ApnContext apnContext, protected void onDataSetupCompleteError(ApnContext apnContext, @RequestNetworkType int requestType) { long delay = apnContext.getDelayForNextApn(mFailFast); Loading Loading @@ -3116,7 +3116,7 @@ public class DcTracker extends Handler { } } private void onVoiceCallEnded() { protected void onVoiceCallEnded() { if (DBG) log("onVoiceCallEnded"); mInVoiceCall = false; if (isConnected()) { Loading @@ -3133,7 +3133,7 @@ public class DcTracker extends Handler { setupDataOnAllConnectableApns(Phone.REASON_VOICE_CALL_ENDED, RetryFailures.ALWAYS); } private boolean isConnected() { protected boolean isConnected() { for (ApnContext apnContext : mApnContexts.values()) { if (apnContext.getState() == DctConstants.State.CONNECTED) { // At least one context is connected, return true Loading Loading @@ -4421,13 +4421,13 @@ public class DcTracker extends Handler { /** * Polling stuff */ private void resetPollStats() { protected void resetPollStats() { mTxPkts = -1; mRxPkts = -1; mNetStatPollPeriod = POLL_NETSTAT_MILLIS; } private void startNetStatPoll() { protected void startNetStatPoll() { if (getOverallState() == DctConstants.State.CONNECTED && mNetStatPollEnabled == false) { if (DBG) { Loading Loading @@ -4868,7 +4868,7 @@ public class DcTracker extends Handler { startDataStallAlarm(suspectedStall); } private void startDataStallAlarm(boolean suspectedStall) { protected void startDataStallAlarm(boolean suspectedStall) { int delayInMs; if (mDsRecoveryHandler.isNoRxDataStallDetectionEnabled() Loading Loading @@ -5060,7 +5060,7 @@ public class DcTracker extends Handler { } @RilRadioTechnology private int getDataRat() { protected int getDataRat() { ServiceState ss = mPhone.getServiceState(); NetworkRegistrationInfo nrs = ss.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, mTransportType); Loading Loading
src/java/com/android/internal/telephony/PhoneSwitcher.java +34 −34 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ import java.util.concurrent.CompletableFuture; */ public class PhoneSwitcher extends Handler { private static final String LOG_TAG = "PhoneSwitcher"; private static final boolean VDBG = false; protected static final boolean VDBG = false; private static final int DEFAULT_NETWORK_CHANGE_TIMEOUT_MS = 5000; private static final int MODEM_COMMAND_RETRY_PERIOD_MS = 5000; Loading Loading @@ -154,17 +154,17 @@ public class PhoneSwitcher extends Handler { } } private final List<DcRequest> mPrioritizedDcRequests = new ArrayList<>(); private final RegistrantList mActivePhoneRegistrants; private final SubscriptionController mSubscriptionController; private final Context mContext; protected final List<DcRequest> mPrioritizedDcRequests = new ArrayList<DcRequest>(); protected final RegistrantList mActivePhoneRegistrants; protected final SubscriptionController mSubscriptionController; protected final Context mContext; private final LocalLog mLocalLog; private PhoneState[] mPhoneStates; private int[] mPhoneSubscriptions; private final CellularNetworkValidator mValidator; protected PhoneState[] mPhoneStates; protected int[] mPhoneSubscriptions; @VisibleForTesting protected final CellularNetworkValidator mValidator; private int mPendingSwitchSubId = INVALID_SUBSCRIPTION_ID; private boolean mPendingSwitchNeedValidation; @VisibleForTesting public final CellularNetworkValidator.ValidationCallback mValidationCallback = new CellularNetworkValidator.ValidationCallback() { Loading @@ -185,16 +185,16 @@ public class PhoneSwitcher extends Handler { @UnsupportedAppUsage // How many phones (correspondingly logical modems) are allowed for PS attach. This is used // when we specifically use setDataAllowed to initiate on-demand PS(data) attach for each phone. private int mMaxDataAttachModemCount; protected int mMaxDataAttachModemCount; // Local cache of TelephonyManager#getActiveModemCount(). 1 if in single SIM mode, 2 if in dual // SIM mode. private int mActiveModemCount; private static PhoneSwitcher sPhoneSwitcher = null; protected int mActiveModemCount; protected static PhoneSwitcher sPhoneSwitcher = null; // Which primary (non-opportunistic) subscription is set as data subscription among all primary // subscriptions. This value usually comes from user setting, and it's the subscription used for // Internet data if mOpptDataSubId is not set. private int mPrimaryDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; protected int mPrimaryDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; // mOpptDataSubId must be an active subscription. If it's set, it overrides mPrimaryDataSubId // to be used for Internet data. Loading @@ -202,7 +202,7 @@ public class PhoneSwitcher extends Handler { // The phone ID that has an active voice call. If set, and its mobile data setting is on, // it will become the mPreferredDataPhoneId. private int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX; protected int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX; @VisibleForTesting // It decides: Loading @@ -214,7 +214,7 @@ public class PhoneSwitcher extends Handler { protected int mPreferredDataPhoneId = SubscriptionManager.INVALID_PHONE_INDEX; // Subscription ID corresponds to mPreferredDataPhoneId. private int mPreferredDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; protected int mPreferredDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; // If non-null, An emergency call is about to be started, is ongoing, or has just ended and we // are overriding the DDS. Loading @@ -224,7 +224,7 @@ public class PhoneSwitcher extends Handler { private ISetOpportunisticDataCallback mSetOpptSubCallback; private static final int EVENT_PRIMARY_DATA_SUB_CHANGED = 101; private static final int EVENT_SUBSCRIPTION_CHANGED = 102; protected static final int EVENT_SUBSCRIPTION_CHANGED = 102; private static final int EVENT_REQUEST_NETWORK = 103; private static final int EVENT_RELEASE_NETWORK = 104; // ECBM has started/ended. If we just ended an emergency call and mEmergencyOverride is not Loading Loading @@ -262,12 +262,12 @@ public class PhoneSwitcher extends Handler { // Depending on version of IRadioConfig, we need to send either RIL_REQUEST_ALLOW_DATA if it's // 1.0, or RIL_REQUEST_SET_PREFERRED_DATA if it's 1.1 or later. So internally mHalCommandToUse // will be either HAL_COMMAND_ALLOW_DATA or HAL_COMMAND_ALLOW_DATA or HAL_COMMAND_UNKNOWN. private static final int HAL_COMMAND_UNKNOWN = 0; private static final int HAL_COMMAND_ALLOW_DATA = 1; private static final int HAL_COMMAND_PREFERRED_DATA = 2; private int mHalCommandToUse = HAL_COMMAND_UNKNOWN; protected static final int HAL_COMMAND_UNKNOWN = 0; protected static final int HAL_COMMAND_ALLOW_DATA = 1; protected static final int HAL_COMMAND_PREFERRED_DATA = 2; protected int mHalCommandToUse = HAL_COMMAND_UNKNOWN; private RadioConfig mRadioConfig; protected RadioConfig mRadioConfig; private final static int MAX_LOCAL_LOG_LINES = 30; Loading Loading @@ -768,8 +768,8 @@ public class PhoneSwitcher extends Handler { return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); } private static final boolean REQUESTS_CHANGED = true; private static final boolean REQUESTS_UNCHANGED = false; protected static final boolean REQUESTS_CHANGED = true; protected static final boolean REQUESTS_UNCHANGED = false; /** * Re-evaluate things. Do nothing if nothing's changed. * Loading @@ -779,7 +779,7 @@ public class PhoneSwitcher extends Handler { * * @return {@code True} if the default data subscription need to be changed. */ private boolean onEvaluate(boolean requestsChanged, String reason) { protected boolean onEvaluate(boolean requestsChanged, String reason) { StringBuilder sb = new StringBuilder(reason); // If we use HAL_COMMAND_PREFERRED_DATA, Loading Loading @@ -907,18 +907,18 @@ public class PhoneSwitcher extends Handler { return diffDetected; } private static class PhoneState { protected static class PhoneState { public volatile boolean active = false; public long lastRequested = 0; } @UnsupportedAppUsage private void activate(int phoneId) { protected void activate(int phoneId) { switchPhone(phoneId, true); } @UnsupportedAppUsage private void deactivate(int phoneId) { protected void deactivate(int phoneId) { switchPhone(phoneId, false); } Loading Loading @@ -971,7 +971,7 @@ public class PhoneSwitcher extends Handler { msg.sendToTarget(); } private void sendRilCommands(int phoneId) { protected void sendRilCommands(int phoneId) { if (!SubscriptionManager.isValidPhoneId(phoneId)) return; Message message = Message.obtain(this, EVENT_MODEM_COMMAND_DONE, phoneId); Loading Loading @@ -1030,7 +1030,7 @@ public class PhoneSwitcher extends Handler { return phoneId; } private int getSubIdFromNetworkSpecifier(NetworkSpecifier specifier) { protected int getSubIdFromNetworkSpecifier(NetworkSpecifier specifier) { if (specifier == null) { return DEFAULT_SUBSCRIPTION_ID; } Loading @@ -1050,7 +1050,7 @@ public class PhoneSwitcher extends Handler { // This updates mPreferredDataPhoneId which decides which phone should handle default network // requests. private void updatePreferredDataPhoneId() { protected void updatePreferredDataPhoneId() { Phone voicePhone = findPhoneById(mPhoneIdInVoiceCall); if (mEmergencyOverride != null && findPhoneById(mEmergencyOverride.mPhoneId) != null) { // Override DDS for emergency even if user data is not enabled, since it is an Loading Loading @@ -1086,7 +1086,7 @@ public class PhoneSwitcher extends Handler { mPreferredDataSubId = mSubscriptionController.getSubIdUsingPhoneId(mPreferredDataPhoneId); } private void transitionToEmergencyPhone() { protected void transitionToEmergencyPhone() { if (mActiveModemCount <= 0) { log("No phones: unable to reset preferred phone for emergency"); return; Loading Loading @@ -1324,7 +1324,7 @@ public class PhoneSwitcher extends Handler { subId, needValidation ? 1 : 0, callback).sendToTarget(); } private boolean isPhoneInVoiceCall(Phone phone) { protected boolean isPhoneInVoiceCall(Phone phone) { if (phone == null) { return false; } Loading Loading @@ -1354,7 +1354,7 @@ public class PhoneSwitcher extends Handler { } @UnsupportedAppUsage private void log(String l) { protected void log(String l) { Rlog.d(LOG_TAG, l); mLocalLog.log(l); } Loading @@ -1370,7 +1370,7 @@ public class PhoneSwitcher extends Handler { /** * See {@link PhoneStateListener#LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE}. */ private void notifyPreferredDataSubIdChanged() { protected void notifyPreferredDataSubIdChanged() { TelephonyRegistryManager telephonyRegistryManager = (TelephonyRegistryManager) mContext .getSystemService(Context.TELEPHONY_REGISTRY_SERVICE); log("notifyPreferredDataSubIdChanged to " + mPreferredDataSubId); Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +16 −16 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ import java.util.stream.Collectors; * {@hide} */ public class DcTracker extends Handler { private static final boolean DBG = true; protected static final boolean DBG = true; private static final boolean VDBG = false; // STOPSHIP if true private static final boolean VDBG_STALL = false; // STOPSHIP if true private static final boolean RADIO_TESTS = false; Loading Loading @@ -238,7 +238,7 @@ public class DcTracker extends Handler { private static final int DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT = 1000 * 60; private static final boolean DATA_STALL_SUSPECTED = true; private static final boolean DATA_STALL_NOT_SUSPECTED = false; protected static final boolean DATA_STALL_NOT_SUSPECTED = false; private static final String INTENT_DATA_STALL_ALARM = "com.android.internal.telephony.data-stall"; Loading Loading @@ -568,10 +568,10 @@ public class DcTracker extends Handler { // True if data stall detection is enabled private volatile boolean mDataStallNoRxEnabled = true; private volatile boolean mFailFast = false; protected volatile boolean mFailFast = false; // True when in voice call private boolean mInVoiceCall = false; protected boolean mInVoiceCall = false; /** Intent sent when the reconnect alarm fires. */ private PendingIntent mReconnectIntent = null; Loading @@ -596,7 +596,7 @@ public class DcTracker extends Handler { private HashMap<String, Integer> mApnToDataConnectionId = new HashMap<String, Integer>(); /** Phone.APN_TYPE_* ===> ApnContext */ private ConcurrentHashMap<String, ApnContext> mApnContexts = protected ConcurrentHashMap<String, ApnContext> mApnContexts = new ConcurrentHashMap<String, ApnContext>(); private SparseArray<ApnContext> mApnContextsByType = new SparseArray<ApnContext>(); Loading Loading @@ -1484,7 +1484,7 @@ public class DcTracker extends Handler { } } private void setupDataOnConnectableApn(ApnContext apnContext, String reason, protected void setupDataOnConnectableApn(ApnContext apnContext, String reason, RetryFailures retryFailures) { if (VDBG) log("setupDataOnAllConnectableApns: apnContext " + apnContext); Loading Loading @@ -2229,7 +2229,7 @@ public class DcTracker extends Handler { return retry; } private void startReconnect(long delay, ApnContext apnContext) { protected void startReconnect(long delay, ApnContext apnContext) { Message msg = obtainMessage(DctConstants.EVENT_DATA_RECONNECT, mPhone.getSubId(), mTransportType, apnContext); cancelReconnect(apnContext); Loading @@ -2247,7 +2247,7 @@ public class DcTracker extends Handler { * * @param apnContext on which the alarm should be stopped. */ private void cancelReconnect(ApnContext apnContext) { protected void cancelReconnect(ApnContext apnContext) { if (apnContext == null) return; if (DBG) { Loading Loading @@ -2787,7 +2787,7 @@ public class DcTracker extends Handler { * A SETUP (aka bringUp) has completed, possibly with an error. If * there is an error this method will call {@link #onDataSetupCompleteError}. */ private void onDataSetupComplete(ApnContext apnContext, boolean success, int cause, protected void onDataSetupComplete(ApnContext apnContext, boolean success, int cause, @RequestNetworkType int requestType) { int apnType = ApnSetting.getApnTypesBitmaskFromString(apnContext.getApnType()); List<Message> messageList = mRequestNetworkCompletionMsgs.get(apnType); Loading Loading @@ -2969,7 +2969,7 @@ public class DcTracker extends Handler { * beginning if the list is empty. Between each SETUP request there will * be a delay defined by {@link #getApnDelay()}. */ private void onDataSetupCompleteError(ApnContext apnContext, protected void onDataSetupCompleteError(ApnContext apnContext, @RequestNetworkType int requestType) { long delay = apnContext.getDelayForNextApn(mFailFast); Loading Loading @@ -3116,7 +3116,7 @@ public class DcTracker extends Handler { } } private void onVoiceCallEnded() { protected void onVoiceCallEnded() { if (DBG) log("onVoiceCallEnded"); mInVoiceCall = false; if (isConnected()) { Loading @@ -3133,7 +3133,7 @@ public class DcTracker extends Handler { setupDataOnAllConnectableApns(Phone.REASON_VOICE_CALL_ENDED, RetryFailures.ALWAYS); } private boolean isConnected() { protected boolean isConnected() { for (ApnContext apnContext : mApnContexts.values()) { if (apnContext.getState() == DctConstants.State.CONNECTED) { // At least one context is connected, return true Loading Loading @@ -4421,13 +4421,13 @@ public class DcTracker extends Handler { /** * Polling stuff */ private void resetPollStats() { protected void resetPollStats() { mTxPkts = -1; mRxPkts = -1; mNetStatPollPeriod = POLL_NETSTAT_MILLIS; } private void startNetStatPoll() { protected void startNetStatPoll() { if (getOverallState() == DctConstants.State.CONNECTED && mNetStatPollEnabled == false) { if (DBG) { Loading Loading @@ -4868,7 +4868,7 @@ public class DcTracker extends Handler { startDataStallAlarm(suspectedStall); } private void startDataStallAlarm(boolean suspectedStall) { protected void startDataStallAlarm(boolean suspectedStall) { int delayInMs; if (mDsRecoveryHandler.isNoRxDataStallDetectionEnabled() Loading Loading @@ -5060,7 +5060,7 @@ public class DcTracker extends Handler { } @RilRadioTechnology private int getDataRat() { protected int getDataRat() { ServiceState ss = mPhone.getServiceState(); NetworkRegistrationInfo nrs = ss.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, mTransportType); Loading