setAllowedCarriers: throw NPE on null list
The NPE will be caught by the TelephonyManager API to show
an error log.
Bug: 35374455
Test: make
Change-Id: I6f11baac029016e76a32a72a0589b786473c76b8
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index d66f219..520f388 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3560,6 +3560,9 @@
public int setAllowedCarriers(int slotId, List<CarrierIdentifier> carriers) {
enforceModifyPermission();
int subId = SubscriptionManager.getSubId(slotId)[0];
+ if (carriers == null) {
+ throw new NullPointerException("carriers cannot be null");
+ }
int[] retVal = (int[]) sendRequest(CMD_SET_ALLOWED_CARRIERS, carriers, subId);
return retVal[0];
}