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: Ia6b17e12db534a4d7bad5477590f74b36bb168e8
This commit is contained in:
@@ -413,20 +413,18 @@ 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,
|
||||||
Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT,
|
Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT,
|
||||||
UserHandle.of(mUserId))) {
|
UserHandle.of(mUserId))) {
|
||||||
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(
|
||||||
|
"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