From 86e5059696424388acf37016d10536eff9062ff5 Mon Sep 17 00:00:00 2001 From: MrFishFinger <4768596+MrFishFinger@users.noreply.github.com> Date: Sat, 26 Dec 2020 18:44:23 +0100 Subject: [PATCH] ISSUE-368 - ensure full list of scheduled jobs is returned --- app/src/main/java/com/termux/api/JobSchedulerAPI.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/api/JobSchedulerAPI.java b/app/src/main/java/com/termux/api/JobSchedulerAPI.java index 52163b24..8d11c370 100644 --- a/app/src/main/java/com/termux/api/JobSchedulerAPI.java +++ b/app/src/main/java/com/termux/api/JobSchedulerAPI.java @@ -180,9 +180,12 @@ private static void displayPendingJobs(TermuxApiReceiver apiReceiver, Intent int ResultReturner.returnData(apiReceiver, intent, out -> out.println("No pending jobs")); return; } + + StringBuilder stringBuilder = new StringBuilder(); for (JobInfo job : jobs) { - ResultReturner.returnData(apiReceiver, intent, out -> out.println(String.format(Locale.ENGLISH, "Pending %s", formatJobInfo(job)))); + stringBuilder.append(String.format(Locale.ENGLISH, "Pending %s\n", formatJobInfo(job))); } + ResultReturner.returnData(apiReceiver, intent, out -> out.println(stringBuilder.toString())); } @RequiresApi(api = Build.VERSION_CODES.N)