Merge "Dispose of TransportClient in BMS#beginRestoreSession" into sc-v2-dev

This commit is contained in:
Ruslan Tkhakokhov
2021-12-07 20:07:41 +00:00
committed by Android (Google) Code Review

View File

@@ -4068,14 +4068,20 @@ public class UserBackupManagerService {
} }
int operationType; int operationType;
TransportClient transportClient = null;
try { try {
operationType = getOperationTypeFromTransport( transportClient = mTransportManager.getTransportClientOrThrow(
mTransportManager.getTransportClientOrThrow(transport, /* caller */ transport, /* caller */"BMS.beginRestoreSession");
"BMS.beginRestoreSession")); operationType = getOperationTypeFromTransport(transportClient);
} catch (TransportNotAvailableException | TransportNotRegisteredException } catch (TransportNotAvailableException | TransportNotRegisteredException
| RemoteException e) { | RemoteException e) {
Slog.w(TAG, "Failed to get operation type from transport: " + e); Slog.w(TAG, "Failed to get operation type from transport: " + e);
return null; return null;
} finally {
if (transportClient != null) {
mTransportManager.disposeOfTransportClient(transportClient,
/* caller */"BMS.beginRestoreSession");
}
} }
synchronized (this) { synchronized (this) {