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.FlaggedApi; 20 import android.annotation.NonNull; 21 import android.annotation.SystemApi; 22 import android.os.CancellationSignal; 23 import android.telephony.DomainSelectionService.EmergencyScanType; 24 25 import com.android.internal.telephony.flags.Flags; 26 27 import java.util.List; 28 import java.util.function.Consumer; 29 30 /** 31 * A callback class used to communicate with the framework to request network scans 32 * and notify the framework when a WWAN domain has been selected. 33 * @hide 34 */ 35 @SystemApi 36 @FlaggedApi(Flags.FLAG_USE_OEM_DOMAIN_SELECTION_SERVICE) 37 public interface WwanSelectorCallback { 38 /** 39 * Notify the framework that the {@link DomainSelectionService} has requested an emergency 40 * network scan as part of selection. 41 * 42 * @param preferredNetworks The ordered list of preferred networks to scan. 43 * @param scanType Indicates the scan preference, such as full service or limited service. 44 * @param resetScan Indicates that the previous scan result shall be reset before scanning. 45 * @param signal Notifies when the operation is canceled. 46 * @param consumer The handler of the response, which will contain a one-shot result 47 * of the network scan. 48 */ onRequestEmergencyNetworkScan(@onNull List<Integer> preferredNetworks, @EmergencyScanType int scanType, boolean resetScan, @NonNull CancellationSignal signal, @NonNull Consumer<EmergencyRegistrationResult> consumer)49 void onRequestEmergencyNetworkScan(@NonNull List<Integer> preferredNetworks, 50 @EmergencyScanType int scanType, boolean resetScan, 51 @NonNull CancellationSignal signal, 52 @NonNull Consumer<EmergencyRegistrationResult> consumer); 53 54 /** 55 * Notifies the FW that the domain has been selected. After this method is called, 56 * this interface can be discarded. 57 * 58 * @param domain The selected domain. 59 * @param useEmergencyPdn Indicates whether emergency services use emergency PDN or not. 60 */ onDomainSelected(@etworkRegistrationInfo.Domain int domain, boolean useEmergencyPdn)61 void onDomainSelected(@NetworkRegistrationInfo.Domain int domain, boolean useEmergencyPdn); 62 } 63