1 /**
2  * Copyright (c) 2018, 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 perNmissions and
14  * limitations under the License.
15  */
16 package android.net;
17 
18 import android.net.IIpMemoryStoreCallbacks;
19 import android.net.INetworkMonitorCallbacks;
20 import android.net.INetworkStackStatusCallback;
21 import android.net.Network;
22 import android.net.dhcp.DhcpServingParamsParcel;
23 import android.net.dhcp.IDhcpServerCallbacks;
24 import android.net.ip.IIpClientCallbacks;
25 
26 /** @hide */
27 oneway interface INetworkStackConnector {
makeDhcpServer(in String ifName, in DhcpServingParamsParcel params, in IDhcpServerCallbacks cb)28     void makeDhcpServer(in String ifName, in DhcpServingParamsParcel params,
29         in IDhcpServerCallbacks cb);
makeNetworkMonitor(in Network network, String name, in INetworkMonitorCallbacks cb)30     void makeNetworkMonitor(in Network network, String name, in INetworkMonitorCallbacks cb);
makeIpClient(in String ifName, in IIpClientCallbacks callbacks)31     void makeIpClient(in String ifName, in IIpClientCallbacks callbacks);
fetchIpMemoryStore(in IIpMemoryStoreCallbacks cb)32     void fetchIpMemoryStore(in IIpMemoryStoreCallbacks cb);
33     /**
34      * Mark a UID as test UID, allowing it to use the TestNetworkStackService.
35      *
36      * TestNetworkStackService is a binder service identical to NetworkStackService, but only
37      * available on userdebug builds, and only usable by the test UID. It does not require the
38      * MAINLINE_NETWORK_STACK signature permission like NetworkStackService does, so it allows the
39      * test UID to use other methods in this interface even though it would otherwise not have
40      * permission to.
41      *
42      * This method must be called as root and can only be used on debuggable builds. It only affects
43      * the NetworkStack until it is restarted.
44      * Callers should pass in -1 to reset after use.
45      *
46      * @param cb Callback that will be called with a status of 0 if the call succeeds. Calls without
47      *           sufficient permissions may be dropped without generating a callback.
48      */
allowTestUid(int uid, in INetworkStackStatusCallback cb)49     oneway void allowTestUid(int uid, in INetworkStackStatusCallback cb);
50 }
51