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

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

Merge "Add permission check for eSIM country related APIs" into rvc-dev am:...

Merge "Add permission check for eSIM country related APIs" into rvc-dev am: 6034eb5a am: ffe610c4 am: bb1d1873

Change-Id: Icc1c0a1bae0d3ded2e246f42b062f93acd2626f1
parents fa19ecd7 bb1d1873
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -277,6 +277,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 {
@@ -297,6 +301,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) {
@@ -323,6 +331,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);