diff options
author | 2024-05-24 18:12:21 +0000 | |
---|---|---|
committer | 2024-05-24 18:12:21 +0000 | |
commit | 91c006def37f1038858f5c1aaba22d31ca86ec17 (patch) | |
tree | 3b81a7d69d694b5367f7ae63ea68d18aa48a41b4 /services/profcollect | |
parent | 6a7f27873a0fc815a8a1ad3fa6b93bcf9d3ea897 (diff) |
profcollect: Make binder call on a background thread
Bug: 342527967
Change-Id: I41811e2dae454c67435c1c99d10bc3a28894fbd1
Test: presubmit
Diffstat (limited to 'services/profcollect')
-rw-r--r-- | services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java index 488fe57cf6f8..9f9764853bef 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") |