Remove obsolete dependencies to legacy transactions proto

Fix: b/254653004
Test: yarn build
Change-Id: I864c3c3a6a8524e54e363398f17403db7e81c0a6
This commit is contained in:
Kean Mariotti
2022-10-20 16:22:46 +00:00
parent 00c160c5fd
commit fe5c7132de
2 changed files with 0 additions and 100 deletions

View File

@@ -22,7 +22,6 @@ import jsonProtoDefsWm from 'frameworks/base/core/proto/android/server/windowman
import jsonProtoDefsProtoLog from 'frameworks/base/core/proto/android/internal/protolog.proto';
import jsonProtoDefsSf from 'frameworks/native/services/surfaceflinger/layerproto/layerstrace.proto';
import jsonProtoDefsTransaction from 'frameworks/native/services/surfaceflinger/layerproto/transactions.proto';
import jsonProtoDefsTransactionLegacy from 'frameworks/native/cmds/surfacereplayer/proto/src/trace.proto';
import jsonProtoDefsWl from 'WaylandSafePath/waylandtrace.proto';
import jsonProtoDefsSysUi from 'frameworks/base/packages/SystemUI/src/com/android/systemui/tracing/sysui_trace.proto';
import jsonProtoDefsLauncher from 'packages/apps/Launcher3/protos/launcher_trace_file.proto';
@@ -32,7 +31,6 @@ import jsonProtoDefsErrors from 'platform_testing/libraries/flicker/src/com/andr
import protobuf from 'protobufjs';
import {transform_accessibility_trace} from './transform_accessibility.js';
import {transform_transaction_trace} from './transform_transaction.js';
import {transform_transaction_trace_legacy} from './transform_transaction_legacy.js';
import {transform_wl_outputstate, transform_wayland_trace} from './transform_wl.js';
import {transformProtolog} from './transform_protolog.js';
import {transform_sysui_trace} from './transform_sys_ui.js';
@@ -67,7 +65,6 @@ const WmDumpMessage = lookup_type(jsonProtoDefsWm, 'com.android.server.wm.Window
const SfTraceMessage = lookup_type(jsonProtoDefsSf, 'android.surfaceflinger.LayersTraceFileProto');
const SfDumpMessage = lookup_type(jsonProtoDefsSf, 'android.surfaceflinger.LayersProto');
const SfTransactionTraceMessage = lookup_type(jsonProtoDefsTransaction, 'TransactionTraceFile');
const SfTransactionTraceMessageLegacy = lookup_type(jsonProtoDefsTransactionLegacy, 'Trace');
const WaylandTraceMessage = lookup_type(jsonProtoDefsWl, 'org.chromium.arc.wayland_composer.TraceFileProto');
const WaylandDumpMessage = lookup_type(jsonProtoDefsWl, 'org.chromium.arc.wayland_composer.OutputStateProto');
const ProtoLogMessage = lookup_type(jsonProtoDefsProtoLog, 'com.android.internal.protolog.ProtoLogFileProto');
@@ -413,17 +410,6 @@ const FILE_DECODERS = {
timeline: true,
},
},
[FILE_TYPES.TRANSACTIONS_TRACE_LEGACY]: {
name: 'Transactions (Legacy)',
decoder: protoDecoder,
decoderParams: {
type: FILE_TYPES.TRANSACTIONS_TRACE_LEGACY,
mime: 'application/octet-stream',
objTypeProto: SfTransactionTraceMessageLegacy,
transform: transform_transaction_trace_legacy,
timeline: true,
},
},
[FILE_TYPES.PROTO_LOG]: {
name: 'ProtoLog',
decoder: protoDecoder,

View File

@@ -1,86 +0,0 @@
/*
* Copyright 2019, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {nanos_to_string} from './transform.js';
function transform_transaction(transaction, layerIdToName) {
const transactions = [];
for (const surfaceChange of transaction.surfaceChange) {
transactions.push(Object.freeze({
type: 'surfaceChange',
obj: surfaceChange,
layerName: layerIdToName[surfaceChange.id],
}));
}
for (const displayChange of transaction.displayChange) {
transactions.push(Object.freeze({
type: 'displayChange',
obj: displayChange,
layerName: layerIdToName[displayChange.id],
}));
}
return transactions;
}
function transform_entry(entry, layerIdToName) {
const type = entry.increment;
const timestamp = entry.timeStamp;
const time = nanos_to_string(timestamp);
switch (type) {
case 'transaction':
return Object.freeze({
type,
// TODO: Rename to changes
transactions: transform_transaction(entry.transaction, layerIdToName),
synchronous: entry.transaction.synchronous,
animation: entry.transaction.animation,
identifier: entry.transaction.id,
time,
origin: entry.transaction.origin,
timestamp,
});
case 'surfaceCreation':
// NOTE: There is no break on purpose — we want to fall through to default
layerIdToName[entry[type].id] = entry[type].name;
default:
return Object.freeze({
type,
obj: entry[type],
layerName: entry[type].name ?? layerIdToName[entry[type].id],
time,
timestamp,
});
}
}
/**
* @deprecated This trace has been replaced by the new transactions trace
*/
function transform_transaction_trace_legacy(entries) {
const layerIdToName = {};
const data = entries.increment.map((entry) => transform_entry(entry, layerIdToName));
return {children: data};
}
export {transform_transaction_trace_legacy};