summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-01-20 20:34:05 -0800
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2013-01-20 20:34:05 -0800
commitb733419a74a3e26ec5af07535c5e29d8ee1f63b0 (patch)
treeb5b621523598188cbbe95f08721fa8c76f4a3aa1
parent4514f3fca9007919c3534778ac908236e233226f (diff)
parente7fb25c88c04251f0b9d10d2caa1b51b799b7196 (diff)
downloadframeworks_opt_telephony-b733419a74a3e26ec5af07535c5e29d8ee1f63b0.zip
frameworks_opt_telephony-b733419a74a3e26ec5af07535c5e29d8ee1f63b0.tar.gz
frameworks_opt_telephony-b733419a74a3e26ec5af07535c5e29d8ee1f63b0.tar.bz2
Merge "Telephony: Start DataStallAlarm only on Data CONNECTED state" into cm-10.1
-rw-r--r--src/java/com/android/internal/telephony/DataConnectionTracker.java50
1 files changed, 26 insertions, 24 deletions
diff --git a/src/java/com/android/internal/telephony/DataConnectionTracker.java b/src/java/com/android/internal/telephony/DataConnectionTracker.java
index a2980be..c390321 100644
--- a/src/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/src/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -1373,32 +1373,34 @@ public abstract class DataConnectionTracker extends Handler {
int nextAction = getRecoveryAction();
int delayInMs;
- // If screen is on or data stall is currently suspected, set the alarm
- // with an aggresive timeout.
- if (mIsScreenOn || suspectedStall || RecoveryAction.isAggressiveRecovery(nextAction)) {
- delayInMs = Settings.Global.getInt(mResolver,
- Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS,
- DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
- } else {
- delayInMs = Settings.Global.getInt(mResolver,
- Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS,
- DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
- }
+ if (getOverallState() == DctConstants.State.CONNECTED) {
+ // If screen is on or data stall is currently suspected, set the alarm
+ // with an aggresive timeout.
+ if (mIsScreenOn || suspectedStall || RecoveryAction.isAggressiveRecovery(nextAction)) {
+ delayInMs = Settings.Global.getInt(mResolver,
+ Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS,
+ DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
+ } else {
+ delayInMs = Settings.Global.getInt(mResolver,
+ Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS,
+ DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
+ }
- mDataStallAlarmTag += 1;
- if (VDBG) {
- log("startDataStallAlarm: tag=" + mDataStallAlarmTag +
- " delay=" + (delayInMs / 1000) + "s");
- }
- AlarmManager am =
- (AlarmManager) mPhone.getContext().getSystemService(Context.ALARM_SERVICE);
+ mDataStallAlarmTag += 1;
+ if (VDBG) {
+ log("startDataStallAlarm: tag=" + mDataStallAlarmTag +
+ " delay=" + (delayInMs / 1000) + "s");
+ }
+ AlarmManager am =
+ (AlarmManager) mPhone.getContext().getSystemService(Context.ALARM_SERVICE);
- Intent intent = new Intent(getActionIntentDataStallAlarm());
- intent.putExtra(DATA_STALL_ALARM_TAG_EXTRA, mDataStallAlarmTag);
- mDataStallAlarmIntent = PendingIntent.getBroadcast(mPhone.getContext(), 0, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
- am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
- SystemClock.elapsedRealtime() + delayInMs, mDataStallAlarmIntent);
+ Intent intent = new Intent(getActionIntentDataStallAlarm());
+ intent.putExtra(DATA_STALL_ALARM_TAG_EXTRA, mDataStallAlarmTag);
+ mDataStallAlarmIntent = PendingIntent.getBroadcast(mPhone.getContext(), 0, intent,
+ PendingIntent.FLAG_UPDATE_CURRENT);
+ am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+ SystemClock.elapsedRealtime() + delayInMs, mDataStallAlarmIntent);
+ }
}
protected void stopDataStallAlarm() {