• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.CellularIdentifierDisclosure;
29 import android.telephony.LinkCapacityEstimate;
30 import android.telephony.NetworkRegistrationInfo;
31 import android.telephony.PhoneCapability;
32 import android.telephony.PhysicalChannelConfig;
33 import android.telephony.PreciseDataConnectionState;
34 import android.telephony.SecurityAlgorithmUpdate;
35 import android.telephony.ServiceState;
36 import android.telephony.TelephonyDisplayInfo;
37 import android.telephony.TelephonyManager.DataEnabledReason;
38 import android.telephony.TelephonyManager.EmergencyCallbackModeStopReason;
39 import android.telephony.TelephonyManager.EmergencyCallbackModeType;
40 import android.telephony.emergency.EmergencyNumber;
41 import android.telephony.ims.ImsReasonInfo;
42 import android.telephony.ims.MediaQualityStatus;
43 import android.telephony.satellite.NtnSignalStrength;
44 
45 import java.util.List;
46 import java.util.Set;
47 
48 /**
49  * {@hide}
50  */
51 public interface PhoneNotifier {
52 
notifyPhoneState(Phone sender)53     void notifyPhoneState(Phone sender);
54 
55     /**
56      * Notify registrants of the given phone's current ServiceState.
57      */
notifyServiceState(Phone sender)58     void notifyServiceState(Phone sender);
59 
60     /**
61      * Notify registrants with a given ServiceState. Passing in the subId allows us to
62      * send a final ServiceState update when the subId for the sender phone becomes invalid
63      * @param sender
64      * @param subId
65      */
notifyServiceStateForSubId(Phone sender, ServiceState ss, int subId)66     void notifyServiceStateForSubId(Phone sender, ServiceState ss, int subId);
67 
68     /**
69      * Notify registrants of the current CellLocation.
70      *
71      * <p>Use CellIdentity that is Parcellable to pass AIDL; convert to CellLocation in client code.
72      */
notifyCellLocation(Phone sender, CellIdentity cellIdentity)73     void notifyCellLocation(Phone sender, CellIdentity cellIdentity);
74 
75     @UnsupportedAppUsage
notifySignalStrength(Phone sender)76     void notifySignalStrength(Phone sender);
77 
78     @UnsupportedAppUsage
notifyMessageWaitingChanged(Phone sender)79     void notifyMessageWaitingChanged(Phone sender);
80 
notifyCallForwardingChanged(Phone sender)81     void notifyCallForwardingChanged(Phone sender);
82 
83     /** Send a notification that the Data Connection for a particular apnType has changed */
notifyDataConnection(Phone sender, PreciseDataConnectionState preciseState)84     void notifyDataConnection(Phone sender, PreciseDataConnectionState preciseState);
85 
notifyDataActivity(Phone sender)86     void notifyDataActivity(Phone sender);
87 
notifyCellInfo(Phone sender, List<CellInfo> cellInfo)88     void notifyCellInfo(Phone sender, List<CellInfo> cellInfo);
89 
90     /** Send a notification that precise call state changed. */
notifyPreciseCallState(Phone sender, String[] imsCallIds, @Annotation.ImsCallServiceType int[] imsCallServiceTypes, @Annotation.ImsCallType int[] imsCallTypes)91     void notifyPreciseCallState(Phone sender, String[] imsCallIds,
92             @Annotation.ImsCallServiceType int[] imsCallServiceTypes,
93             @Annotation.ImsCallType int[] imsCallTypes);
94 
notifyDisconnectCause(Phone sender, int cause, int preciseCause)95     void notifyDisconnectCause(Phone sender, int cause, int preciseCause);
96 
notifyImsDisconnectCause(Phone sender, ImsReasonInfo imsReasonInfo)97     void notifyImsDisconnectCause(Phone sender, ImsReasonInfo imsReasonInfo);
98 
99     /** Send a notification that the SRVCC state has changed.*/
notifySrvccStateChanged(Phone sender, @SrvccState int state)100     void notifySrvccStateChanged(Phone sender, @SrvccState int state);
101 
102     /** Send a notification that the voice activation state has changed */
notifyVoiceActivationStateChanged(Phone sender, int activationState)103     void notifyVoiceActivationStateChanged(Phone sender, int activationState);
104 
105     /** Send a notification that the data activation state has changed */
notifyDataActivationStateChanged(Phone sender, int activationState)106     void notifyDataActivationStateChanged(Phone sender, int activationState);
107 
108     /** Send a notification that the users mobile data setting has changed */
notifyUserMobileDataStateChanged(Phone sender, boolean state)109     void notifyUserMobileDataStateChanged(Phone sender, boolean state);
110 
111     /** Send a notification that the display info has changed */
notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo)112     void notifyDisplayInfoChanged(Phone sender, TelephonyDisplayInfo telephonyDisplayInfo);
113 
114     /** Send a notification that the phone capability has changed */
notifyPhoneCapabilityChanged(PhoneCapability capability)115     void notifyPhoneCapabilityChanged(PhoneCapability capability);
116 
notifyRadioPowerStateChanged(Phone sender, @RadioPowerState int state)117     void notifyRadioPowerStateChanged(Phone sender, @RadioPowerState int state);
118 
119     /** Notify of change to EmergencyNumberList. */
notifyEmergencyNumberList(Phone sender)120     void notifyEmergencyNumberList(Phone sender);
121 
122     /** Notify of a change for Outgoing Emergency Sms. */
notifyOutgoingEmergencySms(Phone sender, EmergencyNumber emergencyNumber)123     void notifyOutgoingEmergencySms(Phone sender, EmergencyNumber emergencyNumber);
124 
125     /** Notify of a change to the call quality of an active foreground call. */
notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType)126     void notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType);
127 
128     /** Notify of a change to the media quality status of an active foreground call. */
notifyMediaQualityStatusChanged(Phone sender, MediaQualityStatus status)129     void notifyMediaQualityStatusChanged(Phone sender, MediaQualityStatus status);
130 
131     /** Notify registration failed */
notifyRegistrationFailed(Phone sender, @NonNull CellIdentity cellIdentity, @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode)132     void notifyRegistrationFailed(Phone sender, @NonNull CellIdentity cellIdentity,
133             @NonNull String chosenPlmn, int domain, int causeCode, int additionalCauseCode);
134 
135     /** Notify barring info has changed */
notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo)136     void notifyBarringInfoChanged(Phone sender, @NonNull BarringInfo barringInfo);
137 
138     /** Notify of change to PhysicalChannelConfig. */
notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs)139     void notifyPhysicalChannelConfig(Phone sender, List<PhysicalChannelConfig> configs);
140 
141     /** Notify DataEnabled has changed. */
notifyDataEnabled(Phone sender, boolean enabled, @DataEnabledReason int reason)142     void notifyDataEnabled(Phone sender, boolean enabled, @DataEnabledReason int reason);
143 
144     /** Notify Allowed Network Type has changed. */
notifyAllowedNetworkTypesChanged(Phone sender, int reason, long allowedNetworkType)145     void notifyAllowedNetworkTypesChanged(Phone sender, int reason, long allowedNetworkType);
146 
147     /** Notify link capacity estimate has changed. */
notifyLinkCapacityEstimateChanged(Phone sender, List<LinkCapacityEstimate> linkCapacityEstimateList)148     void notifyLinkCapacityEstimateChanged(Phone sender,
149             List<LinkCapacityEstimate> linkCapacityEstimateList);
150 
151     /** Notify callback mode started. */
notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis)152     void notifyCallbackModeStarted(Phone sender, @EmergencyCallbackModeType int type,
153             long durationMillis);
154 
155     /** Notify callback mode restarted. */
notifyCallbackModeRestarted(Phone sender, @EmergencyCallbackModeType int type, long durationMillis)156     void notifyCallbackModeRestarted(Phone sender, @EmergencyCallbackModeType int type,
157             long durationMillis);
158 
159     /** Notify callback mode stopped. */
notifyCallbackModeStopped(Phone sender, @EmergencyCallbackModeType int type, @EmergencyCallbackModeStopReason int reason)160     void notifyCallbackModeStopped(Phone sender, @EmergencyCallbackModeType int type,
161             @EmergencyCallbackModeStopReason int reason);
162 
163     /** Notify that simultaneous cellular calling subscriptions have changed */
notifySimultaneousCellularCallingSubscriptionsChanged(Set<Integer> subIds)164     void notifySimultaneousCellularCallingSubscriptionsChanged(Set<Integer> subIds);
165 
166     /** Notify carrier roaming non-terrestrial network mode changed. **/
notifyCarrierRoamingNtnModeChanged(Phone sender, boolean active)167     void notifyCarrierRoamingNtnModeChanged(Phone sender, boolean active);
168 
169     /** Notify eligibility to connect to carrier roaming non-terrestrial network changed. */
notifyCarrierRoamingNtnEligibleStateChanged(Phone sender, boolean eligible)170     void notifyCarrierRoamingNtnEligibleStateChanged(Phone sender, boolean eligible);
171 
172     /** Notify carrier roaming non-terrestrial available services changed. */
notifyCarrierRoamingNtnAvailableServicesChanged( Phone sender, @NetworkRegistrationInfo.ServiceType int[] availableServices)173     void notifyCarrierRoamingNtnAvailableServicesChanged(
174             Phone sender, @NetworkRegistrationInfo.ServiceType int[] availableServices);
175 
176     /** Notify carrier roaming non-terrestrial network signal strength changed. */
notifyCarrierRoamingNtnSignalStrengthChanged(Phone sender, @NonNull NtnSignalStrength ntnSignalStrength)177     void notifyCarrierRoamingNtnSignalStrengthChanged(Phone sender,
178             @NonNull NtnSignalStrength ntnSignalStrength);
179 
180     /** Notify of a cellular identifier disclosure change. */
notifyCellularIdentifierDisclosedChanged(Phone sender, CellularIdentifierDisclosure disclosure)181     void notifyCellularIdentifierDisclosedChanged(Phone sender,
182             CellularIdentifierDisclosure disclosure);
183 
184     /** Notify of a security algorithm update change. */
notifySecurityAlgorithmsChanged(Phone sender, SecurityAlgorithmUpdate update)185     void notifySecurityAlgorithmsChanged(Phone sender, SecurityAlgorithmUpdate update);
186 }
187