I'm currently working on a android app where i have to allow a user to register with a profile picture, i'm able to register the user with fields like username,email and the photo. The problem arises when i try to log back in with the same user i just created which gave me the error below....

Permission Denial: opening provider com.google.android.apps.docs.storagebackend.StorageBackendContentProvider from ProcessRecord .................requires that you obtain access using ACTION\_OPEN\_DOCUMENT or related APIs

Below is my code for creating the user 

```
mAuth.createUserWithEmailAndPassword(email, password)
            .addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()) {

                        FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();

                        UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
                                .setDisplayName(uname).setPhotoUri(ImgUri).build();

                        user.updateProfile(profileUpdates);
                        Toast.makeText(getApplicationContext(), "Registration successful!", Toast.LENGTH_LONG).show();
                        progressBar.setVisibility(View.GONE);
                        Intent intent = new Intent(RegisterActivity.this, Login.class);
                        startActivity(intent);
                        finish();
                    }
                    else {
                        Toast.makeText(getApplicationContext(), "Registration failed! Please try again later", Toast.LENGTH_LONG).show();
                        progressBar.setVisibility(View.GONE);
                    }
                }
            });

```

Here's my code for picking the image 

```
private void chooseImage() {
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {

        ImgUri = data.getData();
        System.out.println(ImgUri);

        try {
            Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), ImgUri);
            // Log.d(TAG, String.valueOf(bitmap));

            ImageView imageView = findViewById(R.id.userImg);
            imageView.setImageBitmap(bitmap);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

```

And Below is my code when i'm trying to retrieve the user profile Picture

```
  FirebaseUser user = mAuth.getCurrentUser();
    System.out.println(user.getPhotoUrl());
    img.setImageURI(user.getPhotoUrl());

```

Am i required to save the ImageUri to Firebase Storage as well as Firebase Realtime Database? Or are there any permissions required ? Am i required