diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java index 488fe57cf6f86d7c738edfbc660f152e2c449247..9f9764853bef341c1cbe0d1b2bff09c7095b5f92 100644 --- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java @@ -370,18 +370,18 @@ public final class ProfcollectForwardingService extends SystemService { } private static void createAndUploadReport(ProfcollectForwardingService pfs) { - String reportName; - try { - reportName = pfs.mIProfcollect.report(pfs.mUsageSetting) + ".zip"; - } catch (RemoteException e) { - Log.e(LOG_TAG, "Failed to create report: " + e.getMessage()); - return; - } - if (!pfs.mUploadEnabled) { - Log.i(LOG_TAG, "Upload is not enabled."); - return; - } BackgroundThread.get().getThreadHandler().post(() -> { + String reportName; + try { + reportName = pfs.mIProfcollect.report(pfs.mUsageSetting) + ".zip"; + } catch (RemoteException e) { + Log.e(LOG_TAG, "Failed to create report: " + e.getMessage()); + return; + } + if (!pfs.mUploadEnabled) { + Log.i(LOG_TAG, "Upload is not enabled."); + return; + } Intent intent = new Intent() .setPackage("com.android.shell") .setAction("com.android.shell.action.PROFCOLLECT_UPLOAD")