diff options
author | Hung-ying Tyan <tyanh@google.com> | 2011-06-30 18:05:39 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2011-06-30 18:17:27 +0800 |
commit | a6cec8feed5c135bb5f4d6193012d13258a067c4 (patch) | |
tree | 8dc11237996507354250976fadb32d390c3e5270 /voip | |
parent | 54fa6196b0058933a68cffde17b4413b098630d3 (diff) | |
download | frameworks_base-a6cec8feed5c135bb5f4d6193012d13258a067c4.zip frameworks_base-a6cec8feed5c135bb5f4d6193012d13258a067c4.tar.gz frameworks_base-a6cec8feed5c135bb5f4d6193012d13258a067c4.tar.bz2 |
Synchronize SipWakeupTimer.onReceive()
to fix the race of two threads that change mPendingIntent; one assigns a new one
and the other nullifies it.
Change-Id: I5e01f83ea1ac437811d2073839adef9bd0a30ec9
Diffstat (limited to 'voip')
-rw-r--r-- | voip/java/com/android/server/sip/SipWakeupTimer.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/voip/java/com/android/server/sip/SipWakeupTimer.java b/voip/java/com/android/server/sip/SipWakeupTimer.java index 76780c0..00d47ac 100644 --- a/voip/java/com/android/server/sip/SipWakeupTimer.java +++ b/voip/java/com/android/server/sip/SipWakeupTimer.java @@ -83,7 +83,7 @@ class SipWakeupTimer extends BroadcastReceiver { mEventQueue = null; } - private synchronized boolean stopped() { + private boolean stopped() { if (mEventQueue == null) { Log.w(TAG, "Timer stopped"); return true; @@ -233,7 +233,7 @@ class SipWakeupTimer extends BroadcastReceiver { } @Override - public void onReceive(Context context, Intent intent) { + public synchronized void onReceive(Context context, Intent intent) { // This callback is already protected by AlarmManager's wake lock. String action = intent.getAction(); if (getAction().equals(action) @@ -261,7 +261,7 @@ class SipWakeupTimer extends BroadcastReceiver { } } - private synchronized void execute(long triggerTime) { + private void execute(long triggerTime) { if (DEBUG_TIMER) Log.d(TAG, "time's up, triggerTime = " + showTime(triggerTime) + ": " + mEventQueue.size()); if (stopped() || mEventQueue.isEmpty()) return; |