List of usage examples for android.telecom PhoneAccount CAPABILITY_SIM_SUBSCRIPTION
int CAPABILITY_SIM_SUBSCRIPTION
To view the source code for android.telecom PhoneAccount CAPABILITY_SIM_SUBSCRIPTION.
Click Source Link
From source file:Main.java
/** * Return a list of phone accounts that are subscription/SIM accounts. *//*from w w w . j a va 2 s .c om*/ public static List<PhoneAccountHandle> getSubscriptionPhoneAccounts(Context context) { final TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE); List<PhoneAccountHandle> subscriptionAccountHandles = new ArrayList<PhoneAccountHandle>(); List<PhoneAccountHandle> accountHandles = telecomManager.getCallCapablePhoneAccounts(); for (PhoneAccountHandle accountHandle : accountHandles) { PhoneAccount account = telecomManager.getPhoneAccount(accountHandle); if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { subscriptionAccountHandles.add(accountHandle); } } return subscriptionAccountHandles; }