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.os.CancellationSignal; 21 import android.telephony.DomainSelectionService.EmergencyScanType; 22 23 import java.util.List; 24 import java.util.function.Consumer; 25 26 /** 27 * A callback class used to receive the domain selection result. 28 * @hide 29 */ 30 public interface WwanSelectorCallback { 31 /** 32 * Notify the framework that the {@link DomainSelectionService} has requested an emergency 33 * network scan as part of selection. 34 * 35 * @param preferredNetworks the ordered list of preferred networks to scan. 36 * @param scanType indicates the scan preference, such as full service or limited service. 37 * @param signal notifies when the operation is canceled. 38 * @param consumer the handler of the response. 39 */ onRequestEmergencyNetworkScan(@onNull List<Integer> preferredNetworks, @EmergencyScanType int scanType, @NonNull CancellationSignal signal, @NonNull Consumer<EmergencyRegResult> consumer)40 void onRequestEmergencyNetworkScan(@NonNull List<Integer> preferredNetworks, 41 @EmergencyScanType int scanType, 42 @NonNull CancellationSignal signal, @NonNull Consumer<EmergencyRegResult> consumer); 43 44 /** 45 * Notifies the FW that the domain has been selected. After this method is called, 46 * this interface can be discarded. 47 * 48 * @param domain The selected domain. 49 * @param useEmergencyPdn Indicates whether emergency services use emergency PDN or not. 50 */ onDomainSelected(@etworkRegistrationInfo.Domain int domain, boolean useEmergencyPdn)51 void onDomainSelected(@NetworkRegistrationInfo.Domain int domain, boolean useEmergencyPdn); 52 } 53