Skip storage sessions for users without ExternalStorageService
When a volume is mounted, StorageSessionController currently attempts to bind to the ExternalStorageService to create a storage session. If a user does not provide an ExternalStorageService (ie. does not have com.android.providers.media.module installed), binding to the service and creating the session for that user fails, an ExternalStorageServiceException is thrown and StorageManagerService resets. After the reset, it retries mounting volumes for each user, so ExternalStorageServiceException is thrown repeatedly, and android.intent.action.MEDIA_MOUNTED is broadcast for users where mounting succeeds repeatedly. With this change, mounting emulated volumes is skipped if the target user does not provide an ExternalStorageService, skipping creating the FUSE volume and the attempt to bind to the ExternalStorageService to create a storage session. Bug: 188080785 Test: Create profile without com.android.providers.media.module, verify volume ignored for profile, no ExternalStorageServiceException thrown, android.intent.action.MEDIA_MOUNTED not repeatedly broadcast. Verify no change if package is installed in user. Test: atest AdoptableHostTest Change-Id: Iaedef3e49655bc5456e6149b634cddc875668fc8
Loading
Please register or sign in to comment