diff options
author | danielwbhuang <danielwbhuang@google.com> | 2021-07-02 17:41:05 +0800 |
---|---|---|
committer | danielwbhuang <danielwbhuang@google.com> | 2021-07-02 17:41:05 +0800 |
commit | 2259ae3d601c030c3371066c45c4627eafdb5ab4 (patch) | |
tree | a02088ca955f2ab31aad58fdc2c40f57b1d80bde | |
parent | 567060e5e1eb2d2044ed37341c067d41d96ee02e (diff) | |
download | ImsServiceEntitlement-2259ae3d601c030c3371066c45c4627eafdb5ab4.tar.gz |
[Fixed] NumberFormatException: For input string: "Optional[-1]"android12-dev
1. getVersion() is Optional<String> and it needs to be converted to String.
2. Version should not be empty and it isn't suitable to use default value in here, so we directly use Optional.get().
3. NoSuchElementException will tell us that rawXml missed "Version".
Test: manual
Bug: 192577104
Change-Id: I43494d7a2c3c1346a9cc01a78b1e005fb4e82764
-rw-r--r-- | src/com/android/imsserviceentitlement/entitlement/EntitlementConfiguration.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/imsserviceentitlement/entitlement/EntitlementConfiguration.java b/src/com/android/imsserviceentitlement/entitlement/EntitlementConfiguration.java index ce18d86..c2c8abb 100644 --- a/src/com/android/imsserviceentitlement/entitlement/EntitlementConfiguration.java +++ b/src/com/android/imsserviceentitlement/entitlement/EntitlementConfiguration.java @@ -229,7 +229,7 @@ public class EntitlementConfiguration { String rawXml = "<wap-provisioningdoc version=\"1.1\">" + " <characteristic type=\"VERS\">" - + " <parm name=\"version\" value=\"" + getVersion() + "\"/>" + + " <parm name=\"version\" value=\"" + getVersion().get() + "\"/>" + " <parm name=\"validity\" value=\"" + getVersValidity() + "\"/>" + " </characteristic>" + " <characteristic type=\"TOKEN\">" |