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