playgameservices / android-basic-samples

Google Play game services - Android samples
Apache License 2.0
970 stars 972 forks source link

Screen orientation is broken when autorization fails #294

Open tscissors opened 4 years ago

tscissors commented 4 years ago

Hello!

I found issue with authorization to game services. When authorization is failed sensorLandscape orientation is not working - screen does not rotate at all. Issue not present when I am trying to sign in with DEFAULT_SIGN_IN option, only when I use DEFAULT_GAMES_SIGN_IN option.

Reproduction steps: 1) Create new android project. 2) Add dependency 'com.google.android.gms:play-services-auth:17.0.0' 3) Add android:screenOrientation="sensorLandscape" to activity in AndroidManifest 4) Configure sign in by using this or similar code:

    public void signIn() {
        GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
            .requestEmail()
            .build();

        GoogleSignInClient googleSignInClient = GoogleSignIn.getClient(this, gso);
        Intent intent = googleSignInClient.getSignInIntent();
        startActivityForResult(intent, RC_SIGN_IN);
    }

5) After starting of activity ensure that sensorLandscape is working (screen is rotating) 6) Try to sign in, very important part - authorization should fail. 7) Screen orientation is broken when autorization fails (screen is not rotating)

Same code but with DEFAULT_SIGN_IN instead of DEFAULT_GAMES_SIGN_IN is working perfectly, so that is why I think it is a bug.

Thank you. I hope it can be fixed in future releases.

prakhar-agarwall commented 3 years ago

I'd like to take up this issue!!