Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ba06189 authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

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
parent 5e5b6b01
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -177,6 +177,7 @@ public final class BugreportManager {
            // Need to delete the file if it was created but failed while trying to get fd
            // Need to delete the file if it was created but failed while trying to get fd
            deleteFile(tmpScreenshotFile);
            deleteFile(tmpScreenshotFile);
            Log.e(TAG, "Not able to create/open temporary screenshot file ", e);
            Log.e(TAG, "Not able to create/open temporary screenshot file ", e);
            callback.onError(BugreportCallback.BUGREPORT_ERROR_RUNTIME);
        } finally {
        } finally {
            // We can close the file descriptors here because binder would have duped them.
            // We can close the file descriptors here because binder would have duped them.
            IoUtils.closeQuietly(bugreportFd);
            IoUtils.closeQuietly(bugreportFd);