From 7ba06189f334d7b6d05d031655c85bb877a77c06 Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Mon, 15 Apr 2019 10:16:42 +0100 Subject: [PATCH] Notify the caller about I/O error Call onError for caller of BugreportManager.start() if any io error occurs during runtime. Bug: 128981582 Test: Tested manually by throwing IO exception in the code when bugreport is being generated, onError of the callback successfully called. Merged-In: I9033d85d392b926041fc26a86806a370752d062d Change-Id: I9033d85d392b926041fc26a86806a370752d062d --- core/java/android/os/BugreportManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/java/android/os/BugreportManager.java b/core/java/android/os/BugreportManager.java index f9daa5772224..842943f05728 100644 --- a/core/java/android/os/BugreportManager.java +++ b/core/java/android/os/BugreportManager.java @@ -177,6 +177,7 @@ public final class BugreportManager { // Need to delete the file if it was created but failed while trying to get fd deleteFile(tmpScreenshotFile); Log.e(TAG, "Not able to create/open temporary screenshot file ", e); + callback.onError(BugreportCallback.BUGREPORT_ERROR_RUNTIME); } finally { // We can close the file descriptors here because binder would have duped them. IoUtils.closeQuietly(bugreportFd); -- 2.11.0