Merge "Keep lock while binding the storage service" into rvc-dev am: cdde51eae7 am: 8ddeead67a am: 9e70944e5b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11712602 Change-Id: Idea07b37511677cda0a13d24842bc8a37a682a9a
This commit is contained in:
@@ -413,20 +413,18 @@ public final class StorageUserConnection {
|
||||
resetUserSessions();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Slog.i(TAG, "Binding to the ExternalStorageService for user " + mUserId);
|
||||
if (mContext.bindServiceAsUser(new Intent().setComponent(name), mServiceConnection,
|
||||
Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT,
|
||||
UserHandle.of(mUserId))) {
|
||||
Slog.i(TAG, "Bound to the ExternalStorageService for user " + mUserId);
|
||||
return mLatch;
|
||||
} else {
|
||||
synchronized (mLock) {
|
||||
Slog.i(TAG, "Binding to the ExternalStorageService for user " + mUserId);
|
||||
if (mContext.bindServiceAsUser(new Intent().setComponent(name), mServiceConnection,
|
||||
Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT,
|
||||
UserHandle.of(mUserId))) {
|
||||
Slog.i(TAG, "Bound to the ExternalStorageService for user " + mUserId);
|
||||
return mLatch;
|
||||
} else {
|
||||
mIsConnecting = false;
|
||||
throw new ExternalStorageServiceException(
|
||||
"Failed to bind to the ExternalStorageService for user " + mUserId);
|
||||
}
|
||||
throw new ExternalStorageServiceException(
|
||||
"Failed to bind to the ExternalStorageService for user " + mUserId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user