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

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

Remove code related to stolen trace sessions

As of aosp/2323319, tracing_service_proxy will always report
session_stolen=false. This change updates TracingServiceProxy.java to
reflect this.

Test: Check that System Tracing + bug report interactions are still
      correct.
Bug: 352779024
Flag: EXEMPT no-op cleanup
Change-Id: I9b199c3040db47cdf1c6ef7cd03567e785a63b17
Merged-In: I9b199c3040db47cdf1c6ef7cd03567e785a63b17
parent 24123b57
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -76,8 +76,6 @@ public class TracingServiceProxy extends SystemService {
    // Keep this in sync with the definitions in TraceService
    private static final String INTENT_ACTION_NOTIFY_SESSION_STOPPED =
            "com.android.traceur.NOTIFY_SESSION_STOPPED";
    private static final String INTENT_ACTION_NOTIFY_SESSION_STOLEN =
            "com.android.traceur.NOTIFY_SESSION_STOLEN";

    private static final int REPORT_BEGIN =
            TRACING_SERVICE_REPORT_EVENT__EVENT__TRACING_SERVICE_REPORT_BEGIN;
@@ -97,13 +95,12 @@ public class TracingServiceProxy extends SystemService {

    private final ITracingServiceProxy.Stub mTracingServiceProxy = new ITracingServiceProxy.Stub() {
        /**
         * Notifies system tracing app that a tracing session has ended. If a session is repurposed
         * for use in a bugreport, sessionStolen can be set to indicate that tracing has ended but
         * there is no buffer available to dump.
         * Notifies system tracing app that a tracing session has ended. sessionStolen is ignored,
         * as trace sessions are no longer stolen and are always cloned instead.
         */
        @Override
        public void notifyTraceSessionEnded(boolean sessionStolen) {
            TracingServiceProxy.this.notifyTraceur(sessionStolen);
        public void notifyTraceSessionEnded(boolean sessionStolen /* unused */) {
            TracingServiceProxy.this.notifyTraceur();
        }

        @Override
@@ -132,7 +129,7 @@ public class TracingServiceProxy extends SystemService {
        }
    }

    private void notifyTraceur(boolean sessionStolen) {
    private void notifyTraceur() {
        final Intent intent = new Intent();

        try {
@@ -141,11 +138,7 @@ public class TracingServiceProxy extends SystemService {
                    PackageManager.MATCH_SYSTEM_ONLY);

            intent.setClassName(info.packageName, TRACING_APP_ACTIVITY);
            if (sessionStolen) {
                intent.setAction(INTENT_ACTION_NOTIFY_SESSION_STOLEN);
            } else {
            intent.setAction(INTENT_ACTION_NOTIFY_SESSION_STOPPED);
            }

            final long identity = Binder.clearCallingIdentity();
            try {