Add test for Ussd Parser
Behavior of xml reader was changed.
- xml renew.
- add testcase.
Bug: 132216780
Test: atest CarrierXmlParserTest
Change-Id: I8688147d1c94a382c2761eb77e29c7a06162ff4a
diff --git a/src/com/android/phone/CarrierXmlParser.java b/src/com/android/phone/CarrierXmlParser.java
index 4cf7e35..18602c9 100644
--- a/src/com/android/phone/CarrierXmlParser.java
+++ b/src/com/android/phone/CarrierXmlParser.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.content.res.XmlResourceParser;
+import android.support.annotation.VisibleForTesting;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -95,7 +96,9 @@
private static final String ATTR_DEFINITION_KEY = "definition";
HashMap<String, SsFeature> mFeatureMaps;
- private static String sParserFormat = "";
+
+ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
+ static String sParserFormat = "";
// TAG_ENTRY_NUMBER and TAG_ENTRY_TIME is xml's entry value.
// This is mapping user's input value. For example: number,time ...
@@ -155,6 +158,8 @@
mParserStr.add("");
}
}
+ } else {
+ Log.d(LOG_TAG, "no match");
}
}