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

Commit 23623200 authored by Geoffrey Boullanger's avatar Geoffrey Boullanger
Browse files

Added method to the telephony network finder to look for countries by MCC

New data added in: https://r.android.com/3326205
See more details: go/mcc-table-mainline

Bug: 376493245
Test: manually checked that the device boots normally
Test: atest
Flag: com.android.icu.telephony_lookup_mcc_extension

Change-Id: I8bb2a6d188c2fa374bca6a52f7ca880d260f31eb
parent be290cc7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ aconfig_declarations_group {
        "framework-jobscheduler-job.flags-aconfig-java",
        "framework_graphics_flags_java_lib",
        "hwui_flags_java_lib",
        "icu_exported_aconfig_flags_lib",
        "interaction_jank_monitor_flags_lib",
        "keystore2_flags_java-framework",
        "libcore_exported_aconfig_flags_lib",
@@ -163,6 +164,14 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// ICU
java_aconfig_library {
    name: "icu_exported_aconfig_flags_lib",
    aconfig_declarations: "icu_aconfig_flags",
    mode: "exported",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Camera
java_aconfig_library {
    name: "camera_platform_flags_core_java_lib",
+16 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ package android.timezone;
import android.annotation.NonNull;
import android.annotation.Nullable;

import com.android.i18n.timezone.MobileCountries;
import com.android.icu.Flags;

import java.util.Objects;

/**
@@ -50,4 +53,17 @@ public final class TelephonyNetworkFinder {
        return telephonyNetworkDelegate != null
                ? new TelephonyNetwork(telephonyNetworkDelegate) : null;
    }

    /**
     * Returns the countries where a given MCC is in use.
     */
    @Nullable
    public MobileCountries findCountriesByMcc(@NonNull String mcc) {
        Objects.requireNonNull(mcc);

        if (!Flags.telephonyLookupMccExtension()) {
            return null;
        }
        return mDelegate.findCountriesByMcc(mcc);
    }
}