We show the entry point on any device which supports eUICC as long as either the eUICC
+ * was ever provisioned (that is, at least one profile was ever downloaded onto it), or if
+ * the user has enabled development mode.
+ */
+ public static boolean showEuiccSettings(Context context) {
+ EuiccManager euiccManager =
+ (EuiccManager) context.getSystemService(Context.EUICC_SERVICE);
+ if (!euiccManager.isEnabled()) {
+ return false;
+ }
+
+ final ContentResolver cr = context.getContentResolver();
+
+ TelephonyManager tm =
+ (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+ String currentCountry = tm.getNetworkCountryIso().toLowerCase();
+ String supportedCountries =
+ Settings.Global.getString(cr, Settings.Global.EUICC_SUPPORTED_COUNTRIES);
+ boolean inEsimSupportedCountries = false;
+ if (TextUtils.isEmpty(currentCountry)) {
+ inEsimSupportedCountries = true;
+ } else if (!TextUtils.isEmpty(supportedCountries)) {
+ List