Suppress expected exception due to missing network_watchlist.xml
Test: NULL Bug:73264037 Change-Id: I640ad865fe85191f7d9e5fe887be10884c7bb801
This commit is contained in:
@@ -107,6 +107,10 @@ class WatchlistConfig {
|
||||
* Reload watchlist by reading config file.
|
||||
*/
|
||||
public void reloadConfig() {
|
||||
if (!mXmlFile.exists()) {
|
||||
// No config file
|
||||
return;
|
||||
}
|
||||
try (FileInputStream stream = new FileInputStream(mXmlFile)){
|
||||
final List<byte[]> crc32DomainList = new ArrayList<>();
|
||||
final List<byte[]> sha256DomainList = new ArrayList<>();
|
||||
|
||||
@@ -87,6 +87,10 @@ class WatchlistSettings {
|
||||
}
|
||||
|
||||
public void reloadSettings() {
|
||||
if (!mXmlFile.exists()) {
|
||||
// No settings config
|
||||
return;
|
||||
}
|
||||
try (FileInputStream stream = mXmlFile.openRead()){
|
||||
XmlPullParser parser = Xml.newPullParser();
|
||||
parser.setInput(stream, StandardCharsets.UTF_8.name());
|
||||
@@ -97,7 +101,7 @@ class WatchlistSettings {
|
||||
mPrivacySecretKey = parseSecretKey(parser);
|
||||
}
|
||||
}
|
||||
Log.i(TAG, "Reload watchlist settings done");
|
||||
Slog.i(TAG, "Reload watchlist settings done");
|
||||
} catch (IllegalStateException | NullPointerException | NumberFormatException |
|
||||
XmlPullParserException | IOException | IndexOutOfBoundsException e) {
|
||||
Slog.e(TAG, "Failed parsing xml", e);
|
||||
|
||||
Reference in New Issue
Block a user