1/*
2 * Copyright 2019, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import {transform, nanos_to_string, get_visible_chip} from './transform.js'
18
19function transform_edgeBack(edgeBack) {
20  return transform({
21    obj: edgeBack,
22    kind: 'edgeBack',
23    name: 'edgeBack',
24    children: []
25  });
26}
27
28function transform_systemUi(sysui) {
29  return transform({
30    obj: sysui,
31    kind: 'systemUi',
32    name: 'systemUi',
33    children: [
34        [[sysui.edgeBackGestureHandler], transform_edgeBack]
35    ]
36  });
37}
38
39function transform_entry(entry) {
40  return transform({
41    obj: entry,
42    kind: 'entry',
43    name: nanos_to_string(entry.elapsedRealtimeNanos),
44    children: [
45      [[entry.systemUi], transform_systemUi]
46    ],
47    timestamp: entry.elapsedRealtimeNanos,
48    stableId: 'entry'
49  });
50}
51
52function transform_sysui_trace(entries) {
53  return transform({
54    obj: entries,
55    kind: 'entries',
56    name: 'entries',
57    children: [
58      [entries.entry, transform_entry],
59    ],
60  });
61}
62
63export {transform_sysui_trace};
64