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

Commit 52ae409e authored by Kean Mariotti's avatar Kean Mariotti
Browse files

Unify package/imports of perfetto javastream protos

framework-jarjar-rules.txt contains a rule that renames
the package "perfetto.protos" to "android.internal.perfetto.protos".

However, the rule was not affecting the entire framework's code.
The confusing result was part of the framework importing "perfetto.protos"
and other parts importing "android.internal.perfetto.protos".

This commit adds a new library "perfetto_trace_javastream_protos_jarjar"
that provides to the entire framework the perfetto javastream protos
under a single unified package "android.internal.perfetto.protos".

Test: m framework-minus-apex
Bug: 276433199
Change-Id: Ie653c7b7b763fd97f021f89d413a7ed360946e7b
parent 9f1ec364
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -150,7 +150,6 @@ filegroup {
        ":framework-javastream-protos",
        ":statslog-framework-java-gen", // FrameworkStatsLog.java
        ":audio_policy_configuration_V7_0",
        ":perfetto_trace_javastream_protos",
    ],
}

@@ -427,6 +426,7 @@ java_defaults {
        "audiopolicy-aidl-java",
        "sounddose-aidl-java",
        "modules-utils-expresslog",
        "perfetto_trace_javastream_protos_jarjar",
    ],
}

@@ -666,6 +666,16 @@ filegroup {
    visibility: ["//frameworks/base/api"],
}

java_library {
    name: "perfetto_trace_javastream_protos_jarjar",
    srcs: [
        ":perfetto_trace_javastream_protos",
    ],
    jarjar_rules: ":framework-jarjar-rules",
    sdk_version: "core_platform",
    installable: false,
}

build = [
    "AconfigFlags.bp",
    "ProtoLibraries.bp",
+3 −1
Original line number Diff line number Diff line
@@ -582,7 +582,9 @@ java_library {
    srcs: [
        "com/android/internal/protolog/ProtoLogImpl.java",
        "com/android/internal/protolog/ProtoLogViewerConfigReader.java",
        ":perfetto_trace_javastream_protos",
    ],
    static_libs: [
        "perfetto_trace_javastream_protos_jarjar",
    ],
}

+26 −27
Original line number Diff line number Diff line
@@ -16,33 +16,34 @@

package com.android.internal.protolog;

import static perfetto.protos.PerfettoTrace.InternedData.PROTOLOG_STACKTRACE;
import static perfetto.protos.PerfettoTrace.InternedData.PROTOLOG_STRING_ARGS;
import static perfetto.protos.PerfettoTrace.InternedString.IID;
import static perfetto.protos.PerfettoTrace.InternedString.STR;
import static perfetto.protos.PerfettoTrace.ProtoLogMessage.BOOLEAN_PARAMS;
import static perfetto.protos.PerfettoTrace.ProtoLogMessage.DOUBLE_PARAMS;
import static perfetto.protos.PerfettoTrace.ProtoLogMessage.MESSAGE_ID;
import static perfetto.protos.PerfettoTrace.ProtoLogMessage.SINT64_PARAMS;
import static perfetto.protos.PerfettoTrace.ProtoLogMessage.STACKTRACE_IID;
import static perfetto.protos.PerfettoTrace.ProtoLogMessage.STR_PARAM_IIDS;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.GROUPS;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.Group.ID;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.Group.NAME;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.Group.TAG;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MESSAGES;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.GROUP_ID;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.LEVEL;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.MESSAGE;
import static perfetto.protos.PerfettoTrace.TracePacket.INTERNED_DATA;
import static perfetto.protos.PerfettoTrace.TracePacket.PROTOLOG_MESSAGE;
import static perfetto.protos.PerfettoTrace.TracePacket.PROTOLOG_VIEWER_CONFIG;
import static perfetto.protos.PerfettoTrace.TracePacket.SEQUENCE_FLAGS;
import static perfetto.protos.PerfettoTrace.TracePacket.SEQ_INCREMENTAL_STATE_CLEARED;
import static perfetto.protos.PerfettoTrace.TracePacket.SEQ_NEEDS_INCREMENTAL_STATE;
import static perfetto.protos.PerfettoTrace.TracePacket.TIMESTAMP;
import static android.internal.perfetto.protos.PerfettoTrace.InternedData.PROTOLOG_STACKTRACE;
import static android.internal.perfetto.protos.PerfettoTrace.InternedData.PROTOLOG_STRING_ARGS;
import static android.internal.perfetto.protos.PerfettoTrace.InternedString.IID;
import static android.internal.perfetto.protos.PerfettoTrace.InternedString.STR;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogMessage.BOOLEAN_PARAMS;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogMessage.DOUBLE_PARAMS;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogMessage.MESSAGE_ID;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogMessage.SINT64_PARAMS;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogMessage.STACKTRACE_IID;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogMessage.STR_PARAM_IIDS;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.GROUPS;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.Group.ID;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.Group.NAME;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.Group.TAG;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MESSAGES;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.GROUP_ID;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.LEVEL;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.MESSAGE;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.INTERNED_DATA;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.PROTOLOG_MESSAGE;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.PROTOLOG_VIEWER_CONFIG;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.SEQUENCE_FLAGS;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.SEQ_INCREMENTAL_STATE_CLEARED;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.SEQ_NEEDS_INCREMENTAL_STATE;
import static android.internal.perfetto.protos.PerfettoTrace.TracePacket.TIMESTAMP;

import android.annotation.Nullable;
import android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData;
import android.os.ShellCommand;
import android.os.SystemClock;
import android.os.Trace;
@@ -74,8 +75,6 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;

import perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData;

/**
 * A service for the ProtoLog logging system.
 */
+8 −9
Original line number Diff line number Diff line
@@ -16,13 +16,14 @@

package com.android.internal.protolog;

import static perfetto.protos.PerfettoTrace.DataSourceConfig.PROTOLOG_CONFIG;
import static perfetto.protos.PerfettoTrace.ProtoLogConfig.GROUP_OVERRIDES;
import static perfetto.protos.PerfettoTrace.ProtoLogConfig.TRACING_MODE;
import static perfetto.protos.PerfettoTrace.ProtoLogGroup.COLLECT_STACKTRACE;
import static perfetto.protos.PerfettoTrace.ProtoLogGroup.LOG_FROM;
import static perfetto.protos.PerfettoTrace.ProtoLogGroup.GROUP_NAME;

import static android.internal.perfetto.protos.PerfettoTrace.DataSourceConfig.PROTOLOG_CONFIG;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogConfig.GROUP_OVERRIDES;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogConfig.TRACING_MODE;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogGroup.COLLECT_STACKTRACE;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogGroup.GROUP_NAME;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogGroup.LOG_FROM;

import android.internal.perfetto.protos.PerfettoTrace;
import android.tracing.perfetto.CreateIncrementalStateArgs;
import android.tracing.perfetto.CreateTlsStateArgs;
import android.tracing.perfetto.DataSource;
@@ -39,8 +40,6 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import perfetto.protos.PerfettoTrace;

public class ProtoLogDataSource extends DataSource<ProtoLogDataSource.Instance,
        ProtoLogDataSource.TlsState,
        ProtoLogDataSource.IncrementalState> {
+3 −3
Original line number Diff line number Diff line
package com.android.internal.protolog;

import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MESSAGES;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.MESSAGE;
import static perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.MESSAGE_ID;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MESSAGES;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.MESSAGE;
import static android.internal.perfetto.protos.PerfettoTrace.ProtoLogViewerConfig.MessageData.MESSAGE_ID;

import android.util.ArrayMap;
import android.util.proto.ProtoInputStream;