Merge "SipService: release wake lock for cancelled tasks."

Bug: 3327004
Change-Id: Ice47f973b5f2969f26eaa83a3e4795b2e153ba8b
This commit is contained in:
Hung-ying Tyan
2011-01-06 13:03:30 +08:00
parent 9d0577ec0c
commit 40f2cacbc9

View File

@@ -1055,7 +1055,10 @@ public final class SipService extends ISipService.Stub {
// we want to skip the interim ones) but deliver bad news
// immediately
if (connected) {
if (mTask != null) mTask.cancel();
if (mTask != null) {
mTask.cancel();
mMyWakeLock.release(mTask);
}
mTask = new MyTimerTask(type, connected);
mTimer.schedule(mTask, 2 * 1000L);
// hold wakup lock so that we can finish changes before the
@@ -1096,6 +1099,7 @@ public final class SipService extends ISipService.Stub {
if (mTask != this) {
Log.w(TAG, " unexpected task: " + mNetworkType
+ (mConnected ? " CONNECTED" : "DISCONNECTED"));
mMyWakeLock.release(this);
return;
}
mTask = null;