Fix exception when creating a remote connection
Change-Id: Ib55b2bc3ca8c6f3703bda9751b16064cd6c01d23
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index b3467a6..00fc362 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -263,9 +263,11 @@
private Phone getPhoneForAccount(PhoneAccountHandle accountHandle) {
if (Objects.equals(mExpectedComponentName, accountHandle.getComponentName())) {
- int phoneId = SubscriptionController.getInstance().getPhoneId(
- Long.parseLong(accountHandle.getId()));
- return PhoneFactory.getPhone(phoneId);
+ if (accountHandle.getId() != null) {
+ int phoneId = SubscriptionController.getInstance().getPhoneId(
+ Long.parseLong(accountHandle.getId()));
+ return PhoneFactory.getPhone(phoneId);
+ }
}
return null;
}