1/*
2 * Copyright (C) 2020 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
17package [email protected];
18
19/**
20 * Constants that define the type of bug report being taken to restrict content appropriately.
21 */
22enum DumpstateMode : uint32_t {
23    /**
24     * Takes a bug report without user interference.
25     */
26    FULL = 0,
27    /**
28     * Interactive bug report, i.e. triggered by the user.
29     */
30    INTERACTIVE = 1,
31    /**
32     * Remote bug report triggered by DevicePolicyManager, for example.
33     */
34    REMOTE = 2,
35    /**
36     * Bug report triggered on a wear device.
37     */
38    WEAR = 3,
39    /**
40     * Bug report limited to only connectivity info (cellular, wifi, and networking). Sometimes
41     * called "telephony" in legacy contexts.
42     *
43     * All reported information MUST directly relate to connectivity debugging or customer support
44     * and MUST NOT contain unrelated private information. This information MUST NOT identify
45     * user-installed packages (UIDs are OK, package names are not), and MUST NOT contain logs of
46     * user application traffic.
47     */
48    CONNECTIVITY = 4,
49    /**
50     * Bug report limited to only wifi info.
51     */
52    WIFI = 5,
53    /**
54     * Default mode, essentially analogous to calling @1.0::IDumpstateDevice.dumpstateBoard(handle).
55     * This mode MUST be supported if the dumpstate HAL is implemented.
56     */
57    DEFAULT = 6,
58    /**
59     * Takes a report in protobuf.
60     *
61     * The content, if implemented, must be a binary protobuf message written to the first file
62     * descriptor of the native handle. The protobuf schema shall be defined by the vendor.
63     */
64    PROTO = 7,
65};
66
67/**
68 * A simple return enum for use with dumpstateBoard_1_1.
69 */
70enum DumpstateStatus : uint32_t {
71    OK = 0,
72    /**
73     * Returned for cases where the device doesn't support the given DumpstateMode (e.g. a phone
74     * trying to use DumpstateMode::WEAR).
75     */
76    UNSUPPORTED_MODE = 1,
77    /**
78     * Returned for cases where an IllegalArgumentException is typically appropriate, e.g. missing
79     * file descriptors.
80     */
81    ILLEGAL_ARGUMENT = 2,
82    /**
83     * Returned when device logging is not enabled.
84     */
85    DEVICE_LOGGING_NOT_ENABLED = 3,
86};
87