blob: 502c46099838634ccdaa48a33537d264c4b1fa1b [file] [log] [blame]
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -08001/*
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 */
Hunter Knepshield6e278a32020-02-03 16:25:57 -080016
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080017package android.hardware.dumpstate@1.1;
18
19import @1.0::IDumpstateDevice;
20
21interface IDumpstateDevice extends @1.0::IDumpstateDevice {
22 /**
23 * Extension of dumpstateBoard which also accepts a mode parameter to limit dumped data.
24 *
25 * For an example of when this is relevant, consider a bug report being generated with
26 * DumpstateMode::CONNECTIVITY - there is no reason to include camera or USB logs in this type
27 * of report.
28 *
29 * The 1.0 version of #dumpstateBoard(handle) should just delegate to this new method and pass
30 * DumpstateMode::DEFAULT and a timeout of 30,000ms (30 seconds).
31 *
Hunter Knepshield6e278a32020-02-03 16:25:57 -080032 * This method may still be called by the dumpstate routine even if getDeviceLoggingEnabled
33 * returns false. In this case, it must return DumpstateStatus::DEVICE_LOGGING_NOT_ENABLED.
34 *
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080035 * @param h A native handle with one or two valid file descriptors. The first FD is for text
36 * output, the second (if present) is for binary output.
37 * @param mode A mode value to restrict dumped content.
38 * @param timeoutMillis An approximate "budget" for how much time this call has been allotted.
39 * If execution runs longer than this, the IDumpstateDevice service may be killed and only
40 * partial information will be included in the report.
Hunter Knepshield6e278a32020-02-03 16:25:57 -080041 * @return status A DumpstateStatus value indicating the final result.
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080042 */
Hunter Knepshield6e278a32020-02-03 16:25:57 -080043 dumpstateBoard_1_1(handle h, DumpstateMode mode, uint64_t timeoutMillis)
44 generates (DumpstateStatus status);
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080045
46 /**
47 * Turns device vendor logging on or off.
48 *
49 * The setting should be persistent across reboots. Underlying implementations may need to start
50 * vendor logging daemons, set system properties, or change logging masks, for example. Given
51 * that many vendor logs contain significant amounts of private information and may come with
52 * memory/storage/battery impacts, calling this method on a user build should only be done after
53 * user consent has been obtained, e.g. from a toggle in developer settings.
54 *
Hunter Knepshield6e278a32020-02-03 16:25:57 -080055 * Even if device logging has been disabled, dumpstateBoard may still be called by the dumpstate
56 * routine. In this case, it must return DumpstateStatus::DEVICE_LOGGING_NOT_ENABLED.
57 *
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080058 * @param enable Whether to enable or disable device vendor logging.
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080059 */
Hunter Knepshield6e278a32020-02-03 16:25:57 -080060 setDeviceLoggingEnabled(bool enable);
61
62 /**
63 * Queries the current state of device logging. Primarily for UI and informative purposes.
64 *
65 * Even if device logging has been disabled, dumpstateBoard may still be called by the dumpstate
66 * routine. In this case, it must return DumpstateStatus::DEVICE_LOGGING_NOT_ENABLED.
67 *
68 * @return enabled Whether or not vendor logging is currently enabled.
69 */
70 getDeviceLoggingEnabled() generates (bool enabled);
Hunter Knepshieldc9e2c6d2020-01-15 17:48:01 -080071};