1 /* 2 * Copyright (C) 2020 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.wifi; 18 19 import android.annotation.NonNull; 20 21 /** Listener for events on ClientModeImpl. */ 22 public interface ClientModeImplListener { 23 /** 24 * Called when a ClientModeImpl has been L2 connected. 25 * @param clientModeManager the ClientModeManager associated with the ClientModeImpl 26 */ onL2Connected(@onNull ConcreteClientModeManager clientModeManager)27 default void onL2Connected(@NonNull ConcreteClientModeManager clientModeManager) {} 28 29 /** 30 * Called when a ClientModeImpl has been L3 connected. 31 * @param clientModeManager the ClientModeManager associated with the ClientModeImpl 32 */ onL3Connected(@onNull ConcreteClientModeManager clientModeManager)33 default void onL3Connected(@NonNull ConcreteClientModeManager clientModeManager) {} 34 35 /** 36 * Called when a ClientModeImpl's internet connection has been validated. 37 * @param clientModeManager the ClientModeManager associated with the ClientModeImpl 38 */ onInternetValidated(@onNull ConcreteClientModeManager clientModeManager)39 default void onInternetValidated(@NonNull ConcreteClientModeManager clientModeManager) {} 40 41 /** 42 * Called when a ClientModeImpl starts a new connection attempt. 43 * @param clientModeManager the ClientModeManager associated with the ClientModeImpl 44 */ onConnectionStart(@onNull ConcreteClientModeManager clientModeManager)45 default void onConnectionStart(@NonNull ConcreteClientModeManager clientModeManager) {} 46 47 /** 48 * Called when a ClientModeImpl ends a connection (could be result of disconnect from an active 49 * connection or a connection attempt failure), 50 * 51 * @param clientModeManager the ClientModeManager associated with the ClientModeImpl 52 */ onConnectionEnd(@onNull ConcreteClientModeManager clientModeManager)53 default void onConnectionEnd(@NonNull ConcreteClientModeManager clientModeManager) {} 54 55 /** 56 * Called when a Captive Portal is detected on this connection. 57 * 58 * @param clientModeManager the ClientModeManager associated with the ClientModeImpl 59 */ onCaptivePortalDetected(@onNull ConcreteClientModeManager clientModeManager)60 default void onCaptivePortalDetected(@NonNull ConcreteClientModeManager clientModeManager) {} 61 } 62