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

Commit a6be5277 authored by Jiashen Wang's avatar Jiashen Wang Committed by Automerger Merge Worker
Browse files

Merge "Add permission check for eSIM country related APIs" am: c539301f

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1345658

Change-Id: I71c46e07aaea8af355925c34b31b65f63670ba55
parents a9401d2b c539301f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -276,6 +276,10 @@ public class EuiccController extends IEuiccController.Stub {
     */
    @Override
    public void setSupportedCountries(boolean isSupported, @NonNull List<String> countriesList) {
        if (!callerCanWriteEmbeddedSubscriptions()) {
            throw new SecurityException(
                    "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to set supported countries");
        }
        if (isSupported) {
            mSupportedCountries = countriesList;
        } else {
@@ -296,6 +300,10 @@ public class EuiccController extends IEuiccController.Stub {
    @Override
    @NonNull
    public List<String> getSupportedCountries(boolean isSupported) {
        if (!callerCanWriteEmbeddedSubscriptions()) {
            throw new SecurityException(
                    "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to get supported countries");
        }
        if (isSupported && mSupportedCountries != null) {
            return mSupportedCountries;
        } else if (!isSupported && mUnsupportedCountries != null) {
@@ -322,6 +330,10 @@ public class EuiccController extends IEuiccController.Stub {
     */
    @Override
    public boolean isSupportedCountry(@NonNull String countryIso) {
        if (!callerCanWriteEmbeddedSubscriptions()) {
            throw new SecurityException(
                    "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to check if the country is supported");
        }
        if (mSupportedCountries == null || mSupportedCountries.isEmpty()) {
            Log.i(TAG, "Using blacklist unsupportedCountries=" + mUnsupportedCountries);
            return !isEsimUnsupportedCountry(countryIso);