Merge "Fix system service crash on radio session death. DO NOT MERGE" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
af229217da
@@ -233,18 +233,24 @@ class RadioModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void fanoutAidlCallbackLocked(AidlCallbackRunnable runnable) {
|
private void fanoutAidlCallbackLocked(AidlCallbackRunnable runnable) {
|
||||||
|
List<TunerSession> deadSessions = null;
|
||||||
for (TunerSession tunerSession : mAidlTunerSessions) {
|
for (TunerSession tunerSession : mAidlTunerSessions) {
|
||||||
try {
|
try {
|
||||||
runnable.run(tunerSession.mCallback);
|
runnable.run(tunerSession.mCallback);
|
||||||
} catch (DeadObjectException ex) {
|
} catch (DeadObjectException ex) {
|
||||||
// The other side died without calling close(), so just purge it from our
|
// The other side died without calling close(), so just purge it from our records.
|
||||||
// records.
|
|
||||||
Slog.e(TAG, "Removing dead TunerSession");
|
Slog.e(TAG, "Removing dead TunerSession");
|
||||||
mAidlTunerSessions.remove(tunerSession);
|
if (deadSessions == null) {
|
||||||
|
deadSessions = new ArrayList<>();
|
||||||
|
}
|
||||||
|
deadSessions.add(tunerSession);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
Slog.e(TAG, "Failed to invoke ITunerCallback: ", ex);
|
Slog.e(TAG, "Failed to invoke ITunerCallback: ", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (deadSessions != null) {
|
||||||
|
mAidlTunerSessions.removeAll(deadSessions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public android.hardware.radio.ICloseHandle addAnnouncementListener(@NonNull int[] enabledTypes,
|
public android.hardware.radio.ICloseHandle addAnnouncementListener(@NonNull int[] enabledTypes,
|
||||||
|
|||||||
Reference in New Issue
Block a user