Skip to content

Commit 60bb9c9

Browse files
committed
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
1 parent 1d67fa5 commit 60bb9c9

File tree

1 file changed

+11
-0
lines changed
  • telephony/java/com/android/internal/telephony

1 file changed

+11
-0
lines changed

telephony/java/com/android/internal/telephony/RIL.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ public RILSender(Looper looper) {
360360
rr.onError(GENERIC_FAILURE, null);
361361
rr.release();
362362
}
363+
} finally {
364+
// Note: We are "Done" only if there are no outstanding
365+
// requests or replies. Thus this code path will only release
366+
// the wake lock on errors.
367+
releaseWakeLockIfDone();
363368
}
364369

365370
if (!alreadySubtracted) {
@@ -2044,6 +2049,12 @@ private void switchToRadioState(RadioState newState) {
20442049
send(RILRequest rr) {
20452050
Message msg;
20462051

2052+
if (mSocket == null) {
2053+
rr.onError(RADIO_NOT_AVAILABLE, null);
2054+
rr.release();
2055+
return;
2056+
}
2057+
20472058
msg = mSender.obtainMessage(EVENT_SEND, rr);
20482059

20492060
acquireWakeLock();

0 commit comments

Comments
 (0)