package com.epson.iprint.storage.onedrive;

import com.epson.iprint.storage.StorageSignInActivity;
import com.epson.iprint.storage.onedrive.OneDriveAuthenticator;
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 (!this.mAuthActivityStarted) {
            OneDriveAuthenticator.getOneDriveClient(this, new OneDriveAuthenticator.OnOneDriveAuthenticatorListener() {
                public void onNotifyOneDriveClient(IOneDriveClient iOneDriveClient) {
                    if (iOneDriveClient != null) {
                        OneDriveSignInActivity.this.finish();
                    } else {
                        OneDriveSignInActivity.this.showLoginErrorAndFinish();
                    }
                }
            });
            this.mAuthActivityStarted = true;
            return;
        }
        finish();
    }
}
