use of android.telecom.PhoneAccountHandle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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.PhoneAccountHandle in project android_frameworks_base by ResurrectionRemix.
the class Telecom method runRegisterSimPhoneAccount.
private void runRegisterSimPhoneAccount() throws RemoteException {
final PhoneAccountHandle handle = getPhoneAccountHandleFromArgs();
final String label = nextArgRequired();
final String address = nextArgRequired();
PhoneAccount account = PhoneAccount.builder(handle, label).setAddress(Uri.parse(address)).setSubscriptionAddress(Uri.parse(address)).setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION).setShortDescription(label).addSupportedUriScheme(PhoneAccount.SCHEME_TEL).addSupportedUriScheme(PhoneAccount.SCHEME_VOICEMAIL).build();
mTelecomService.registerPhoneAccount(account);
System.out.println("Success - " + handle + " registered.");
}
use of android.telecom.PhoneAccountHandle in project android_frameworks_base by ResurrectionRemix.
the class Telecom method runUnregisterPhoneAccount.
private void runUnregisterPhoneAccount() throws RemoteException {
final PhoneAccountHandle handle = getPhoneAccountHandleFromArgs();
mTelecomService.unregisterPhoneAccount(handle);
System.out.println("Success - " + handle + " unregistered.");
}
use of android.telecom.PhoneAccountHandle in project android_frameworks_base by crdroidandroid.
the class Telecom method runRegisterSimPhoneAccount.
private void runRegisterSimPhoneAccount() throws RemoteException {
final PhoneAccountHandle handle = getPhoneAccountHandleFromArgs();
final String label = nextArgRequired();
final String address = nextArgRequired();
PhoneAccount account = PhoneAccount.builder(handle, label).setAddress(Uri.parse(address)).setSubscriptionAddress(Uri.parse(address)).setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION).setShortDescription(label).addSupportedUriScheme(PhoneAccount.SCHEME_TEL).addSupportedUriScheme(PhoneAccount.SCHEME_VOICEMAIL).build();
mTelecomService.registerPhoneAccount(account);
System.out.println("Success - " + handle + " registered.");
}
use of android.telecom.PhoneAccountHandle in project android_frameworks_base by crdroidandroid.
the class Telecom method runRegisterPhoneAccount.
private void runRegisterPhoneAccount() throws RemoteException {
final PhoneAccountHandle handle = getPhoneAccountHandleFromArgs();
final String label = nextArgRequired();
PhoneAccount account = PhoneAccount.builder(handle, label).setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER).build();
mTelecomService.registerPhoneAccount(account);
System.out.println("Success - " + handle + " registered.");
}
Aggregations