Fix NPE caused by Change I4df27119.
This change caused Music APP to throw an NPE the fix
is to test that scheme is not null before using it.
Bug: 3092886
Change-Id: Ib29f944cbd9a9ff628462bdd6f4b68a308468536
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 7242803..de8e3f4 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -5268,10 +5268,15 @@
}
first = false;
b.append("dat=");
- if (mData.getScheme().equalsIgnoreCase("tel")) {
- b.append("tel:xxx-xxx-xxxx");
- } else if (mData.getScheme().equalsIgnoreCase("smsto")) {
- b.append("smsto:xxx-xxx-xxxx");
+ String scheme = mData.getScheme();
+ if (scheme != null) {
+ if (scheme.equalsIgnoreCase("tel")) {
+ b.append("tel:xxx-xxx-xxxx");
+ } else if (scheme.equalsIgnoreCase("smsto")) {
+ b.append("smsto:xxx-xxx-xxxx");
+ } else {
+ b.append(mData);
+ }
} else {
b.append(mData);
}