Loading src/java/com/android/internal/telephony/PhoneSwitcher.java +20 −24 Original line number Diff line number Diff line Loading @@ -327,7 +327,13 @@ public class PhoneSwitcher extends Handler { } } return (mPhoneIdInVoiceCall != oldPhoneIdInVoiceCall); if (mPhoneIdInVoiceCall != oldPhoneIdInVoiceCall) { log("isPhoneInVoiceCallChanged from phoneId " + oldPhoneIdInVoiceCall + " to phoneId " + mPhoneIdInVoiceCall); return true; } else { return false; } } @VisibleForTesting Loading Loading @@ -606,19 +612,6 @@ public class PhoneSwitcher extends Handler { } } private boolean isEmergency() { if (isInEmergencyCallbackMode()) return true; for (Phone p : mPhones) { if (p == null) continue; if (p.isInEmergencyCall()) return true; Phone imsPhone = p.getImsPhone(); if (imsPhone != null && imsPhone.isInEmergencyCall()) { return true; } } return false; } private boolean isInEmergencyCallbackMode() { for (Phone p : mPhones) { if (p == null) continue; Loading Loading @@ -734,10 +727,6 @@ public class PhoneSwitcher extends Handler { */ private boolean onEvaluate(boolean requestsChanged, String reason) { StringBuilder sb = new StringBuilder(reason); if (isEmergency()) { log("onEvaluate for reason " + reason + " aborted due to Emergency"); return false; } // If we use HAL_COMMAND_PREFERRED_DATA, boolean diffDetected = mHalCommandToUse != HAL_COMMAND_PREFERRED_DATA && requestsChanged; Loading Loading @@ -812,6 +801,12 @@ public class PhoneSwitcher extends Handler { newActivePhones.add(mPhones[i].getPhoneId()); } } else { // First try to activate phone in voice call. if (mPhoneIdInVoiceCall != SubscriptionManager.INVALID_PHONE_INDEX) { newActivePhones.add(mPhoneIdInVoiceCall); } if (newActivePhones.size() < mMaxActivePhones) { for (DcRequest dcRequest : mPrioritizedDcRequests) { int phoneIdForRequest = phoneIdForRequest(dcRequest.networkRequest); if (phoneIdForRequest == INVALID_PHONE_INDEX) continue; Loading @@ -819,6 +814,7 @@ public class PhoneSwitcher extends Handler { newActivePhones.add(phoneIdForRequest); if (newActivePhones.size() >= mMaxActivePhones) break; } } if (newActivePhones.size() < mMaxActivePhones && newActivePhones.contains(mPreferredDataPhoneId) Loading Loading
src/java/com/android/internal/telephony/PhoneSwitcher.java +20 −24 Original line number Diff line number Diff line Loading @@ -327,7 +327,13 @@ public class PhoneSwitcher extends Handler { } } return (mPhoneIdInVoiceCall != oldPhoneIdInVoiceCall); if (mPhoneIdInVoiceCall != oldPhoneIdInVoiceCall) { log("isPhoneInVoiceCallChanged from phoneId " + oldPhoneIdInVoiceCall + " to phoneId " + mPhoneIdInVoiceCall); return true; } else { return false; } } @VisibleForTesting Loading Loading @@ -606,19 +612,6 @@ public class PhoneSwitcher extends Handler { } } private boolean isEmergency() { if (isInEmergencyCallbackMode()) return true; for (Phone p : mPhones) { if (p == null) continue; if (p.isInEmergencyCall()) return true; Phone imsPhone = p.getImsPhone(); if (imsPhone != null && imsPhone.isInEmergencyCall()) { return true; } } return false; } private boolean isInEmergencyCallbackMode() { for (Phone p : mPhones) { if (p == null) continue; Loading Loading @@ -734,10 +727,6 @@ public class PhoneSwitcher extends Handler { */ private boolean onEvaluate(boolean requestsChanged, String reason) { StringBuilder sb = new StringBuilder(reason); if (isEmergency()) { log("onEvaluate for reason " + reason + " aborted due to Emergency"); return false; } // If we use HAL_COMMAND_PREFERRED_DATA, boolean diffDetected = mHalCommandToUse != HAL_COMMAND_PREFERRED_DATA && requestsChanged; Loading Loading @@ -812,6 +801,12 @@ public class PhoneSwitcher extends Handler { newActivePhones.add(mPhones[i].getPhoneId()); } } else { // First try to activate phone in voice call. if (mPhoneIdInVoiceCall != SubscriptionManager.INVALID_PHONE_INDEX) { newActivePhones.add(mPhoneIdInVoiceCall); } if (newActivePhones.size() < mMaxActivePhones) { for (DcRequest dcRequest : mPrioritizedDcRequests) { int phoneIdForRequest = phoneIdForRequest(dcRequest.networkRequest); if (phoneIdForRequest == INVALID_PHONE_INDEX) continue; Loading @@ -819,6 +814,7 @@ public class PhoneSwitcher extends Handler { newActivePhones.add(phoneIdForRequest); if (newActivePhones.size() >= mMaxActivePhones) break; } } if (newActivePhones.size() < mMaxActivePhones && newActivePhones.contains(mPreferredDataPhoneId) Loading