blob: 8b4006916736c0f87703bb398c476e420079d1a8 [file] [log] [blame]
Erik Kline5a7c8a02017-04-30 19:36:15 +09001/*
2 * Copyright (C) 2017 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 com.android.server.connectivity.tethering;
18
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090019import android.content.Context;
20import android.net.INetd;
Erik Kline72302902018-06-14 17:36:40 +090021import android.net.NetworkRequest;
Remi NGUYEN VANe3bb5c52018-06-12 15:57:04 +090022import android.net.dhcp.DhcpServer;
23import android.net.dhcp.DhcpServingParams;
Erik Kline7a4ccc62018-08-27 17:26:47 +090024import android.net.ip.IpServer;
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090025import android.net.ip.RouterAdvertisementDaemon;
26import android.net.util.InterfaceParams;
27import android.net.util.NetdService;
Erik Klinef4b6e342017-04-25 19:19:59 +090028import android.os.Handler;
29import android.net.util.SharedLog;
Remi NGUYEN VANe3bb5c52018-06-12 15:57:04 +090030import android.os.Looper;
Erik Klinef4b6e342017-04-25 19:19:59 +090031
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090032import com.android.internal.util.StateMachine;
33
34import java.util.ArrayList;
35
Erik Kline5a7c8a02017-04-30 19:36:15 +090036
37/**
38 * Capture tethering dependencies, for injection.
39 *
40 * @hide
41 */
42public class TetheringDependencies {
Erik Klinef4b6e342017-04-25 19:19:59 +090043 public OffloadHardwareInterface getOffloadHardwareInterface(Handler h, SharedLog log) {
44 return new OffloadHardwareInterface(h, log);
Erik Kline5a7c8a02017-04-30 19:36:15 +090045 }
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090046
47 public UpstreamNetworkMonitor getUpstreamNetworkMonitor(Context ctx, StateMachine target,
48 SharedLog log, int what) {
49 return new UpstreamNetworkMonitor(ctx, target, log, what);
50 }
51
52 public IPv6TetheringCoordinator getIPv6TetheringCoordinator(
Erik Kline7a4ccc62018-08-27 17:26:47 +090053 ArrayList<IpServer> notifyList, SharedLog log) {
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090054 return new IPv6TetheringCoordinator(notifyList, log);
55 }
56
Erik Kline7a4ccc62018-08-27 17:26:47 +090057 public IpServer.Dependencies getIpServerDependencies() {
58 return new IpServer.Dependencies();
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090059 }
Erik Kline465ff3a2018-03-09 14:18:02 +090060
61 public boolean isTetheringSupported() {
62 return true;
63 }
Erik Kline72302902018-06-14 17:36:40 +090064
65 public NetworkRequest getDefaultNetworkRequest() {
66 return null;
67 }
Erik Kline5a7c8a02017-04-30 19:36:15 +090068}