Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 756f7e3a authored by Chiachang Wang's avatar Chiachang Wang Committed by Automerger Merge Worker
Browse files

Use location mcc to load the array config resource am: 65ba4e7b

Change-Id: I9571c5283204dcfd516bd8b6657909a0d0568201
parents ba7823a5 65ba4e7b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1608,7 +1608,8 @@ public class NetworkMonitor extends StateMachine {
                settingProviderUrls = new URL[0];
            }

            return getArrayConfig(settingProviderUrls, R.array.config_captive_portal_fallback_urls,
            return getProbeUrlArrayConfig(settingProviderUrls,
                    R.array.config_captive_portal_fallback_urls,
                    R.array.default_captive_portal_fallback_urls, this::makeURL);
        } catch (Exception e) {
            // Don't let a misconfiguration bootloop the system.
@@ -1627,7 +1628,8 @@ public class NetworkMonitor extends StateMachine {
                    ? emptySpecs
                    : parseCaptivePortalProbeSpecs(settingsValue).toArray(emptySpecs);

            return getArrayConfig(providerValue, R.array.config_captive_portal_fallback_probe_specs,
            return getProbeUrlArrayConfig(providerValue,
                    R.array.config_captive_portal_fallback_probe_specs,
                    R.array.default_captive_portal_fallback_probe_specs,
                    CaptivePortalProbeSpec::parseSpecOrNull);
        } catch (Exception e) {
@@ -1674,9 +1676,9 @@ public class NetworkMonitor extends StateMachine {
     * @param resourceConverter Converter from the resource strings to stored setting class. Null
     *                          return values are ignored.
     */
    private <T> T[] getArrayConfig(@NonNull T[] providerValue, @ArrayRes int configResId,
    private <T> T[] getProbeUrlArrayConfig(@NonNull T[] providerValue, @ArrayRes int configResId,
            @ArrayRes int defaultResId, @NonNull Function<String, T> resourceConverter) {
        final Resources res = mContext.getResources();
        final Resources res = getContextByMccIfNoSimCardOrDefault().getResources();
        String[] configValue = res.getStringArray(configResId);

        if (configValue.length == 0) {