1 /* 2 * Copyright (C) 2022 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.telephony; 18 19 import android.annotation.NonNull; 20 import android.telephony.Annotation.DisconnectCauses; 21 22 import java.util.function.Consumer; 23 24 /** 25 * A callback class used to receive the transport selection result. 26 * @hide 27 */ 28 public interface TransportSelectorCallback { 29 /** 30 * Notify that {@link DomainSelector} instance has been created for the selection request. 31 * 32 * @param selector the {@link DomainSelector} instance created. 33 */ onCreated(@onNull DomainSelector selector)34 void onCreated(@NonNull DomainSelector selector); 35 36 /** 37 * Notify that WLAN transport has been selected. 38 * 39 * @param useEmergencyPdn Indicates whether Wi-Fi emergency services use emergency PDN or not. 40 */ onWlanSelected(boolean useEmergencyPdn)41 void onWlanSelected(boolean useEmergencyPdn); 42 43 /** 44 * Notify that WWAN transport has been selected. 45 */ onWwanSelected()46 @NonNull WwanSelectorCallback onWwanSelected(); 47 48 /** 49 * Notify that WWAN transport has been selected. 50 * 51 * @param consumer The callback to receive the result. 52 */ onWwanSelected(Consumer<WwanSelectorCallback> consumer)53 void onWwanSelected(Consumer<WwanSelectorCallback> consumer); 54 55 /** 56 * Notify that selection has terminated because there is no decision that can be made 57 * or a timeout has occurred. The call should be terminated when this method is called. 58 * 59 * @param cause indicates the reason. 60 */ onSelectionTerminated(@isconnectCauses int cause)61 void onSelectionTerminated(@DisconnectCauses int cause); 62 } 63