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 
17 package android.net.resolv.aidl;
18 
19 /**
20  * The DNS health result of queries.
21  *
22  * Only sent for API calls that actually generated network traffic:
23  *  - No cache hits
24  *  - No power management errors (rcode == INTERNAL_ERROR && errno == EPERM)
25  *  - Only lookup result is OK or TIMEOUT.
26  *
27  * This must not be used for use-cases other than evaluating the health of DNS queries. The behavior
28  * of this interface will change across regular module updates, and in particular it will be updated
29  * to stop sending one event by DNS API call, and instead report network failures in realtime.
30  *
31  * Non-public API, only callable from Connectivity or NetworkStack Mainline modules.
32  * {@hide}
33  */
34 @JavaDerive(toString=true)
35 parcelable DnsHealthEventParcel {
36 
37     /*** The ID of the network that lookup was performed on. */
38     int netId;
39 
40     /**
41      * The health result of queries.
42      * Currently, this value is for data stall detection and it only checks whether result is
43      * timeout or not. So if the result is neither OK nor TIMEOUT, will not send this event.
44      */
45     int healthResult;
46 
47     /*** The round trip time for each dns query that received a reply */
48     int[] successRttMicros;
49 }
50