use of android.telecom.TelecomManager in project platform_packages_apps_Settings by BlissRoms.
the class SimDialogActivity method setUserSelectedOutgoingPhoneAccount.
private void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle phoneAccount) {
final TelecomManager telecomManager = TelecomManager.from(this);
telecomManager.setUserSelectedOutgoingPhoneAccount(phoneAccount);
}
use of android.telecom.TelecomManager in project platform_packages_apps_Settings by BlissRoms.
the class SimDialogActivity method subscriptionIdToPhoneAccountHandle.
private PhoneAccountHandle subscriptionIdToPhoneAccountHandle(final int subId) {
final TelecomManager telecomManager = TelecomManager.from(this);
final TelephonyManager telephonyManager = TelephonyManager.from(this);
final Iterator<PhoneAccountHandle> phoneAccounts = telecomManager.getCallCapablePhoneAccounts().listIterator();
while (phoneAccounts.hasNext()) {
final PhoneAccountHandle phoneAccountHandle = phoneAccounts.next();
final PhoneAccount phoneAccount = telecomManager.getPhoneAccount(phoneAccountHandle);
if (subId == telephonyManager.getSubIdForPhoneAccount(phoneAccount)) {
return phoneAccountHandle;
}
}
return null;
}
use of android.telecom.TelecomManager in project packages_apps_Contacts by AOKP.
the class DelCallLogAdapter method getAccountIcon.
private Drawable getAccountIcon(Context context, PhoneAccountHandle accountHandle) {
TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
final PhoneAccount account;
if (telecomManager.getCallCapablePhoneAccounts().size() <= 1) {
account = null;
} else {
account = telecomManager.getPhoneAccount(accountHandle);
}
if (account == null) {
return null;
} else {
return account.getIcon().loadDrawable(context);
}
}
use of android.telecom.TelecomManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SimSettings method updateCallValues.
private void updateCallValues() {
final Preference simPref = findPreference(KEY_CALLS);
final TelecomManager telecomManager = TelecomManager.from(mContext);
final PhoneAccountHandle phoneAccount = telecomManager.getUserSelectedOutgoingPhoneAccount();
final List<PhoneAccountHandle> allPhoneAccounts = telecomManager.getCallCapablePhoneAccounts();
simPref.setTitle(R.string.calls_title);
simPref.setSummary(phoneAccount == null ? mContext.getResources().getString(R.string.sim_calls_ask_first_prefs_title) : (String) telecomManager.getPhoneAccount(phoneAccount).getLabel());
simPref.setEnabled(allPhoneAccounts.size() > 1);
}
use of android.telecom.TelecomManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SimDialogActivity method subscriptionIdToPhoneAccountHandle.
private PhoneAccountHandle subscriptionIdToPhoneAccountHandle(final int subId) {
final TelecomManager telecomManager = getSystemService(TelecomManager.class);
final TelephonyManager telephonyManager = getSystemService(TelephonyManager.class);
for (PhoneAccountHandle handle : telecomManager.getCallCapablePhoneAccounts()) {
final PhoneAccount phoneAccount = telecomManager.getPhoneAccount(handle);
if (subId == telephonyManager.getSubIdForPhoneAccount(phoneAccount)) {
return handle;
}
}
return null;
}
Aggregations