We will always have access to token + strings

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-12-30 23:56:45 +01:00
parent 1910c098d8
commit 08e4771d62
2 changed files with 0 additions and 14 deletions

View File

@ -30,7 +30,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@ -218,19 +217,11 @@ public class SwitchAccountController extends BaseController {
private void getAuthTokenForAccount(Account account) {
final AccountManager accMgr = AccountManager.get(getActivity());
final AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
.setTitle(getResources().getString(R.string.nc_server_import_account_plain))
.setMessage(getResources().getString(R.string.nc_server_import_account_notification))
.create();
alertDialog.show();
String authTokenType = getResources().getString(R.string.nc_import_account_type) + ".password";
final Handler handler = new Handler();
accMgr.getAuthToken(account, authTokenType, true,
future -> {
alertDialog.dismiss();
try {
ImportAccount importAccount = AccountUtils.getInformationFromAccount(account, future
@ -244,7 +235,6 @@ public class SwitchAccountController extends BaseController {
(bundleBuilder.build())).pushChangeHandler(new HorizontalChangeHandler())
.popChangeHandler(new HorizontalChangeHandler()));
} catch (OperationCanceledException e) {
alertDialog.dismiss();
Log.e(TAG, "Access was denied");
ErrorMessageHolder.getInstance().setMessageType(
ErrorMessageHolder.ErrorMessageType.FAILED_TO_IMPORT_ACCOUNT);
@ -255,7 +245,6 @@ public class SwitchAccountController extends BaseController {
}
});
} catch (Exception e) {
alertDialog.dismiss();
Log.e(TAG, "Something went wrong while accessing token");
ErrorMessageHolder.getInstance().setMessageType(
ErrorMessageHolder.ErrorMessageType.FAILED_TO_IMPORT_ACCOUNT);

View File

@ -6,7 +6,6 @@
<!-- Server selection -->
<string name="nc_server_url">Server address</string>
<string name="nc_server_url_prefix">Please enter http:// or https:// before the hostname</string>
<string name="nc_server_not_installed">Please finish your %1$s installation</string>
<string name="nc_server_db_upgrade_needed">Please upgrade your %1$s database</string>
<string name="nc_server_maintenance">Please bring your %1$s out of maintenance</string>
@ -17,8 +16,6 @@
<string name="nc_server_import_accounts">Import accounts from the %1$s app</string>
<string name="nc_server_failed_to_import_account">Failed to import selected account</string>
<string name="nc_Server_account_imported">Selected account is now imported and available</string>
<string name="nc_server_import_account_notification">Please grant access to the selected account in the
notification bar!"</string>
<string name="nc_get_from_provider">Do you not have a server yet?\nClick here to get one from a provider</string>
<!-- Account verification -->