diff options
| author | Anshul Jain <anshulj@codeaurora.org> | 2010-11-22 11:28:36 -0800 |
|---|---|---|
| committer | Anshul Jain <anshulj@codeaurora.org> | 2010-12-08 10:25:41 -0800 |
| commit | 60bb9c9a81bcd766d3e79f765ac22c7c38492409 (patch) | |
| tree | 5e7d67a5e3a67c6bc0ec7e4bae18bf0d35c9ff1d /telephony/java | |
| parent | 1d67fa5b110a1df21e408d450394fb62d5dc9a1e (diff) | |
| download | frameworks_base-60bb9c9a81bcd766d3e79f765ac22c7c38492409.zip frameworks_base-60bb9c9a81bcd766d3e79f765ac22c7c38492409.tar.gz frameworks_base-60bb9c9a81bcd766d3e79f765ac22c7c38492409.tar.bz2 | |
frameworks/base/telephony: Release wakelock on RIL request send error
Android telephony does not release the partial wakelock right away if
there is an error in sending the RIL request. The wake lock is released
only after EVENT_WAKE_LOCK_TIMEOUT occurs that prevents the phone to go
in power collpase. The change is to release the wake lock as soon as the
error in send is detected.
Also, change RIL#send not not send a request if there is no connection to
vendor RIL, as the request will always fail.
Change-Id: Ia39a4b9ac12f4064e301a65abfd26409d49babe1
Diffstat (limited to 'telephony/java')
| -rw-r--r-- | telephony/java/com/android/internal/telephony/RIL.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index 2f7aa21..af483db 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -360,6 +360,11 @@ public final class RIL extends BaseCommands implements CommandsInterface { rr.onError(GENERIC_FAILURE, null); rr.release(); } + } finally { + // Note: We are "Done" only if there are no outstanding + // requests or replies. Thus this code path will only release + // the wake lock on errors. + releaseWakeLockIfDone(); } if (!alreadySubtracted) { @@ -2044,6 +2049,12 @@ public final class RIL extends BaseCommands implements CommandsInterface { send(RILRequest rr) { Message msg; + if (mSocket == null) { + rr.onError(RADIO_NOT_AVAILABLE, null); + rr.release(); + return; + } + msg = mSender.obtainMessage(EVENT_SEND, rr); acquireWakeLock(); |
