From f982d7e77afc82878fafba1f712a018de0d0a1ad Mon Sep 17 00:00:00 2001 From: Songchun Fan Date: Tue, 16 Aug 2022 11:39:02 -0700 Subject: [PATCH] [PackageInstaller] catch yet another exception In certain corner cases ContentResolver might throw an IllegalArgumentException. The caller is expected to catch such exception and handle it gracefully. BUG: 240380933 Test: builds Change-Id: I14cae1d54d65957a418551cea5db5e1bcab14acb --- .../src/com/android/packageinstaller/InstallStaging.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java index 98438cde7c683..b6b88375a0a26 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java @@ -189,7 +189,8 @@ public class InstallStaging extends AlertActivity { out.write(buffer, 0, bytesRead); } } - } catch (IOException | SecurityException | IllegalStateException e) { + } catch (IOException | SecurityException | IllegalStateException + | IllegalArgumentException e) { Log.w(LOG_TAG, "Error staging apk from content URI", e); return false; }