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