Skip to content
Snippets Groups Projects
Commit 886074e5 authored by akwizgran's avatar akwizgran
Browse files

Code cleanup.

parent 52720c5c
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment