Skip to content

Commit 7f7474d

Browse files
Wink SavilleAndroid Code Review
authored andcommitted
Merge "frameworks/base/telephony: Release wakelock on RIL request send error"
2 parents 2b858ca + 60bb9c9 commit 7f7474d

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)