Merge "SipService: release wake lock for cancelled tasks."
Bug: 3327004 Change-Id: Ice47f973b5f2969f26eaa83a3e4795b2e153ba8b
This commit is contained in:
@@ -1055,7 +1055,10 @@ public final class SipService extends ISipService.Stub {
|
|||||||
// we want to skip the interim ones) but deliver bad news
|
// we want to skip the interim ones) but deliver bad news
|
||||||
// immediately
|
// immediately
|
||||||
if (connected) {
|
if (connected) {
|
||||||
if (mTask != null) mTask.cancel();
|
if (mTask != null) {
|
||||||
|
mTask.cancel();
|
||||||
|
mMyWakeLock.release(mTask);
|
||||||
|
}
|
||||||
mTask = new MyTimerTask(type, connected);
|
mTask = new MyTimerTask(type, connected);
|
||||||
mTimer.schedule(mTask, 2 * 1000L);
|
mTimer.schedule(mTask, 2 * 1000L);
|
||||||
// hold wakup lock so that we can finish changes before the
|
// 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) {
|
if (mTask != this) {
|
||||||
Log.w(TAG, " unexpected task: " + mNetworkType
|
Log.w(TAG, " unexpected task: " + mNetworkType
|
||||||
+ (mConnected ? " CONNECTED" : "DISCONNECTED"));
|
+ (mConnected ? " CONNECTED" : "DISCONNECTED"));
|
||||||
|
mMyWakeLock.release(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mTask = null;
|
mTask = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user