Using the examples in firebase own docs its simple to update the displayname
of a user
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
.setDisplayName("Jane Q. User")
.setPhotoUri(Uri.parse("https://example.com/jane-q-user/profile.jpg"))
.build();
However, I would like to know how to enforce unique displaynames. I have seen other solutions that seem to re-implement the user as a node in the database Firebase android : make username unique but this seems like a lot of extra work, surely there is a way to enforce the uniqueness of data within the Firebase user object created at authentication.