1 /* 2 * Copyright (C) 2006 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.internal.telephony; 18 19 import android.annotation.NonNull; 20 import android.compat.annotation.UnsupportedAppUsage; 21 import android.telephony.Annotation.DataFailureCause; 22 import android.telephony.Annotation.RadioPowerState; 23 import android.telephony.Annotation.SrvccState; 24 import android.telephony.BarringInfo; 25 import android.telephony.CallQuality; 26 import android.telephony.CellIdentity; 27 import android.telephony.CellInfo; 28 import android.telephony.PhoneCapability; 29 import android.telephony.PreciseDataConnectionState; 30 import android.telephony.TelephonyDisplayInfo; 31 import android.telephony.emergency.EmergencyNumber; 32 import android.telephony.ims.ImsReasonInfo; 33 34 import java.util.List; 35 36 /** 37 * {@hide} 38 */ 39 public interface PhoneNotifier { 40 notifyPhoneState(Phone sender)41 void notifyPhoneState(Phone sender); 42 notifyServiceState(Phone sender)43 void notifyServiceState(Phone sender); 44 45 /** 46 * Notify registrants of the current CellLocation. 47 * 48 * <p>Use CellIdentity that is Parcellable to pass AIDL; convert to CellLocation in client code. 49 */ notifyCellLocation(Phone sender, CellIdentity cellIdentity)50 void notifyCellLocation(Phone sender, CellIdentity cellIdentity); 51 52 @UnsupportedAppUsage notifySignalStrength(Phone sender)53 void notifySignalStrength(Phone sender); 54 55 @UnsupportedAppUsage notifyMessageWaitingChanged(Phone sender)56 void notifyMessageWaitingChanged(Phone sender); 57 notifyCallForwardingChanged(Phone sender)58 void notifyCallForwardingChanged(Phone sender); 59 60 /** Send a notification that the Data Connection for a particular apnType has changed */ notifyDataConnection( Phone sender, String apnType, PreciseDataConnectionState preciseState)61 void notifyDataConnection( 62 Phone sender, String apnType, PreciseDataConnectionState preciseState); 63 notifyDataActivity(Phone sender)64 void notifyDataActivity(Phone sender); 65 notifyCellInfo(Phone sender, List<CellInfo> cellInfo)66 void notifyCellInfo(Phone sender, List<CellInfo> cellInfo); 67 notifyPreciseCallState(Phone sender)68 void notifyPreciseCallState(Phone sender); 69 notifyDisconnectCause(Phone sender, int cause, int preciseCause)70 void notifyDisconnectCause(Phone sender, int cause, int preciseCause); 71 notifyImsDisconnectCause(Phone sender, ImsReasonInfo imsReasonInfo)72 void notifyImsDisconnectCause(Phone sender, ImsReasonInfo imsReasonInfo); 73 74 /** Send a notification that a particular data connection has failed with specified cause. */ notifyDataConnectionFailed(Phone sender, String apnType, String apn, @DataFailureCause int failCause)75 void notifyDataConnectionFailed(Phone sender, String apnType, String apn, 76 @DataFailureCause int failCause); 77 78 /** Send a notification that the SRVCC state has changed.*/ notifySrvccStateChanged(Phone sender, @SrvccState int state)79 void notifySrvccStateChanged(Phone sender, @SrvccState int state); 80 81 /** Send a notification that the voice activation state has changed */ notifyVoiceActivationStateChanged(Phone sender, int activationState)82 void notifyVoiceActivationStateChanged(Phone sender, int activationState); 83 84 /** Send a notification that the data activation state has changed */ notifyDataActivationStateChanged(Phone sender, int activationState)85 void notifyDataActivationStateChanged(Phone sender, int activationState); 86 87 /** Send a notification that the users mobile data setting has changed */ notifyUserMobileDataStateChanged(Phone sender, boolean state)88 void notifyUserMobileDataStateChanged(Phone sender, boolean state); 89 90 /** Send a notification that the display info has changed */ notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo)91 void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo); 92 93 /** Send a notification that the phone capability has changed */ notifyPhoneCapabilityChanged(PhoneCapability capability)94 void notifyPhoneCapabilityChanged(PhoneCapability capability); 95 notifyRadioPowerStateChanged(Phone sender, @RadioPowerState int state)96 void notifyRadioPowerStateChanged(Phone sender, @RadioPowerState int state); 97 98 /** Notify of change to EmergencyNumberList. */ notifyEmergencyNumberList(Phone sender)99 void notifyEmergencyNumberList(Phone sender); 100 101 /** Notify of a change for Outgoing Emergency Call. */ notifyOutgoingEmergencyCall(Phone sender, EmergencyNumber emergencyNumber)102 void notifyOutgoingEmergencyCall(Phone sender, EmergencyNumber emergencyNumber); 103 104 /** Notify of a change for Outgoing Emergency Sms. */ notifyOutgoingEmergencySms(Phone sender, EmergencyNumber emergencyNumber)105 void notifyOutgoingEmergencySms(Phone sender, EmergencyNumber emergencyNumber); 106 107 /** Notify of a change to the call quality of an active foreground call. */ notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType)108 void notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType); 109 110 /** Notify registration failed */ notifyRegistrationFailed(Phone sender, @NonNull CellIdentity cellIdentity, @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode)111 void notifyRegistrationFailed(Phone sender, @NonNull CellIdentity cellIdentity, 112 @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode); 113 114 /** Notify barring info has changed */ notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo)115 void notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo); 116 } 117