Erik Kline | 5a7c8a0 | 2017-04-30 19:36:15 +0900 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.server.connectivity.tethering; |
| 18 | |
Remi NGUYEN VAN | a911e84 | 2018-03-15 11:57:14 +0900 | [diff] [blame] | 19 | import android.content.Context; |
| 20 | import android.net.INetd; |
Erik Kline | 7230290 | 2018-06-14 17:36:40 +0900 | [diff] [blame] | 21 | import android.net.NetworkRequest; |
Remi NGUYEN VAN | e3bb5c5 | 2018-06-12 15:57:04 +0900 | [diff] [blame] | 22 | import android.net.dhcp.DhcpServer; |
| 23 | import android.net.dhcp.DhcpServingParams; |
Erik Kline | 7a4ccc6 | 2018-08-27 17:26:47 +0900 | [diff] [blame] | 24 | import android.net.ip.IpServer; |
Remi NGUYEN VAN | a911e84 | 2018-03-15 11:57:14 +0900 | [diff] [blame] | 25 | import android.net.ip.RouterAdvertisementDaemon; |
| 26 | import android.net.util.InterfaceParams; |
| 27 | import android.net.util.NetdService; |
Erik Kline | f4b6e34 | 2017-04-25 19:19:59 +0900 | [diff] [blame] | 28 | import android.os.Handler; |
| 29 | import android.net.util.SharedLog; |
Remi NGUYEN VAN | e3bb5c5 | 2018-06-12 15:57:04 +0900 | [diff] [blame] | 30 | import android.os.Looper; |
Erik Kline | f4b6e34 | 2017-04-25 19:19:59 +0900 | [diff] [blame] | 31 | |
Remi NGUYEN VAN | a911e84 | 2018-03-15 11:57:14 +0900 | [diff] [blame] | 32 | import com.android.internal.util.StateMachine; |
| 33 | |
| 34 | import java.util.ArrayList; |
| 35 | |
Erik Kline | 5a7c8a0 | 2017-04-30 19:36:15 +0900 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Capture tethering dependencies, for injection. |
| 39 | * |
| 40 | * @hide |
| 41 | */ |
| 42 | public class TetheringDependencies { |
Erik Kline | f4b6e34 | 2017-04-25 19:19:59 +0900 | [diff] [blame] | 43 | public OffloadHardwareInterface getOffloadHardwareInterface(Handler h, SharedLog log) { |
| 44 | return new OffloadHardwareInterface(h, log); |
Erik Kline | 5a7c8a0 | 2017-04-30 19:36:15 +0900 | [diff] [blame] | 45 | } |
Remi NGUYEN VAN | a911e84 | 2018-03-15 11:57:14 +0900 | [diff] [blame] | 46 | |
| 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 Kline | 7a4ccc6 | 2018-08-27 17:26:47 +0900 | [diff] [blame] | 53 | ArrayList<IpServer> notifyList, SharedLog log) { |
Remi NGUYEN VAN | a911e84 | 2018-03-15 11:57:14 +0900 | [diff] [blame] | 54 | return new IPv6TetheringCoordinator(notifyList, log); |
| 55 | } |
| 56 | |
Erik Kline | 7a4ccc6 | 2018-08-27 17:26:47 +0900 | [diff] [blame] | 57 | public IpServer.Dependencies getIpServerDependencies() { |
| 58 | return new IpServer.Dependencies(); |
Remi NGUYEN VAN | a911e84 | 2018-03-15 11:57:14 +0900 | [diff] [blame] | 59 | } |
Erik Kline | 465ff3a | 2018-03-09 14:18:02 +0900 | [diff] [blame] | 60 | |
| 61 | public boolean isTetheringSupported() { |
| 62 | return true; |
| 63 | } |
Erik Kline | 7230290 | 2018-06-14 17:36:40 +0900 | [diff] [blame] | 64 | |
| 65 | public NetworkRequest getDefaultNetworkRequest() { |
| 66 | return null; |
| 67 | } |
Erik Kline | 5a7c8a0 | 2017-04-30 19:36:15 +0900 | [diff] [blame] | 68 | } |