Loading src/java/com/android/internal/telephony/RetryManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -505,6 +505,7 @@ public class RetryManager { mSameApnRetryCount < MAX_SAME_APN_RETRY) { // If the modem explicitly suggests a retry delay, we should use it, even in fail fast // mode. log("Modem suggested retry in " + mModemSuggestedDelay + " ms."); return mModemSuggestedDelay; } Loading @@ -523,7 +524,10 @@ public class RetryManager { // If we've already cycled through all the APNs, that means all APNs have // permanently failed if (index == mCurrentApnIndex) return NO_RETRY; if (index == mCurrentApnIndex) { log("All APNs have permanently failed."); return NO_RETRY; } } long delay; Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +1 −3 Original line number Diff line number Diff line Loading @@ -568,9 +568,7 @@ public final class DataConnection extends StateMachine { // Get the completed message but only use it once Message connectionCompletedMsg = cp.mOnCompletedMsg; cp.mOnCompletedMsg = null; if (connectionCompletedMsg.obj instanceof ApnContext) { alreadySent = (ApnContext)connectionCompletedMsg.obj; } alreadySent = cp.mApnContext; long timeStamp = System.currentTimeMillis(); connectionCompletedMsg.arg1 = mCid; Loading src/java/com/android/internal/telephony/dataconnection/DcTesterDeactivateAll.java +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ import com.android.internal.telephony.Phone; * adb shell am broadcast -a com.android.internal.telephony.dataconnection.action_deactivate_all */ public class DcTesterDeactivateAll { private static final String LOG_TAG = "DcTesterDeacativeAll"; private static final String LOG_TAG = "DcTesterDeacativateAll"; private static final boolean DBG = true; private Phone mPhone; Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +4 −1 Original line number Diff line number Diff line Loading @@ -2186,7 +2186,10 @@ public class DcTracker extends Handler { PendingIntent alarmIntent = PendingIntent.getBroadcast(mPhone.getContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); apnContext.setReconnectIntent(alarmIntent); mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, // Use the exact timer instead of the inexact one to provide better user experience. // In some extreme cases, we saw the retry was delayed for few minutes. mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + delay, alarmIntent); } Loading src/java/com/android/internal/telephony/test/SimulatedCommands.java +23 −18 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ public class SimulatedCommands extends BaseCommands int mNextCallFailCause = CallFailCause.NORMAL_CLEARING; private boolean mDcSuccess = true; private DataCallResponse mDcResponse; //***** Constructor Loading Loading @@ -149,7 +150,7 @@ public class SimulatedCommands extends BaseCommands if(mIccCardStatus!=null) { resultSuccess(result, mIccCardStatus); } else { resultFail(result, new RuntimeException("IccCardStatus not set")); resultFail(result, null, new RuntimeException("IccCardStatus not set")); } } Loading Loading @@ -502,9 +503,8 @@ public class SimulatedCommands extends BaseCommands resultSuccess(result, simulatedCallState.getDriverCalls()); } else { //Rlog.i("GSM", "[SimCmds] getCurrentCalls: RADIO_OFF or SIM not ready!"); resultFail(result, new CommandException( CommandException.Error.RADIO_NOT_AVAILABLE)); resultFail(result, null, new CommandException(CommandException.Error.RADIO_NOT_AVAILABLE)); } } Loading Loading @@ -636,7 +636,7 @@ public class SimulatedCommands extends BaseCommands if (!success){ Rlog.i("GSM", "[SimCmd] hangupConnection: resultFail"); resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { Rlog.i("GSM", "[SimCmd] hangupConnection: resultSuccess"); resultSuccess(result, null); Loading @@ -658,7 +658,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('0', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -680,7 +680,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('1', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -702,7 +702,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('2', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -723,7 +723,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('3', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -744,7 +744,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('4', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -763,7 +763,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('2', ch); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -783,7 +783,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onAnswer(); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -802,7 +802,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('0', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading Loading @@ -1109,8 +1109,9 @@ public class SimulatedCommands extends BaseCommands unimplemented(response); } public void setDataCallResponse(final DataCallResponse dcResponse) { public void setDataCallResponse(final boolean success, final DataCallResponse dcResponse) { mDcResponse = dcResponse; mDcSuccess = success; } @Override Loading @@ -1136,7 +1137,11 @@ public class SimulatedCommands extends BaseCommands mDcResponse.pcscf = new String[]{}; } if (mDcSuccess) { resultSuccess(result, mDcResponse); } else { resultFail(result, mDcResponse, new RuntimeException("Setup data call failed!")); } } @Override Loading Loading @@ -1607,9 +1612,9 @@ public class SimulatedCommands extends BaseCommands } } private void resultFail(Message result, Throwable tr) { private void resultFail(Message result, Object ret, Throwable tr) { if (result != null) { AsyncResult.forMessage(result).exception = tr; AsyncResult.forMessage(result, ret, tr); if (mPausedResponseCount > 0) { mPausedResponses.add(result); } else { Loading Loading @@ -1892,7 +1897,7 @@ public class SimulatedCommands extends BaseCommands if(mIccIoResultForApduLogicalChannel!=null) { resultSuccess(response, mIccIoResultForApduLogicalChannel); }else { resultFail(response, new RuntimeException("IccIoResult not set")); resultFail(response, null, new RuntimeException("IccIoResult not set")); } } Loading Loading
src/java/com/android/internal/telephony/RetryManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -505,6 +505,7 @@ public class RetryManager { mSameApnRetryCount < MAX_SAME_APN_RETRY) { // If the modem explicitly suggests a retry delay, we should use it, even in fail fast // mode. log("Modem suggested retry in " + mModemSuggestedDelay + " ms."); return mModemSuggestedDelay; } Loading @@ -523,7 +524,10 @@ public class RetryManager { // If we've already cycled through all the APNs, that means all APNs have // permanently failed if (index == mCurrentApnIndex) return NO_RETRY; if (index == mCurrentApnIndex) { log("All APNs have permanently failed."); return NO_RETRY; } } long delay; Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +1 −3 Original line number Diff line number Diff line Loading @@ -568,9 +568,7 @@ public final class DataConnection extends StateMachine { // Get the completed message but only use it once Message connectionCompletedMsg = cp.mOnCompletedMsg; cp.mOnCompletedMsg = null; if (connectionCompletedMsg.obj instanceof ApnContext) { alreadySent = (ApnContext)connectionCompletedMsg.obj; } alreadySent = cp.mApnContext; long timeStamp = System.currentTimeMillis(); connectionCompletedMsg.arg1 = mCid; Loading
src/java/com/android/internal/telephony/dataconnection/DcTesterDeactivateAll.java +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ import com.android.internal.telephony.Phone; * adb shell am broadcast -a com.android.internal.telephony.dataconnection.action_deactivate_all */ public class DcTesterDeactivateAll { private static final String LOG_TAG = "DcTesterDeacativeAll"; private static final String LOG_TAG = "DcTesterDeacativateAll"; private static final boolean DBG = true; private Phone mPhone; Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +4 −1 Original line number Diff line number Diff line Loading @@ -2186,7 +2186,10 @@ public class DcTracker extends Handler { PendingIntent alarmIntent = PendingIntent.getBroadcast(mPhone.getContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); apnContext.setReconnectIntent(alarmIntent); mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, // Use the exact timer instead of the inexact one to provide better user experience. // In some extreme cases, we saw the retry was delayed for few minutes. mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + delay, alarmIntent); } Loading
src/java/com/android/internal/telephony/test/SimulatedCommands.java +23 −18 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ public class SimulatedCommands extends BaseCommands int mNextCallFailCause = CallFailCause.NORMAL_CLEARING; private boolean mDcSuccess = true; private DataCallResponse mDcResponse; //***** Constructor Loading Loading @@ -149,7 +150,7 @@ public class SimulatedCommands extends BaseCommands if(mIccCardStatus!=null) { resultSuccess(result, mIccCardStatus); } else { resultFail(result, new RuntimeException("IccCardStatus not set")); resultFail(result, null, new RuntimeException("IccCardStatus not set")); } } Loading Loading @@ -502,9 +503,8 @@ public class SimulatedCommands extends BaseCommands resultSuccess(result, simulatedCallState.getDriverCalls()); } else { //Rlog.i("GSM", "[SimCmds] getCurrentCalls: RADIO_OFF or SIM not ready!"); resultFail(result, new CommandException( CommandException.Error.RADIO_NOT_AVAILABLE)); resultFail(result, null, new CommandException(CommandException.Error.RADIO_NOT_AVAILABLE)); } } Loading Loading @@ -636,7 +636,7 @@ public class SimulatedCommands extends BaseCommands if (!success){ Rlog.i("GSM", "[SimCmd] hangupConnection: resultFail"); resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { Rlog.i("GSM", "[SimCmd] hangupConnection: resultSuccess"); resultSuccess(result, null); Loading @@ -658,7 +658,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('0', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -680,7 +680,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('1', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -702,7 +702,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('2', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -723,7 +723,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('3', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -744,7 +744,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('4', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -763,7 +763,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('2', ch); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -783,7 +783,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onAnswer(); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading @@ -802,7 +802,7 @@ public class SimulatedCommands extends BaseCommands success = simulatedCallState.onChld('0', '\0'); if (!success){ resultFail(result, new RuntimeException("Hangup Error")); resultFail(result, null, new RuntimeException("Hangup Error")); } else { resultSuccess(result, null); } Loading Loading @@ -1109,8 +1109,9 @@ public class SimulatedCommands extends BaseCommands unimplemented(response); } public void setDataCallResponse(final DataCallResponse dcResponse) { public void setDataCallResponse(final boolean success, final DataCallResponse dcResponse) { mDcResponse = dcResponse; mDcSuccess = success; } @Override Loading @@ -1136,7 +1137,11 @@ public class SimulatedCommands extends BaseCommands mDcResponse.pcscf = new String[]{}; } if (mDcSuccess) { resultSuccess(result, mDcResponse); } else { resultFail(result, mDcResponse, new RuntimeException("Setup data call failed!")); } } @Override Loading Loading @@ -1607,9 +1612,9 @@ public class SimulatedCommands extends BaseCommands } } private void resultFail(Message result, Throwable tr) { private void resultFail(Message result, Object ret, Throwable tr) { if (result != null) { AsyncResult.forMessage(result).exception = tr; AsyncResult.forMessage(result, ret, tr); if (mPausedResponseCount > 0) { mPausedResponses.add(result); } else { Loading Loading @@ -1892,7 +1897,7 @@ public class SimulatedCommands extends BaseCommands if(mIccIoResultForApduLogicalChannel!=null) { resultSuccess(response, mIccIoResultForApduLogicalChannel); }else { resultFail(response, new RuntimeException("IccIoResult not set")); resultFail(response, null, new RuntimeException("IccIoResult not set")); } } Loading