mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
Improve custom handling
This commit is contained in:
parent
9ea45c74a7
commit
1ea6607186
8 changed files with 12 additions and 74 deletions
|
@ -94,14 +94,7 @@ public class AccountAuthenticator extends AbstractAccountAuthenticator {
|
|||
return e.getFailureBundle();
|
||||
}
|
||||
|
||||
Intent intent;
|
||||
if (!mContext.getResources().getBoolean(R.bool.push_enabled) &&
|
||||
!mContext.getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
} else {
|
||||
intent = new Intent(mContext, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
|
||||
intent.putExtra(KEY_AUTH_TOKEN_TYPE, authTokenType);
|
||||
intent.putExtra(KEY_REQUIRED_FEATURES, requiredFeatures);
|
||||
|
@ -145,14 +138,7 @@ public class AccountAuthenticator extends AbstractAccountAuthenticator {
|
|||
return e.getFailureBundle();
|
||||
}
|
||||
|
||||
Intent intent;
|
||||
if (!mContext.getResources().getBoolean(R.bool.push_enabled)
|
||||
&& !mContext.getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
} else {
|
||||
intent = new Intent(mContext, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
|
||||
Intent intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,
|
||||
response);
|
||||
intent.putExtra(KEY_ACCOUNT, account);
|
||||
|
@ -203,13 +189,7 @@ public class AccountAuthenticator extends AbstractAccountAuthenticator {
|
|||
}
|
||||
|
||||
/// if not stored, return Intent to access the AuthenticatorActivity and UPDATE the token for the account
|
||||
Intent intent;
|
||||
if (!mContext.getResources().getBoolean(R.bool.push_enabled)
|
||||
&& !mContext.getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
} else {
|
||||
intent = new Intent(mContext, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
Intent intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
|
||||
intent.putExtra(KEY_AUTH_TOKEN_TYPE, authTokenType);
|
||||
intent.putExtra(KEY_LOGIN_OPTIONS, options);
|
||||
|
@ -240,13 +220,7 @@ public class AccountAuthenticator extends AbstractAccountAuthenticator {
|
|||
Account account, String authTokenType, Bundle options)
|
||||
throws NetworkErrorException {
|
||||
|
||||
Intent intent;
|
||||
if (!mContext.getResources().getBoolean(R.bool.push_enabled) &&
|
||||
!mContext.getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
} else {
|
||||
intent = new Intent(mContext, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
Intent intent = new Intent(mContext, AuthenticatorActivity.class);
|
||||
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
|
||||
intent.putExtra(KEY_ACCOUNT, account);
|
||||
intent.putExtra(KEY_AUTH_TOKEN_TYPE, authTokenType);
|
||||
|
|
|
@ -41,7 +41,6 @@ import android.util.Pair;
|
|||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.authentication.ModifiedAuthenticatorActivity;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.lib.common.OwnCloudAccount;
|
||||
|
@ -580,14 +579,7 @@ public class FileDownloader extends Service
|
|||
if (needsToUpdateCredentials) {
|
||||
|
||||
// let the user update credentials with one click
|
||||
Intent updateAccountCredentials;
|
||||
if (!getResources().getBoolean(R.bool.push_enabled)
|
||||
&& !getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
} else {
|
||||
updateAccountCredentials = new Intent(this, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
|
||||
Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT,
|
||||
download.getAccount());
|
||||
updateAccountCredentials.putExtra(
|
||||
|
|
|
@ -48,7 +48,6 @@ import android.util.Pair;
|
|||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.authentication.ModifiedAuthenticatorActivity;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
|
||||
|
@ -1082,13 +1081,7 @@ public class FileUploader extends Service
|
|||
if (needsToUpdateCredentials) {
|
||||
// let the user update credentials with one click
|
||||
// let the user update credentials with one click
|
||||
Intent updateAccountCredentials;
|
||||
if (!getResources().getBoolean(R.bool.push_enabled)
|
||||
&& !getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
} else {
|
||||
updateAccountCredentials = new Intent(this, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
updateAccountCredentials.putExtra(
|
||||
AuthenticatorActivity.EXTRA_ACCOUNT, upload.getAccount()
|
||||
);
|
||||
|
|
|
@ -37,7 +37,6 @@ import android.support.v4.app.NotificationCompat;
|
|||
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.authentication.ModifiedAuthenticatorActivity;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
|
@ -401,14 +400,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
|
|||
if (needsToUpdateCredentials) {
|
||||
// let the user update credentials with one click
|
||||
// let the user update credentials with one click
|
||||
Intent updateAccountCredentials;
|
||||
if (!getContext().getResources().getBoolean(R.bool.push_enabled)
|
||||
&& !getContext().getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
updateAccountCredentials = new Intent(getContext(), AuthenticatorActivity.class);
|
||||
} else {
|
||||
updateAccountCredentials = new Intent(getContext(), ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
|
||||
Intent updateAccountCredentials = new Intent(getContext(), AuthenticatorActivity.class);
|
||||
updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, getAccount());
|
||||
updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION,
|
||||
AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN);
|
||||
|
|
|
@ -40,7 +40,6 @@ import com.owncloud.android.MainApp;
|
|||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.authentication.ModifiedAuthenticatorActivity;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.ui.helpers.FileOperationsHelper;
|
||||
import com.owncloud.android.files.services.FileDownloader;
|
||||
|
@ -397,13 +396,7 @@ public abstract class FileActivity extends DrawerActivity
|
|||
}
|
||||
|
||||
/// step 2 - request credentials to user
|
||||
Intent updateAccountCredentials;
|
||||
if (!getResources().getBoolean(R.bool.push_enabled) &&
|
||||
!getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
} else {
|
||||
updateAccountCredentials = new Intent(this, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, account);
|
||||
updateAccountCredentials.putExtra(
|
||||
AuthenticatorActivity.EXTRA_ACTION,
|
||||
|
|
|
@ -48,7 +48,6 @@ import android.widget.TextView;
|
|||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.authentication.ModifiedAuthenticatorActivity;
|
||||
import com.owncloud.android.lib.common.UserInfo;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
|
@ -286,14 +285,7 @@ public class UserInfoActivity extends FileActivity {
|
|||
|
||||
private void changeAccountPassword(Account account) {
|
||||
// let the user update credentials with one click
|
||||
Intent updateAccountCredentials;
|
||||
if (!getResources().getBoolean(R.bool.push_enabled) &&
|
||||
!getResources().getBoolean(R.bool.analytics_enabled)) {
|
||||
updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
} else {
|
||||
updateAccountCredentials = new Intent(this, ModifiedAuthenticatorActivity.class);
|
||||
}
|
||||
|
||||
Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
|
||||
updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, account);
|
||||
updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION,
|
||||
AuthenticatorActivity.ACTION_UPDATE_TOKEN);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.owncloud.android.authentication;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.utils.GooglePlayUtils;
|
||||
|
||||
|
@ -29,6 +30,7 @@ public class ModifiedAuthenticatorActivity extends AuthenticatorActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Log.d("MARIO", "HERE");
|
||||
GooglePlayUtils.checkPlayServices(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
|
||||
<!-- analytics enabled -->
|
||||
<bool name="analytics_enabled">false</bool>
|
||||
<bool name="push_enabled">true</bool>
|
||||
<bool name="push_enabled">false</bool>
|
||||
|
||||
<!-- Files becomes Home -->
|
||||
<bool name="use_home">true</bool>
|
||||
|
|
Loading…
Reference in a new issue