summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2010-03-12 09:35:43 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-03-12 09:35:43 -0800
commit7261128801d12e8f29b032fcacf26757a1bc606f (patch)
tree5a22a99acfd6a442a38312b63b9bb03484e8c910 /telephony
parente898bdfe85a9ddeaf63120e5539bc6e2155db989 (diff)
parent82c08459789e139aa94e8484e3e105b4f54f22a4 (diff)
downloadframeworks_base-7261128801d12e8f29b032fcacf26757a1bc606f.zip
frameworks_base-7261128801d12e8f29b032fcacf26757a1bc606f.tar.gz
frameworks_base-7261128801d12e8f29b032fcacf26757a1bc606f.tar.bz2
Merge "Make sure that pause dialing works even when screen is off."
Diffstat (limited to 'telephony')
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CdmaConnection.java32
1 files changed, 22 insertions, 10 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
index 08946d2..188145b 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java
@@ -592,8 +592,11 @@ public class CdmaConnection extends Connection {
if (!isIncoming) {
// outgoing calls only
processNextPostDialChar();
+ } else {
+ // Only release wake lock for incoming calls, for outgoing calls the wake lock
+ // will be released after any pause-dial is completed
+ releaseWakeLock();
}
- releaseWakeLock();
}
private void
@@ -688,6 +691,7 @@ public class CdmaConnection extends Connection {
Registrant postDialHandler;
if (postDialState == PostDialState.CANCELLED) {
+ releaseWakeLock();
//Log.v("CDMA", "##### processNextPostDialChar: postDialState == CANCELLED, bail");
return;
}
@@ -696,6 +700,9 @@ public class CdmaConnection extends Connection {
postDialString.length() <= nextPostDialChar) {
setPostDialState(PostDialState.COMPLETE);
+ // We were holding a wake lock until pause-dial was complete, so give it up now
+ releaseWakeLock();
+
// notifyMessage.arg1 is 0 on complete
c = 0;
} else {
@@ -770,19 +777,24 @@ public class CdmaConnection extends Connection {
}
/**
- * Set post dial state and acquire wake lock while switching to "started"
- * state, the wake lock will be released if state switches out of "started"
+ * Set post dial state and acquire wake lock while switching to "started" or "wait"
+ * state, the wake lock will be released if state switches out of "started" or "wait"
* state or after WAKE_LOCK_TIMEOUT_MILLIS.
* @param s new PostDialState
*/
private void setPostDialState(PostDialState s) {
- if (postDialState != PostDialState.STARTED
- && s == PostDialState.STARTED) {
- acquireWakeLock();
- Message msg = h.obtainMessage(EVENT_WAKE_LOCK_TIMEOUT);
- h.sendMessageDelayed(msg, WAKE_LOCK_TIMEOUT_MILLIS);
- } else if (postDialState == PostDialState.STARTED
- && s != PostDialState.STARTED) {
+ if (s == PostDialState.STARTED ||
+ s == PostDialState.PAUSE) {
+ synchronized (mPartialWakeLock) {
+ if (mPartialWakeLock.isHeld()) {
+ h.removeMessages(EVENT_WAKE_LOCK_TIMEOUT);
+ } else {
+ acquireWakeLock();
+ }
+ Message msg = h.obtainMessage(EVENT_WAKE_LOCK_TIMEOUT);
+ h.sendMessageDelayed(msg, WAKE_LOCK_TIMEOUT_MILLIS);
+ }
+ } else {
h.removeMessages(EVENT_WAKE_LOCK_TIMEOUT);
releaseWakeLock();
}