Code cleanup.

This commit is contained in:
akwizgran
2015-12-16 15:55:50 +00:00
parent 52720c5c04
commit 886074e50e
2 changed files with 9 additions and 13 deletions

View File

@@ -186,7 +186,7 @@ OnEditorActionListener {
strengthMeter.setStrength(strength);
if (nicknameLength > MAX_AUTHOR_NAME_LENGTH)
nicknameEntry.setError(getString(R.string.name_too_long));
if (firstPassword.length() > 0 && strength < PasswordStrengthEstimator.WEAK)
if (firstPassword.length() > 0 && strength < WEAK)
passwordEntry.setError(getString(R.string.password_too_weak));
if (secondPassword.length() > 0 && !passwordsMatch)
passwordConfirmation.setError(getString(R.string.passwords_do_not_match));

View File

@@ -1,12 +1,5 @@
package org.briarproject.system;
import static android.content.Context.TELEPHONY_SERVICE;
import java.util.Locale;
import java.util.logging.Logger;
import org.briarproject.api.system.LocationUtils;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
@@ -15,6 +8,13 @@ import android.text.TextUtils;
import com.google.inject.Inject;
import org.briarproject.api.system.LocationUtils;
import java.util.Locale;
import java.util.logging.Logger;
import static android.content.Context.TELEPHONY_SERVICE;
class AndroidLocationUtils implements LocationUtils {
private static final Logger LOG =
@@ -40,7 +40,7 @@ class AndroidLocationUtils implements LocationUtils {
* </ul>
*
* Note: this is very similar to <a href="https://android.googlesource.com/platform/frameworks/base/+/cd92588%5E/location/java/android/location/CountryDetector.java">
* this API</a> except it seems that Google doesn't want us to useit for
* this API</a> except it seems that Google doesn't want us to use it for
* some reason - both that class and {@code Context.COUNTRY_CODE} are
* annotated {@code @hide}.
*/
@@ -48,10 +48,6 @@ class AndroidLocationUtils implements LocationUtils {
public String getCurrentCountry() {
String countryCode = getCountryFromPhoneNetwork();
if (!TextUtils.isEmpty(countryCode)) return countryCode.toUpperCase();
// Disabled because it involves a network call; requires
// ACCESS_FINE_LOCATION
// countryCode = getCountryFromLocation();
// if (!TextUtils.isEmpty(countryCode)) return countryCode;
LOG.info("Falling back to SIM card country");
countryCode = getCountryFromSimCard();
if (!TextUtils.isEmpty(countryCode)) return countryCode.toUpperCase();