IControlsTethering.java revision ab6439b0f8dd0a67c81235a3fc4d9c149de3780d
1/* 2 * Copyright (C) 2016 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 19import android.net.LinkProperties; 20 21/** 22 * @hide 23 * 24 * Interface with methods necessary to notify that a given interface is ready for tethering. 25 * 26 * Rename to something more representative, e.g. IpServingControlCallback. 27 * 28 * All methods MUST be called on the TetherMasterSM main Looper's thread. 29 */ 30public class IControlsTethering { 31 public static final int STATE_UNAVAILABLE = 0; 32 public static final int STATE_AVAILABLE = 1; 33 public static final int STATE_TETHERED = 2; 34 public static final int STATE_LOCAL_ONLY = 3; 35 36 /** 37 * Notify that |who| has changed its tethering state. 38 * 39 * TODO: Remove the need for the |who| argument. 40 * 41 * @param who corresponding instance of a TetherInterfaceStateMachine 42 * @param state one of IControlsTethering.STATE_* 43 * @param lastError one of ConnectivityManager.TETHER_ERROR_* 44 */ 45 public void updateInterfaceState(TetherInterfaceStateMachine who, int state, int lastError) {} 46 47 /** 48 * Notify that |who| has new LinkProperties. 49 * 50 * TODO: Remove the need for the |who| argument. 51 * 52 * @param who corresponding instance of a TetherInterfaceStateMachine 53 * @param newLp the new LinkProperties to report 54 */ 55 public void updateLinkProperties(TetherInterfaceStateMachine who, LinkProperties newLp) {} 56} 57