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.RadioPowerState; 22 import android.telephony.Annotation.SrvccState; 23 import android.telephony.BarringInfo; 24 import android.telephony.CallQuality; 25 import android.telephony.CellIdentity; 26 import android.telephony.CellInfo; 27 import android.telephony.LinkCapacityEstimate; 28 import android.telephony.PhoneCapability; 29 import android.telephony.PhysicalChannelConfig; 30 import android.telephony.PreciseDataConnectionState; 31 import android.telephony.ServiceState; 32 import android.telephony.TelephonyDisplayInfo; 33 import android.telephony.TelephonyManager.DataEnabledReason; 34 import android.telephony.emergency.EmergencyNumber; 35 import android.telephony.ims.ImsReasonInfo; 36 37 import java.util.List; 38 39 /** 40 * {@hide} 41 */ 42 public interface PhoneNotifier { 43 notifyPhoneState(Phone sender)44 void notifyPhoneState(Phone sender); 45 46 /** 47 * Notify registrants of the given phone's current ServiceState. 48 */ notifyServiceState(Phone sender)49 void notifyServiceState(Phone sender); 50 51 /** 52 * Notify registrants with a given ServiceState. Passing in the subId allows us to 53 * send a final ServiceState update when the subId for the sender phone becomes invalid 54 * @param sender 55 * @param subId 56 */ notifyServiceStateForSubId(Phone sender, ServiceState ss, int subId)57 void notifyServiceStateForSubId(Phone sender, ServiceState ss, int subId); 58 59 /** 60 * Notify registrants of the current CellLocation. 61 * 62 * <p>Use CellIdentity that is Parcellable to pass AIDL; convert to CellLocation in client code. 63 */ notifyCellLocation(Phone sender, CellIdentity cellIdentity)64 void notifyCellLocation(Phone sender, CellIdentity cellIdentity); 65 66 @UnsupportedAppUsage notifySignalStrength(Phone sender)67 void notifySignalStrength(Phone sender); 68 69 @UnsupportedAppUsage notifyMessageWaitingChanged(Phone sender)70 void notifyMessageWaitingChanged(Phone sender); 71 notifyCallForwardingChanged(Phone sender)72 void notifyCallForwardingChanged(Phone sender); 73 74 /** Send a notification that the Data Connection for a particular apnType has changed */ notifyDataConnection(Phone sender, PreciseDataConnectionState preciseState)75 void notifyDataConnection(Phone sender, PreciseDataConnectionState preciseState); 76 notifyDataActivity(Phone sender)77 void notifyDataActivity(Phone sender); 78 notifyCellInfo(Phone sender, List<CellInfo> cellInfo)79 void notifyCellInfo(Phone sender, List<CellInfo> cellInfo); 80 notifyPreciseCallState(Phone sender)81 void notifyPreciseCallState(Phone sender); 82 notifyDisconnectCause(Phone sender, int cause, int preciseCause)83 void notifyDisconnectCause(Phone sender, int cause, int preciseCause); 84 notifyImsDisconnectCause(Phone sender, ImsReasonInfo imsReasonInfo)85 void notifyImsDisconnectCause(Phone sender, ImsReasonInfo imsReasonInfo); 86 87 /** Send a notification that the SRVCC state has changed.*/ notifySrvccStateChanged(Phone sender, @SrvccState int state)88 void notifySrvccStateChanged(Phone sender, @SrvccState int state); 89 90 /** Send a notification that the voice activation state has changed */ notifyVoiceActivationStateChanged(Phone sender, int activationState)91 void notifyVoiceActivationStateChanged(Phone sender, int activationState); 92 93 /** Send a notification that the data activation state has changed */ notifyDataActivationStateChanged(Phone sender, int activationState)94 void notifyDataActivationStateChanged(Phone sender, int activationState); 95 96 /** Send a notification that the users mobile data setting has changed */ notifyUserMobileDataStateChanged(Phone sender, boolean state)97 void notifyUserMobileDataStateChanged(Phone sender, boolean state); 98 99 /** Send a notification that the display info has changed */ notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo)100 void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo); 101 102 /** Send a notification that the phone capability has changed */ notifyPhoneCapabilityChanged(PhoneCapability capability)103 void notifyPhoneCapabilityChanged(PhoneCapability capability); 104 notifyRadioPowerStateChanged(Phone sender, @RadioPowerState int state)105 void notifyRadioPowerStateChanged(Phone sender, @RadioPowerState int state); 106 107 /** Notify of change to EmergencyNumberList. */ notifyEmergencyNumberList(Phone sender)108 void notifyEmergencyNumberList(Phone sender); 109 110 /** Notify of a change for Outgoing Emergency Sms. */ notifyOutgoingEmergencySms(Phone sender, EmergencyNumber emergencyNumber)111 void notifyOutgoingEmergencySms(Phone sender, EmergencyNumber emergencyNumber); 112 113 /** Notify of a change to the call quality of an active foreground call. */ notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType)114 void notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType); 115 116 /** Notify registration failed */ notifyRegistrationFailed(Phone sender, @NonNull CellIdentity cellIdentity, @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode)117 void notifyRegistrationFailed(Phone sender, @NonNull CellIdentity cellIdentity, 118 @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode); 119 120 /** Notify barring info has changed */ notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo)121 void notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo); 122 123 /** Notify of change to PhysicalChannelConfig. */ notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs)124 void notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs); 125 126 /** Notify DataEnabled has changed. */ notifyDataEnabled(Phone sender, boolean enabled, @DataEnabledReason int reason)127 void notifyDataEnabled(Phone sender, boolean enabled, @DataEnabledReason int reason); 128 129 /** Notify Allowed Network Type has changed. */ notifyAllowedNetworkTypesChanged(Phone sender, int reason, long allowedNetworkType)130 void notifyAllowedNetworkTypesChanged(Phone sender, int reason, long allowedNetworkType); 131 132 /** Notify link capacity estimate has changed. */ notifyLinkCapacityEstimateChanged(Phone sender, List<LinkCapacityEstimate> linkCapacityEstimateList)133 void notifyLinkCapacityEstimateChanged(Phone sender, 134 List<LinkCapacityEstimate> linkCapacityEstimateList); 135 } 136