app/src/main/java/fr/free/nrw/commons/auth/SessionManager.java
public void createAccount(@Nullable AccountAuthenticatorResponse response,
                              String username, String password) {

        Account account = new Account(username, BuildConfig.ACCOUNT_TYPE);
        boolean created = accountManager().addAccountExplicitly(account, password, null);

        Timber.d("account creation " + (created ? "successful" : "failure"));

        if (created) {
            if (response != null) {
                Bundle bundle = new Bundle();
                bundle.putString(KEY_ACCOUNT_NAME, username);
                bundle.putString(KEY_ACCOUNT_TYPE, BuildConfig.ACCOUNT_TYPE);


                response.onResult(bundle);
            }

        } else {
            if (response != null) {
                response.onError(ERROR_CODE_REMOTE_EXCEPTION, "");
            }
            Timber.d("account creation failure");
        }

        // FIXME: If the user turns it off, it shouldn't be auto turned back on
        ContentResolver.setSyncAutomatically(account, BuildConfig.CONTRIBUTION_AUTHORITY, true); // Enable sync by default!
        ContentResolver.setSyncAutomatically(account, BuildConfig.MODIFICATION_AUTHORITY, true); // Enable sync by default!
    }
/**
     * Creata a new account
     *
     * @param response
     * @param username
     * @param password
     */
Creata a new account
@param response
@param username
@param password
Creata a new account @param response @param username @param password
public void createAccount(@Nullable AccountAuthenticatorResponse response,
                              String username, String password) {
        Account account = new Account(username, BuildConfig.ACCOUNT_TYPE);
        boolean created = accountManager().addAccountExplicitly(account, password, null);
        Timber.d("account creation " + (created ? "successful" : "failure"));
        if (created) {
            if (response != null) {
                Bundle bundle = new Bundle();
                bundle.putString(KEY_ACCOUNT_NAME, username);
                bundle.putString(KEY_ACCOUNT_TYPE, BuildConfig.ACCOUNT_TYPE);
                response.onResult(bundle);
            }
        } else {
            if (response != null) {
                response.onError(ERROR_CODE_REMOTE_EXCEPTION, "");
            }
            Timber.d("account creation failure");
        }
        ContentResolver.setSyncAutomatically(account, BuildConfig.CONTRIBUTION_AUTHORITY, true); 
        ContentResolver.setSyncAutomatically(account, BuildConfig.MODIFICATION_AUTHORITY, true); 
    }
public void createAccount ( @ Nullable AccountAuthenticatorResponse response , String username , String password ) { Account account = new Account ( username , BuildConfig . ACCOUNT_TYPE ) ; boolean created = accountManager ( ) . addAccountExplicitly ( account , password , null ) ; Timber . d ( "account creation " + ( created ? "successful" : "failure" ) ) ; if ( created ) { if ( response != null ) { Bundle bundle = new Bundle ( ) ; bundle . putString ( KEY_ACCOUNT_NAME , username ) ; bundle . putString ( KEY_ACCOUNT_TYPE , BuildConfig . ACCOUNT_TYPE ) ; response . onResult ( bundle ) ; } } else { if ( response != null ) { response . onError ( ERROR_CODE_REMOTE_EXCEPTION , "" ) ; } Timber . d ( "account creation failure" ) ; } ContentResolver . setSyncAutomatically ( account , BuildConfig . CONTRIBUTION_AUTHORITY , true ) ; ContentResolver . setSyncAutomatically ( account , BuildConfig . MODIFICATION_AUTHORITY , true ) ; }
Creata a new account
 @param response
 @param username
 @param password
Creata a new account @param response @param username @param password
// FIXME: If the user turns it off, it shouldn't be auto turned back on // Enable sync by default! // Enable sync by default!