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

Commit e51b5489 authored by Kevin Jeon's avatar Kevin Jeon
Browse files

Annotate dump methods with @NeverCompile [2/5]

This change annotates dump/debug methods in services.odex that are
larger than 10000 bytes with NeverCompile so that they will not be
compiled. This results in an overall ~1% decrease in the size of
services.odex.

Bug: 215417388
Test: Build and check that these methods are not called during boot or
      app startup.
Change-Id: I0e29b2b9302e236a4edad700fbf9ba5ad0074f9e
parent ce48a19f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ import com.android.server.EventLogTags;
import com.android.server.LocalServices;
import com.android.server.uri.UriGrantsManagerInternal;

import dalvik.annotation.optimization.NeverCompile;

import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
@@ -463,6 +465,7 @@ public final class NotificationRecord {
            rv.getPackage(), rv.getLayoutId(), rv.estimateMemoryUsage(), rv.toString());
    }

    @NeverCompile // Avoid size overhead of debugging code.
    void dump(PrintWriter pw, String prefix, Context baseContext, boolean redact) {
        final Notification notification = getSbn().getNotification();
        pw.println(prefix + this);
+3 −0
Original line number Diff line number Diff line
@@ -344,6 +344,8 @@ import com.android.server.wm.SurfaceAnimator.AnimationType;
import com.android.server.wm.WindowManagerService.H;
import com.android.server.wm.utils.InsetUtils;

import dalvik.annotation.optimization.NeverCompile;

import com.google.android.collect.Sets;

import org.xmlpull.v1.XmlPullParserException;
@@ -903,6 +905,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
    };

    @NeverCompile // Avoid size overhead of debugging code.
    @Override
    void dump(PrintWriter pw, String prefix, boolean dumpAll) {
        final long now = SystemClock.uptimeMillis();
+3 −0
Original line number Diff line number Diff line
@@ -309,6 +309,8 @@ import com.android.server.policy.WindowManagerPolicy.ScreenOffListener;
import com.android.server.power.ShutdownThread;
import com.android.server.utils.PriorityDump;

import dalvik.annotation.optimization.NeverCompile;

import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
@@ -6562,6 +6564,7 @@ public class WindowManagerService extends IWindowManager.Stub
        PriorityDump.dump(mPriorityDumper, fd, pw, args);
    }

    @NeverCompile // Avoid size overhead of debugging code.
    private void doDump(FileDescriptor fd, PrintWriter pw, String[] args, boolean useProto) {
        if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
        boolean dumpAll = false;
+3 −0
Original line number Diff line number Diff line
@@ -254,6 +254,8 @@ import com.android.server.policy.WindowManagerPolicy;
import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
import com.android.server.wm.SurfaceAnimator.AnimationType;

import dalvik.annotation.optimization.NeverCompile;

import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -4083,6 +4085,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        proto.end(token);
    }

    @NeverCompile // Avoid size overhead of debugging code.
    @Override
    void dump(PrintWriter pw, String prefix, boolean dumpAll) {
        pw.print(prefix + "mDisplayId=" + getDisplayId());