diff options
| author | 2023-05-31 17:03:06 +0900 | |
|---|---|---|
| committer | 2023-05-31 17:53:57 +0000 | |
| commit | c23e36b827a104f491ee9dd4717a3cfa26b5cb02 (patch) | |
| tree | 9e0b979816c73f580bd8394ede1d2f96ba68a695 | |
| parent | 7502484675309a42b56187a7008ab664918f762e (diff) | |
Handle ArrayIndexOutOfBoundsException for install_sessions.xml
When install_sessions.xml is corrupted, ArrayIndexOutOfBoundsException
was thrown. It causes booting failure so catch it.
Bug: 269072872
Test: Corrupt install_sessions.xml and reboot
Change-Id: I99324e91a2da13bc86d62086aead40cc16cac60b
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageInstallerService.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java index 6491fd1b1f98..a9115371413c 100644 --- a/services/core/java/com/android/server/pm/PackageInstallerService.java +++ b/services/core/java/com/android/server/pm/PackageInstallerService.java @@ -511,7 +511,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements } } catch (FileNotFoundException e) { // Missing sessions are okay, probably first boot - } catch (IOException | XmlPullParserException e) { + } catch (IOException | XmlPullParserException | ArrayIndexOutOfBoundsException e) { Slog.wtf(TAG, "Failed reading install sessions", e); } finally { IoUtils.closeQuietly(fis); |