diff options
Diffstat (limited to 'java/com/android/dialer/assisteddialing/ConcreteCreator.java')
-rw-r--r-- | java/com/android/dialer/assisteddialing/ConcreteCreator.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/java/com/android/dialer/assisteddialing/ConcreteCreator.java b/java/com/android/dialer/assisteddialing/ConcreteCreator.java index 806764567..1563b3513 100644 --- a/java/com/android/dialer/assisteddialing/ConcreteCreator.java +++ b/java/com/android/dialer/assisteddialing/ConcreteCreator.java @@ -86,9 +86,7 @@ public final class ConcreteCreator { return new AssistedDialingMediatorStub(); } - Constraints constraints = - new Constraints( - context, configProvider.getString("assisted_dialing_csv_country_codes", "")); + Constraints constraints = new Constraints(context, getCountryCodeProvider(configProvider)); return new AssistedDialingMediatorImpl( new LocationDetector( telephonyManager, @@ -108,4 +106,16 @@ public final class ConcreteCreator { && Build.VERSION.SDK_INT <= BUILD_CODE_CEILING) && configProvider.getBoolean("assisted_dialing_enabled", false); } + + /** + * Returns a CountryCodeProvider responsible for providing countries eligible for assisted Dialing + */ + public static CountryCodeProvider getCountryCodeProvider(ConfigProvider configProvider) { + if (configProvider == null) { + LogUtil.i("ConcreteCreator.getCountryCodeProvider", "provided configProvider was null"); + throw new NullPointerException("Provided configProvider was null"); + } + + return new CountryCodeProvider(configProvider); + } } |