Fix pull request requested changes

# Conflicts:
#	src/com/owncloud/android/authentication/AuthenticatorActivity.java
#	src/com/owncloud/android/utils/ErrorMessageAdapter.java
This commit is contained in:
davigonz 2016-12-30 13:25:33 +01:00 committed by AndyScherzinger
parent 501181d9a2
commit 72aff4c622
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 15 additions and 52 deletions

View file

@ -1546,9 +1546,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
} }
private void updateStatusIconFailUserName(int statusText){ private void updateFailedAuthStatusIconAndText(int failedStatusText){
mAuthStatusIcon = R.drawable.ic_alert; mAuthStatusIcon = R.drawable.ic_alert;
mAuthStatusText = statusText; mAuthStatusText = failedStatusText;
} }
private void updateServerStatusIconNoRegularAuth() { private void updateServerStatusIconNoRegularAuth() {

View file

@ -266,18 +266,15 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
// the thread may die before, an exception will occur, and the message will be left on the screen // the thread may die before, an exception will occur, and the message will be left on the screen
// until the app dies // until the app dies
// Edited: this toast message has no sense. If operation is being passed as null to getErrorCauseMessage(), Toast.makeText(
// the returned message is always null and therefore an empty toast is shown. Pending to review and change/delete getContext().getApplicationContext(),
ErrorMessageAdapter.getErrorCauseMessage(
// Toast.makeText( result,
// getContext().getApplicationContext(), null,
// ErrorMessageAdapter.getErrorCauseMessage( getContext().getResources()
// result, ),
// null, Toast.LENGTH_SHORT
// getContext().getResources() ).show();
// ),
// Toast.LENGTH_SHORT
// ).show();
} }
}); });
} }

View file

@ -85,9 +85,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) { } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server); message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { } else {
message = String.format( message = String.format(
res.getString(R.string.uploader_upload_failed_content_single), res.getString(R.string.uploader_upload_failed_content_single),
@ -106,9 +103,6 @@ public class ErrorMessageAdapter {
if (result.getCode() == ResultCode.FILE_NOT_FOUND) { if (result.getCode() == ResultCode.FILE_NOT_FOUND) {
message = res.getString(R.string.downloader_download_file_not_found); message = res.getString(R.string.downloader_download_file_not_found);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { } else {
message = String.format( message = String.format(
res.getString(R.string.downloader_download_failed_content), new File( res.getString(R.string.downloader_download_failed_content), new File(
@ -126,9 +120,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions), message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.forbidden_permissions_delete)); res.getString(R.string.forbidden_permissions_delete));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { } else {
message = res.getString(R.string.remove_fail_msg); message = res.getString(R.string.remove_fail_msg);
} }
@ -149,9 +140,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) { } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server); message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { } else {
message = res.getString(R.string.rename_server_fail_msg); message = res.getString(R.string.rename_server_fail_msg);
} }
@ -172,9 +160,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) { } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server); message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { } else {
message = res.getString(R.string.create_dir_fail_msg); message = res.getString(R.string.create_dir_fail_msg);
} }
@ -193,9 +178,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions), message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.share_link_forbidden_permissions)); res.getString(R.string.share_link_forbidden_permissions));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error } else { // Generic error
// Show a Message, operation finished without success // Show a Message, operation finished without success
message = res.getString(R.string.share_link_file_error); message = res.getString(R.string.share_link_file_error);
@ -214,9 +196,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions), message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.unshare_link_forbidden_permissions)); res.getString(R.string.unshare_link_forbidden_permissions));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error } else { // Generic error
// Show a Message, operation finished without success // Show a Message, operation finished without success
message = res.getString(R.string.unshare_link_file_error); message = res.getString(R.string.unshare_link_file_error);
@ -236,9 +215,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions), message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.update_link_forbidden_permissions)); res.getString(R.string.update_link_forbidden_permissions));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error } else { // Generic error
// Show a Message, operation finished without success // Show a Message, operation finished without success
message = res.getString(R.string.update_link_file_error); message = res.getString(R.string.update_link_file_error);
@ -261,9 +237,6 @@ public class ErrorMessageAdapter {
} else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) { } else if (result.getCode() == ResultCode.INVALID_CHARACTER_DETECT_IN_SERVER) {
message = res.getString(R.string.filename_forbidden_charaters_from_server); message = res.getString(R.string.filename_forbidden_charaters_from_server);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error } else { // Generic error
// Show a Message, operation finished without success // Show a Message, operation finished without success
message = res.getString(R.string.move_file_error); message = res.getString(R.string.move_file_error);
@ -278,9 +251,6 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.sync_current_folder_was_removed), message = String.format(res.getString(R.string.sync_current_folder_was_removed),
folderPathName); folderPathName);
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error } else { // Generic error
// Show a Message, operation finished without success // Show a Message, operation finished without success
message = String.format(res.getString(R.string.sync_folder_failed_content), message = String.format(res.getString(R.string.sync_folder_failed_content),
@ -302,17 +272,10 @@ public class ErrorMessageAdapter {
message = String.format(res.getString(R.string.forbidden_permissions), message = String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.forbidden_permissions_copy)); res.getString(R.string.forbidden_permissions_copy));
} else if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
} else { // Generic error } else { // Generic error
// Show a Message, operation finished without success // Show a Message, operation finished without success
message = res.getString(R.string.copy_file_error); message = res.getString(R.string.copy_file_error);
} }
} else if (operation instanceof GetSharesForFileOperation) {
if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
message = res.getString(R.string.maintenance_mode);
}
} }
return message; return message;
@ -350,6 +313,9 @@ public class ErrorMessageAdapter {
return code == ResultCode.WRONG_CONNECTION || return code == ResultCode.WRONG_CONNECTION ||
code == ResultCode.TIMEOUT || code == ResultCode.TIMEOUT ||
code == ResultCode.HOST_NOT_AVAILABLE || code == ResultCode.HOST_NOT_AVAILABLE ||
code == ResultCode.MAINTENANCE_MODE; code == ResultCode.MAINTENANCE_MODE) {
return true;
} else
return false;
} }
} }