package epson.print.storage.onedrive;

import com.epson.iprint.storage.StorageSignInActivity;
import com.onedrive.sdk.extensions.IOneDriveClient;

public class OneDriveSignInActivity extends StorageSignInActivity {
    protected static final String TAG = "OneDriveSignInActivity";
    private boolean mAuthActivityStarted;

    public StorageSignInActivity.BasicSignIn getBasicSignIn() {
        return null;
    }

    protected void onResume() {
        super.onResume();
        if (!mAuthActivityStarted) {
            OneDriveAuthenticator.getOneDriveClient(this, new OneDriveAuthenticator.OnOneDriveAuthenticatorListener() {
                public void onNotifyOneDriveClient(IOneDriveClient iOneDriveClient) {
                    if (iOneDriveClient != null) {
                        OneDriveSignInActivity.this.finish();
                    } else {
                        OneDriveSignInActivity.this.showLoginErrorAndFinish();
                    }
                }
            });
            mAuthActivityStarted = true;
            return;
        }
        finish();
    }
}
