1 /* 2 * Copyright (C) 2018 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 android.net.wifi; 18 import android.net.wifi.SoftApCapability; 19 import android.net.wifi.SoftApInfo; 20 21 import android.net.wifi.WifiClient; 22 23 /** 24 * Interface for Soft AP callback. 25 * 26 * @hide 27 */ 28 oneway interface ISoftApCallback 29 { 30 /** 31 * Service to manager callback providing current soft AP state. The possible 32 * parameter values listed are defined in WifiManager.java 33 * 34 * @param state new AP state. One of WIFI_AP_STATE_DISABLED, 35 * WIFI_AP_STATE_DISABLING, WIFI_AP_STATE_ENABLED, 36 * WIFI_AP_STATE_ENABLING, WIFI_AP_STATE_FAILED 37 * @param failureReason reason when in failed state. One of 38 * SAP_START_FAILURE_GENERAL, SAP_START_FAILURE_NO_CHANNEL 39 */ onStateChanged(int state, int failureReason)40 void onStateChanged(int state, int failureReason); 41 42 /** 43 * Service to manager callback providing informations of softap. 44 * 45 * @param infos The currently {@link SoftApInfo} in each AP instance. 46 * @param clients The currently connected clients in each AP instance. 47 * @param isBridged whether or not the current AP enabled on bridged mode. 48 * @param isRegistration whether or not the callbackk was triggered when register. 49 */ onConnectedClientsOrInfoChanged(in Map<String, SoftApInfo> infos, in Map<String, List<WifiClient>> clients, boolean isBridged, boolean isRegistration)50 void onConnectedClientsOrInfoChanged(in Map<String, SoftApInfo> infos, 51 in Map<String, List<WifiClient>> clients, boolean isBridged, 52 boolean isRegistration); 53 54 /** 55 * Service to manager callback providing capability of softap. 56 * 57 * @param capability is the softap capability. {@link SoftApCapability} 58 */ onCapabilityChanged(in SoftApCapability capability)59 void onCapabilityChanged(in SoftApCapability capability); 60 61 /** 62 * Service to manager callback providing blocked client of softap with specific reason code. 63 * 64 * @param client the currently blocked client. 65 * @param blockedReason one of blocked reason from {@link WifiManager.SapClientBlockedReason} 66 */ onBlockedClientConnecting(in WifiClient client, int blockedReason)67 void onBlockedClientConnecting(in WifiClient client, int blockedReason); 68 } 69