From b7a6549654374800d3954b4e765c86b5a888258b Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Thu, 21 Mar 2019 15:42:43 +0000 Subject: [PATCH] Add Looper.prepare() to doInBackground() Fix runtime error that was being thrown as Looper.prepare() was not called in the async function doInBackground. Bug: 124612105 Test: Was not able to reproduce the bug (that is make code execution flow through the catch block). * Reproduced by throwing IOException in the try block so that code flows to the catch block. * Build and flash. * Take interactive bugreport and change title and name of the bugreport from the progress bar. Change-Id: I6a5ea594d95462e1c66bd28eb81dd5f4daa6f35e --- .../Shell/src/com/android/shell/BugreportProgressService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index a9ff21fef99c1..1060c7b7ce795 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -1095,6 +1095,7 @@ public class BugreportProgressService extends Service { new AsyncTask() { @Override protected Void doInBackground(Void... params) { + Looper.prepare(); zipBugreport(info); sendBugreportNotification(info, takingScreenshot); return null;