Fix to read Tethering APN data terminated by empty parameters correctly

If Tethering APN data is terminated by empty parameters(",,,"), the
tethering APN data is not read correctly from configuration file.

Because second argument of split() is not set in ApnSetting.java, these
empty parameters are ignored and an error occurs during parameter length
check later.

To fix this, second argument of split() should be set as "-1".

Bug: 112876857
Test: manual - Checked that Tethering APN data could be read correctly.
Change-Id: I18be0131287dc927334d51522f1c816da83d4add
This commit is contained in:
Saki Oomori
2018-06-21 12:12:19 +09:00
committed by Masaya Nemoto
parent fc38791616
commit bf7d22f3cd

View File

@@ -810,7 +810,7 @@ public class ApnSetting implements Parcelable {
version = 1;
}
String[] a = data.split("\\s*,\\s*");
String[] a = data.split("\\s*,\\s*", -1);
if (a.length < 14) {
return null;
}