aboutsummaryrefslogtreecommitdiff
path: root/binder/android/net/ResolverOptionsParcel.aidl
blob: dd64cf8c9952ca8a71a3461121373089fdd321af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net;

import android.net.ResolverHostsParcel;

/**
 * Knobs for OEM to control alternative behavior.
 *
 * {@hide}
 */
@JavaDerive(equals=true, toString=true)
parcelable ResolverOptionsParcel {
    /**
     * An IP/hostname mapping table for DNS local lookup customization.
     * WARNING: this is intended for local testing and other special situations.
     * Future versions of the DnsResolver module may break your assumptions.
     * Injecting static mappings for public hostnames is generally A VERY BAD IDEA,
     * since it makes it impossible for the domain owners to migrate the domain.
     * It is also not an effective domain blocking mechanism, because apps can
     * easily hardcode IPs or bypass the system DNS resolver.
     */
    ResolverHostsParcel[] hosts = {};

    /**
     * Truncated UDP DNS response handling mode. Handling of UDP responses with the TC (truncated)
     * bit set. The values are defined in {@code IDnsResolver.aidl}
     * 0: TC_MODE_DEFAULT
     * 1: TC_MODE_UDP_TCP
     * Other values are invalid.
     */
    int tcMode = 0;

    /**
     * The default behavior is that plaintext DNS queries are sent by the application's UID using
     * fchown(). DoT are sent with an UID of AID_DNS. This option control the plaintext uid of DNS
     * query.
     * Setting this option to true decreases battery life because it results in the device sending
     * UDP DNS queries even if the app that made the DNS lookup does not have network access.
     * Anecdotal data from the field suggests that about 15% of DNS lookups are in this category.
     * This option also results in data usage for UDP DNS queries being attributed to the OS instead
     * of to the requesting app.
     * false: set application uid on DNS sockets (default)
     * true: set AID_DNS on DNS sockets
     */
    boolean enforceDnsUid = false;
}