diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-23 18:07:46 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-23 18:07:46 +0000 |
commit | 651d758b594202ab62704462b48910445a381b17 (patch) | |
tree | 49503a536fcf5597cc53927a7f63926de5869037 /java/com/android/dialer/location/CountryDetector.java | |
parent | 0f06aaa50871aff47d733aace635021f4f2ef2ca (diff) | |
parent | 3ed0c281a143789ea8187dba60dba6c6b5db9009 (diff) |
Update Dialer to v10 RC39
am: 3ed0c281a1
Change-Id: Ibcd2bd797d09d8d5cbc490fb1779db37ec5069e7
Diffstat (limited to 'java/com/android/dialer/location/CountryDetector.java')
-rw-r--r-- | java/com/android/dialer/location/CountryDetector.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/java/com/android/dialer/location/CountryDetector.java b/java/com/android/dialer/location/CountryDetector.java index fd93b6ae9..a90febf2b 100644 --- a/java/com/android/dialer/location/CountryDetector.java +++ b/java/com/android/dialer/location/CountryDetector.java @@ -28,6 +28,7 @@ import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; +import android.support.v4.os.UserManagerCompat; import android.telephony.TelephonyManager; import android.text.TextUtils; import com.android.dialer.common.Assert; @@ -159,8 +160,11 @@ public class CountryDetector { } /** @return the geocoded country code detected by the {@link LocationManager}. */ + @Nullable private String getLocationBasedCountryIso() { - if (!Geocoder.isPresent() || !PermissionsUtil.hasLocationPermissions(appContext)) { + if (!Geocoder.isPresent() + || !PermissionsUtil.hasLocationPermissions(appContext) + || !UserManagerCompat.isUserUnlocked(appContext)) { return null; } return PreferenceManager.getDefaultSharedPreferences(appContext) |