Merge "Keep lock while binding the storage service" into rvc-dev am: cdde51eae7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11712602

Change-Id: I86fd68c6452c4317d14f52f6ec67d894eb722da1
This commit is contained in:
Corina Grigoras
2020-06-08 14:32:01 +00:00
committed by Automerger Merge Worker

View File

@@ -413,7 +413,6 @@ public final class StorageUserConnection {
resetUserSessions(); resetUserSessions();
} }
}; };
}
Slog.i(TAG, "Binding to the ExternalStorageService for user " + mUserId); Slog.i(TAG, "Binding to the ExternalStorageService for user " + mUserId);
if (mContext.bindServiceAsUser(new Intent().setComponent(name), mServiceConnection, if (mContext.bindServiceAsUser(new Intent().setComponent(name), mServiceConnection,
@@ -422,14 +421,13 @@ public final class StorageUserConnection {
Slog.i(TAG, "Bound to the ExternalStorageService for user " + mUserId); Slog.i(TAG, "Bound to the ExternalStorageService for user " + mUserId);
return mLatch; return mLatch;
} else { } else {
synchronized (mLock) {
mIsConnecting = false; mIsConnecting = false;
}
throw new ExternalStorageServiceException( throw new ExternalStorageServiceException(
"Failed to bind to the ExternalStorageService for user " + mUserId); "Failed to bind to the ExternalStorageService for user " + mUserId);
} }
} }
} }
}
private static final class Session { private static final class Session {
public final String sessionId; public final String sessionId;