Check for all invalid IDs when sim changes.
Previously was only checking for the particular value of an invalid
subscription ID, but any value <0 is an invalid id, so instead, should
use method "isValidSubscriptionId".
Bug: 20553659
Change-Id: I107d868ee4b8145a3c4d070b92ef68d40b9286da
diff --git a/src/com/android/phone/vvm/omtp/SimChangeReceiver.java b/src/com/android/phone/vvm/omtp/SimChangeReceiver.java
index e607d60..ec8e45e 100644
--- a/src/com/android/phone/vvm/omtp/SimChangeReceiver.java
+++ b/src/com/android/phone/vvm/omtp/SimChangeReceiver.java
@@ -65,8 +65,8 @@
private void handleCarrierConfigChange(Context context, Intent intent) {
int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
- if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
- Log.w(TAG, "subscriptionId not provided in intent.");
+ if (!SubscriptionManager.isValidSubscriptionId(subId)) {
+ Log.w(TAG, "Invalid subscriptionId or subscriptionId not provided in intent.");
return;
}