Fix conflicts from #1366 fixing lint issues (#1470)

* lint issue #171 - added Locale.getDefault()

* lint issue #171 - added Locale.getDefault()

* lint issue #171 - added %d

* lint issue #171 - Changed version

* lint issue #171 - added singleLine="true"

* lint issue #171 - changed commit to apply

* lint issue #171 - added Locale.getDefault()

* lint issue #171 - added Locale.getDefault()

* Codacy issues #778 - nested if loop

* Codacy issues #778 - nested if loop

* Revert "lint issue #171 - added %d" since we dont edit translated string files

This reverts commit e4917cddcf.
This commit is contained in:
neslihanturan 2018-04-30 14:05:47 +03:00 committed by GitHub
parent f80311d9f6
commit 3c2cc26d3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 15 deletions

View file

@ -29,6 +29,7 @@ import android.widget.EditText;
import android.widget.TextView;
import java.io.IOException;
import java.util.Locale;
import javax.inject.Inject;
import javax.inject.Named;
@ -267,18 +268,18 @@ public class LoginActivity extends AccountAuthenticatorActivity {
if (result.equals("NetworkFailure")) {
// Matches NetworkFailure which is created by the doInBackground method
showMessageAndCancelDialog(R.string.login_failed_network);
} else if (result.toLowerCase().contains("nosuchuser".toLowerCase()) || result.toLowerCase().contains("noname".toLowerCase())) {
} else if (result.toLowerCase(Locale.getDefault()).contains("nosuchuser".toLowerCase()) || result.toLowerCase().contains("noname".toLowerCase())) {
// Matches nosuchuser, nosuchusershort, noname
showMessageAndCancelDialog(R.string.login_failed_username);
emptySensitiveEditFields();
} else if (result.toLowerCase().contains("wrongpassword".toLowerCase())) {
} else if (result.toLowerCase(Locale.getDefault()).contains("wrongpassword".toLowerCase())) {
// Matches wrongpassword, wrongpasswordempty
showMessageAndCancelDialog(R.string.login_failed_password);
emptySensitiveEditFields();
} else if (result.toLowerCase().contains("throttle".toLowerCase())) {
} else if (result.toLowerCase(Locale.getDefault()).contains("throttle".toLowerCase())) {
// Matches unknown throttle error codes
showMessageAndCancelDialog(R.string.login_failed_throttled);
} else if (result.toLowerCase().contains("userblocked".toLowerCase())) {
} else if (result.toLowerCase(Locale.getDefault()).contains("userblocked".toLowerCase())) {
// Matches login-userblocked
showMessageAndCancelDialog(R.string.login_failed_blocked);
} else if (result.equals("2FA")) {