Merge "Fix NPE in getDisabledCapabilities()"
diff --git a/src/com/android/phone/vvm/omtp/OmtpVvmCarrierConfigHelper.java b/src/com/android/phone/vvm/omtp/OmtpVvmCarrierConfigHelper.java
index 0b321b5..c82012a 100644
--- a/src/com/android/phone/vvm/omtp/OmtpVvmCarrierConfigHelper.java
+++ b/src/com/android/phone/vvm/omtp/OmtpVvmCarrierConfigHelper.java
@@ -35,6 +35,7 @@
import com.android.phone.vvm.omtp.sms.StatusMessage;
import com.android.phone.vvm.omtp.utils.PhoneAccountHandleConverter;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Set;
/**
@@ -280,10 +281,14 @@
if (!bundle.containsKey(KEY_VVM_DISABLED_CAPABILITIES_STRING_ARRAY)) {
return null;
}
- ArraySet<String> result = new ArraySet<String>();
- result.addAll(
- Arrays.asList(bundle.getStringArray(KEY_VVM_DISABLED_CAPABILITIES_STRING_ARRAY)));
- return result;
+ String[] disabledCapabilities =
+ bundle.getStringArray(KEY_VVM_DISABLED_CAPABILITIES_STRING_ARRAY);
+ if (disabledCapabilities != null && disabledCapabilities.length > 0) {
+ ArraySet<String> result = new ArraySet<>();
+ Collections.addAll(result, disabledCapabilities);
+ return result;
+ }
+ return null;
}
public String getClientPrefix() {