Revert "Dump most recently completed jobs."

This reverts commit be3fd775e11d62dfeaedfc34d02d0e6a392747fc.

Reason for revert: Bug: 180987628

Change-Id: I2f981de9298d81206242ac203ce2298aa50c29ae
(cherry picked from commit 1f167a75d1d59e5e917f8f8043e5f2899d3ce638)
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
index c5d3b7a..ac6eb32 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
@@ -53,7 +53,6 @@
 import android.os.BatteryStats;
 import android.os.BatteryStatsInternal;
 import android.os.Binder;
-import android.os.Build;
 import android.os.Handler;
 import android.os.LimitExceededException;
 import android.os.Looper;
@@ -152,9 +151,6 @@
     private static final boolean ENFORCE_MAX_JOBS = true;
     /** The maximum number of jobs that we allow an unprivileged app to schedule */
     private static final int MAX_JOBS_PER_APP = 100;
-    /** The number of the most recently completed jobs to keep track of for debugging purposes. */
-    private static final int NUM_COMPLETED_JOB_HISTORY =
-            Build.IS_USERDEBUG || Build.IS_ENG ? 25 : 0;
 
     @VisibleForTesting
     public static Clock sSystemClock = Clock.systemUTC();
@@ -301,10 +297,6 @@
      */
     boolean mReportedActive;
 
-    private int mLastCompletedJobIndex = 0;
-    private final JobStatus[] mLastCompletedJobs = new JobStatus[NUM_COMPLETED_JOB_HISTORY];
-    private final long[] mLastCompletedJobTimeElapsed = new long[NUM_COMPLETED_JOB_HISTORY];
-
     /**
      * A mapping of which uids are currently in the foreground to their effective priority.
      */
@@ -1760,10 +1752,6 @@
             Slog.d(TAG, "Completed " + jobStatus + ", reschedule=" + needsReschedule);
         }
 
-        mLastCompletedJobs[mLastCompletedJobIndex] = jobStatus;
-        mLastCompletedJobTimeElapsed[mLastCompletedJobIndex] = sElapsedRealtimeClock.millis();
-        mLastCompletedJobIndex = (mLastCompletedJobIndex + 1) % NUM_COMPLETED_JOB_HISTORY;
-
         // Intentionally not checking expedited job quota here. An app can't find out if it's run
         // out of quota when it asks JS to reschedule an expedited job. Instead, the rescheduled
         // EJ will just be demoted to a regular job if the app has no EJ quota left.
@@ -3310,37 +3298,6 @@
                 }
             }
             pw.decreaseIndent();
-
-            pw.println();
-            boolean recentPrinted = false;
-            pw.println("Recently completed jobs:");
-            pw.increaseIndent();
-            for (int r = 1; r <= NUM_COMPLETED_JOB_HISTORY; ++r) {
-                // Print most recent first
-                final int idx = (mLastCompletedJobIndex + NUM_COMPLETED_JOB_HISTORY - r)
-                        % NUM_COMPLETED_JOB_HISTORY;
-                final JobStatus job = mLastCompletedJobs[idx];
-                if (job != null) {
-                    if (!predicate.test(job)) {
-                        continue;
-                    }
-                    recentPrinted = true;
-                    TimeUtils.formatDuration(mLastCompletedJobTimeElapsed[idx], nowElapsed, pw);
-                    pw.println();
-                    // Double indent for readability
-                    pw.increaseIndent();
-                    pw.increaseIndent();
-                    job.dump(pw, true, nowElapsed);
-                    pw.decreaseIndent();
-                    pw.decreaseIndent();
-                }
-            }
-            if (!recentPrinted) {
-                pw.println("None");
-            }
-            pw.decreaseIndent();
-            pw.println();
-
             if (filterUid == -1) {
                 pw.println();
                 pw.print("mReadyToRock="); pw.println(mReadyToRock);