1/*
2 * Copyright (C) 2023 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
17// This file contains extension atoms for apex and vendor apex installation events.
18
19syntax = "proto2";
20
21package android.os.statsd.apex;
22
23import "frameworks/proto_logging/stats/atom_field_options.proto";
24import "frameworks/proto_logging/stats/atoms.proto";
25import "frameworks/proto_logging/stats/enums/apex/enums.proto";
26
27option java_package = "com.android.os.apex";
28
29extend Atom {
30    optional ApexInstallationRequested apex_installation_requested = 732 [(module) = "apex"];
31    optional ApexInstallationStaged apex_installation_staged = 733 [(module) = "apex"];
32    optional ApexInstallationEnded apex_installation_ended = 734 [(module) = "apex"];
33}
34
35/**
36 * APEXs can installed by either Google or OEMs. These atoms capture basic
37 * metadata of APEXs being installed on a device.
38 *
39 * Logs when an apex installation is started, staged, and ended.
40 * Pushed from:
41 *    system/apex/apexd/apexd.cpp
42 */
43
44message ApexInstallationRequested {
45    // Module in the APEX
46    optional string module_name = 1;
47    // The version code of the APEX
48    optional int64 version_code = 2;
49    // Byte size of the APEX file
50    optional int64 package_size_bytes = 3;
51    // The hex encoded SHA256 digest of the APEX file
52    optional string file_hash = 4;
53    // Lets us determine if apex is a vendor apex
54    optional android.apex.PreinstallPartition apex_preinstall_partition = 5;
55    // Was a Staged or a Rebootless install requested
56    optional android.apex.InstallationType installation_type = 6;
57    // Is this request a rollback?
58    optional bool request_is_rollback = 7;
59    // Apex's FileInfo's Manifest provides these data points
60    optional bool provides_shared_apex_libs = 8;
61    // HAL's provided by this apex
62    repeated string provided_hals = 9;
63}
64
65message ApexInstallationStaged {
66    optional string file_hash = 1;
67}
68
69message ApexInstallationEnded {
70    optional string file_hash = 1;
71    optional android.apex.InstallResultType installation_result = 2;
72}
73