Add catching of IllegalArgumentException, which gets thrown when there is a malformed Unicode escape character sequence

System crashes are occurring for partners (b/396308673) due to the DataStore failing to load. While we investigate the underlying cause, add IllegalArgumentExceptions to the catch clause to prevent the fatal exception from being thrown.

Change-Id: I99e72af60064e2f0a5eed69c4f82b6cc69ee5f66
Fixes: 396308673
Flag: com.android.net.ct.flags.certificate_transparency_service
Test: atest NetworkSecurityUnitTests
This commit is contained in:
Bessie Jiang 2025-02-13 09:14:29 -08:00
commit 3f4ee6c4b5

View file

@ -44,8 +44,9 @@ class DataStore extends Properties {
}
try (InputStream in = new FileInputStream(mPropertyFile)) {
load(in);
} catch (IOException e) {
} catch (IOException | IllegalArgumentException e) {
Log.e(TAG, "Error loading property store", e);
delete();
}
}