From: David A. Velasco Date: Wed, 22 Apr 2015 09:01:52 +0000 (+0200) Subject: Merge pull request #957 from owncloud/fix_crash_invalid_server_url X-Git-Tag: test~29 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/2fcffbd3d580f41ecc114248f4d74a19a34b622b?ds=inline;hp=-c Merge pull request #957 from owncloud/fix_crash_invalid_server_url Fix crash when typed invalid URL --- 2fcffbd3d580f41ecc114248f4d74a19a34b622b diff --combined src/com/owncloud/android/authentication/AuthenticatorActivity.java index f245900b,ccb0f854..713851ba --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@@ -380,7 -380,7 +380,7 @@@ public class AuthenticatorActivity exte findViewById(R.id.hostUrlFrame).setVisibility(View.GONE); mRefreshButton = findViewById(R.id.centeredRefreshButton); } - showRefreshButton(mServerIsChecked && !mServerIsValid && + showRefreshButton(mServerIsChecked && !mServerIsValid && mWaitingForOpId > Integer.MAX_VALUE); mServerStatusView = (TextView) findViewById(R.id.server_status_text); showServerStatus(); @@@ -773,10 -773,11 +773,11 @@@ mOkButton.setEnabled(false); mServerInfo = new GetServerInfoOperation.ServerInfo(); showRefreshButton(false); - + if (uri.length() != 0) { // Handle internationalized domain names uri = DisplayUtils.convertIdn(uri, true); + mServerStatusText = R.string.auth_testing_connection; mServerStatusIcon = R.drawable.progress_small; showServerStatus(); @@@ -1119,9 -1120,13 +1120,9 @@@ // TODO remove, if possible private String trimUrlWebdav(String url){ - if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0)){ - url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0.length()); - } else if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_2_0)){ - url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_2_0.length()); - } else if (url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_1_2)){ - url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_1_2.length()); - } + if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0_AND_LATER)){ + url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0_AND_LATER.length()); + } return (url != null ? url : ""); } @@@ -1483,13 -1488,6 +1484,13 @@@ ); } + // include account version with the new account + mAccountMgr.setUserData( + mAccount, + Constants.KEY_OC_ACCOUNT_VERSION, + Integer.toString(AccountUtils.ACCOUNT_VERSION) + ); + /// add the new account as default in preferences, if there is none already Account defaultAccount = AccountUtils.getCurrentOwnCloudAccount(this); if (defaultAccount == null) {