Modify DetectAuthenticationMethodOperation so that , when returning its result through the callback, there is no crash if AuthenticatorActivity is not ready (rotating)

This commit is contained in:
masensio 2014-03-28 15:04:10 +01:00
parent 2812120456
commit 2628eceb6b
2 changed files with 27 additions and 2 deletions

View file

@ -537,6 +537,27 @@ SsoWebViewClientListener, OnSslUntrustedCertListener {
}
}
@Override
protected void onStart() {
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler);
}
super.onStart();
}
@Override
protected void onStop() {
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.removeOperationListener(this);
}
super.onStop();
}
/**
* The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and
* deferred in {@link #onNewIntent(Intent)}, is processed here.

View file

@ -150,22 +150,26 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
@Override
protected void onStart() {
super.onStart();
if (mAccountWasSet) {
onAccountSet(mAccountWasRestored);
}
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
}
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
if (mOperationsServiceBinder != null) {
mOperationsServiceBinder.removeOperationListener(this);
}
super.onStop();
}