77import com .google .firebase .auth .AuthCredential ;
88import com .google .firebase .auth .EmailAuthProvider ;
99import com .google .firebase .auth .FirebaseAuth ;
10- import com .google .firebase .auth .FirebaseAuthRecentLoginRequiredException ;
1110import com .google .firebase .auth .FirebaseUser ;
1211import com .google .firebase .auth .UserProfileChangeRequest ;
1312
14- import java .util .Objects ;
15-
1613public class SJFirebaseUser {
1714
1815 public FirebaseUser get_current_user () {
1916 return FirebaseAuth .getInstance ().getCurrentUser ();
2017 }
2118
22- public void update_profile (String name , String photo_url , Object callback ) {
19+ public void update_profile (String name , String photo_url , OnCompleteListener < Void > callback ) {
2320 // [START update_profile]
2421 UserProfileChangeRequest .Builder profile_updates = new UserProfileChangeRequest .Builder ();
2522 UserProfileChangeRequest user_profile_change_request ;
@@ -35,24 +32,24 @@ public void update_profile(String name, String photo_url, Object callback) {
3532 }
3633
3734 get_current_user ().updateProfile (user_profile_change_request )
38- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
35+ .addOnCompleteListener (callback );
3936 // [END update_profile]
4037 }
4138
42- public void update_email (String email , Object callback ) {
39+ public void update_email (String email , OnCompleteListener < Void > callback ) {
4340 get_current_user ().updateEmail (email )
44- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
41+ .addOnCompleteListener (callback );
4542 }
4643
47- public void send_email_verification (Object callback ) {
44+ public void send_email_verification (OnCompleteListener < Void > callback ) {
4845 // [START send_email_verification]
4946 get_current_user ().sendEmailVerification ()
50- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
47+ .addOnCompleteListener (callback );
5148 // [END send_email_verification]
5249 }
5350
5451 public void send_email_verification_with_continue_url (
55- String app_package_name , String url , Object callback ) {
52+ String app_package_name , String url , OnCompleteListener < Void > callback ) {
5653 // [START send_email_verification_with_continue_url]
5754 ActionCodeSettings actionCodeSettings = ActionCodeSettings .newBuilder ()
5855 .setUrl (url )
@@ -62,27 +59,27 @@ public void send_email_verification_with_continue_url(
6259 .build ();
6360
6461 get_current_user ().sendEmailVerification (actionCodeSettings )
65- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
62+ .addOnCompleteListener (callback );
6663 }
6764
68- public void send_password_reset_email (String email , Object callback ) {
65+ public void send_password_reset_email (String email , OnCompleteListener < Void > callback ) {
6966 // [START send_password_reset]
7067 FirebaseAuth auth = FirebaseAuth .getInstance ();
7168
7269 auth .sendPasswordResetEmail (email )
73- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
70+ .addOnCompleteListener (callback );
7471 // [END send_password_reset]
7572 }
7673
77- public void deleteUser (Object callback ) {
74+ public void deleteUser (OnCompleteListener < Void > callback ) {
7875 // [START delete_user]
7976
8077 get_current_user ().delete ()
81- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
78+ .addOnCompleteListener (callback );
8279 // [END delete_user]
8380 }
8481
85- public void reauthenticate (String email , String password , Object callback ) {
82+ public void reauthenticate (String email , String password , OnCompleteListener < Void > callback ) {
8683 // [START reauthenticate]
8784
8885 // Get auth credentials from the user for re-authentication. The example below shows
@@ -93,7 +90,7 @@ public void reauthenticate(String email, String password, Object callback) {
9390
9491 // Prompt the user to re-provide their sign-in credentials
9592 get_current_user ().reauthenticate (credential )
96- .addOnCompleteListener (( OnCompleteListener < Void >) callback );
93+ .addOnCompleteListener (callback );
9794 // [END reauthenticate]
9895 }
9996}
0 commit comments