blob: d56b167b9a753a83c89ad21a9a09981791f65545 [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;
Erik Kline72302902018-06-14 17:36:40 +090020import android.net.NetworkRequest;
Erik Kline7a4ccc62018-08-27 17:26:47 +090021import android.net.ip.IpServer;
Erik Klinef4b6e342017-04-25 19:19:59 +090022import android.net.util.SharedLog;
markchienb6eb2c22018-07-18 14:29:20 +080023import android.os.Handler;
Erik Klinef4b6e342017-04-25 19:19:59 +090024
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090025import com.android.internal.util.StateMachine;
markchienb6eb2c22018-07-18 14:29:20 +080026import com.android.server.connectivity.MockableSystemProperties;
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090027
28import java.util.ArrayList;
29
Erik Kline5a7c8a02017-04-30 19:36:15 +090030
31/**
32 * Capture tethering dependencies, for injection.
33 *
34 * @hide
35 */
36public class TetheringDependencies {
Erik Klinef4b6e342017-04-25 19:19:59 +090037 public OffloadHardwareInterface getOffloadHardwareInterface(Handler h, SharedLog log) {
38 return new OffloadHardwareInterface(h, log);
Erik Kline5a7c8a02017-04-30 19:36:15 +090039 }
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090040
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 Kline7a4ccc62018-08-27 17:26:47 +090047 ArrayList<IpServer> notifyList, SharedLog log) {
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090048 return new IPv6TetheringCoordinator(notifyList, log);
49 }
50
Erik Kline7a4ccc62018-08-27 17:26:47 +090051 public IpServer.Dependencies getIpServerDependencies() {
52 return new IpServer.Dependencies();
Remi NGUYEN VANa911e842018-03-15 11:57:14 +090053 }
Erik Kline465ff3a2018-03-09 14:18:02 +090054
55 public boolean isTetheringSupported() {
56 return true;
57 }
Erik Kline72302902018-06-14 17:36:40 +090058
59 public NetworkRequest getDefaultNetworkRequest() {
60 return null;
61 }
markchienb6eb2c22018-07-18 14:29:20 +080062
63 public EntitlementManager getEntitlementManager(Context ctx, SharedLog log,
64 MockableSystemProperties systemProperties) {
65 return new EntitlementManager(ctx, log, systemProperties);
66 }
Erik Kline5a7c8a02017-04-30 19:36:15 +090067}