@@ -0,0 +1,1845 @@
+package org.dasfoo.rover.android.client.auth;%0A%0Aimport android.app.Activity;%0Aimport android.content.Intent;%0A%0Aimport org.dasfoo.rover.android.client.util.ResultCallback;%0A%0A/**%0A * Caching single credential manager.%0A */%0Apublic class PasswordManager %7B%0A    private final ResultCallback mResultCallback;%0A%0A    private String mPassword;%0A%0A    /**%0A     * Constructor for the PasswordManager. Does not try to fetch the password.%0A     * @param resultCallback used to launch new activities%0A     */%0A    public PasswordManager(final ResultCallback resultCallback) %7B%0A        mResultCallback = resultCallback;%0A    %7D%0A%0A    /**%0A     * Get password and start the listener.%0A     * @param listener callback when the password is available. Executed in the main thread%0A     */%0A    public void getPassword(final PasswordAvailableListener listener) %7B%0A        if (mPassword != null) %7B%0A            listener.handle(mPassword);%0A            return;%0A        %7D%0A        mResultCallback.startActivityWithResultHandler(GetRoverPasswordActivity.class,%0A                new ResultCallback.AbstractActivityResultListener() %7B%0A                    @Override%0A                    public void handle(final int resultCode, final Intent data) %7B%0A                        if (resultCode == Activity.RESULT_OK) %7B%0A                            listener.handle(data.getData().getAuthority());%0A                        %7D%0A                    %7D%0A                %7D);%0A    %7D%0A%0A    /**%0A     * Remove password from the cache.%0A     */%0A    public void forgetPassword() %7B%0A        mPassword = null;%0A    %7D%0A%0A    /**%0A     * An interface to listen for the password to be available.%0A     */%0A    public interface PasswordAvailableListener %7B%0A        /**%0A         * Called when a password is successfully fetched.%0A         * @param password a password that was fetched%0A         */%0A        void handle(String password);%0A    %7D%0A%7D%0A

Add PasswordManager