Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c92db08 authored by ESWAR MAGATAPALLI (xWF)'s avatar ESWAR MAGATAPALLI (xWF) Committed by Android (Google) Code Review
Browse files

Revert "[res] Dump resources timings in dumpsys"

Revert submission 31021037

Reason for revert: Droidmonitor created revert due to b/388342212. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:31021037

Change-Id: Ia02c5389a7e83d1359525a3c96953a8b595b5724
parent 53d89b21
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -105,7 +105,6 @@ import android.content.pm.ServiceInfo;
import android.content.res.AssetManager;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.ResourceTimer;
import android.content.res.Resources;
import android.content.res.ResourcesImpl;
import android.content.res.loader.ResourcesLoader;
@@ -5254,7 +5253,6 @@ public final class ActivityThread extends ClientTransactionHandler

            Resources.dumpHistory(pw, "");
            pw.flush();
            ResourceTimer.dumpTimers(info.fd.getFileDescriptor(), "-refresh");
            if (info.finishCallback != null) {
                info.finishCallback.sendResult(null);
            }
+28 −28
Original line number Diff line number Diff line
@@ -17,10 +17,13 @@
package android.content.res;

import android.annotation.NonNull;
import android.annotation.Nullable;

import android.app.AppProtoEnums;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.SystemClock;
import android.text.TextUtils;
@@ -30,7 +33,6 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.FrameworkStatsLog;

import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -275,18 +277,16 @@ public final class ResourceTimer {
     * Update the metrics information and dump it.
     * @hide
     */
    public static void dumpTimers(@NonNull FileDescriptor fd, String... args) {
        try (PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd))) {
            pw.println("\nDumping ResourceTimers");

            final boolean enabled;
    public static void dumpTimers(@NonNull ParcelFileDescriptor pfd, @Nullable String[] args) {
        FileOutputStream fout = new FileOutputStream(pfd.getFileDescriptor());
        PrintWriter pw = new FastPrintWriter(fout);
        synchronized (sLock) {
                enabled = sEnabled && sConfig != null;
            }
            if (!enabled) {
            if (!sEnabled || (sConfig == null)) {
                pw.println("  Timers are not enabled in this process");
                pw.flush();
                return;
            }
        }

        // Look for the --refresh switch.  If the switch is present, then sTimers is updated.
        // Otherwise, the current value of sTimers is displayed.
@@ -308,7 +308,7 @@ public final class ResourceTimer {
                }
            }
        }
        }
        pw.flush();
    }

    // Enable (or disabled) the runtime timers.  Note that timers are disabled by default.  This
+1 −0
Original line number Diff line number Diff line
@@ -88,5 +88,6 @@ public class ResourcesManagerShellCommand extends ShellCommand {
        out.println("    Print this help text.");
        out.println("  dump <PROCESS>");
        out.println("    Dump the Resources objects in use as well as the history of Resources");

    }
}