1 /* 2 * Copyright (C) 2007 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.content.Intent; 20 import android.net.LinkProperties; 21 import android.net.NetworkCapabilities; 22 import android.telephony.BarringInfo; 23 import android.telephony.CallQuality; 24 import android.telephony.CellIdentity; 25 import android.telephony.CellInfo; 26 import android.telephony.TelephonyDisplayInfo; 27 import android.telephony.ims.ImsReasonInfo; 28 import android.telephony.PhoneCapability; 29 import android.telephony.PhysicalChannelConfig; 30 import android.telephony.PreciseDataConnectionState; 31 import android.telephony.ServiceState; 32 import android.telephony.SignalStrength; 33 import android.telephony.emergency.EmergencyNumber; 34 import com.android.internal.telephony.IPhoneStateListener; 35 import com.android.internal.telephony.IOnSubscriptionsChangedListener; 36 37 interface ITelephonyRegistry { addOnSubscriptionsChangedListener(String pkg, String featureId, IOnSubscriptionsChangedListener callback)38 void addOnSubscriptionsChangedListener(String pkg, String featureId, 39 IOnSubscriptionsChangedListener callback); addOnOpportunisticSubscriptionsChangedListener(String pkg, String featureId, IOnSubscriptionsChangedListener callback)40 void addOnOpportunisticSubscriptionsChangedListener(String pkg, String featureId, 41 IOnSubscriptionsChangedListener callback); removeOnSubscriptionsChangedListener(String pkg, IOnSubscriptionsChangedListener callback)42 void removeOnSubscriptionsChangedListener(String pkg, 43 IOnSubscriptionsChangedListener callback); 44 /** 45 * @deprecated Use {@link #listenWithFeature(String, String, IPhoneStateListener, int, 46 * boolean) instead 47 */ 48 @UnsupportedAppUsage listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow)49 void listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow); listenWithFeature(String pkg, String featureId, IPhoneStateListener callback, int events, boolean notifyNow)50 void listenWithFeature(String pkg, String featureId, IPhoneStateListener callback, int events, 51 boolean notifyNow); listenForSubscriber(in int subId, String pkg, String featureId, IPhoneStateListener callback, int events, boolean notifyNow)52 void listenForSubscriber(in int subId, String pkg, String featureId, 53 IPhoneStateListener callback, int events, boolean notifyNow); 54 @UnsupportedAppUsage notifyCallStateForAllSubs(int state, String incomingNumber)55 void notifyCallStateForAllSubs(int state, String incomingNumber); notifyCallState(in int phoneId, in int subId, int state, String incomingNumber)56 void notifyCallState(in int phoneId, in int subId, int state, String incomingNumber); notifyServiceStateForPhoneId(in int phoneId, in int subId, in ServiceState state)57 void notifyServiceStateForPhoneId(in int phoneId, in int subId, in ServiceState state); notifySignalStrengthForPhoneId(in int phoneId, in int subId, in SignalStrength signalStrength)58 void notifySignalStrengthForPhoneId(in int phoneId, in int subId, 59 in SignalStrength signalStrength); notifyMessageWaitingChangedForPhoneId(in int phoneId, in int subId, in boolean mwi)60 void notifyMessageWaitingChangedForPhoneId(in int phoneId, in int subId, in boolean mwi); 61 @UnsupportedAppUsage(maxTargetSdk = 28) notifyCallForwardingChanged(boolean cfi)62 void notifyCallForwardingChanged(boolean cfi); notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi)63 void notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi); 64 @UnsupportedAppUsage(maxTargetSdk = 28) notifyDataActivity(int state)65 void notifyDataActivity(int state); notifyDataActivityForSubscriber(in int subId, int state)66 void notifyDataActivityForSubscriber(in int subId, int state); notifyDataConnectionForSubscriber( int phoneId, int subId, int apnType, in PreciseDataConnectionState preciseState)67 void notifyDataConnectionForSubscriber( 68 int phoneId, int subId, int apnType, in PreciseDataConnectionState preciseState); 69 @UnsupportedAppUsage notifyDataConnectionFailed(String apnType)70 void notifyDataConnectionFailed(String apnType); 71 // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client. notifyCellLocation(in CellIdentity cellLocation)72 void notifyCellLocation(in CellIdentity cellLocation); notifyCellLocationForSubscriber(in int subId, in CellIdentity cellLocation)73 void notifyCellLocationForSubscriber(in int subId, in CellIdentity cellLocation); 74 @UnsupportedAppUsage notifyCellInfo(in List<CellInfo> cellInfo)75 void notifyCellInfo(in List<CellInfo> cellInfo); notifyPreciseCallState(int phoneId, int subId, int ringingCallState, int foregroundCallState, int backgroundCallState)76 void notifyPreciseCallState(int phoneId, int subId, int ringingCallState, 77 int foregroundCallState, int backgroundCallState); notifyDisconnectCause(int phoneId, int subId, int disconnectCause, int preciseDisconnectCause)78 void notifyDisconnectCause(int phoneId, int subId, int disconnectCause, 79 int preciseDisconnectCause); notifyPreciseDataConnectionFailed(int phoneId, int subId, int apnType, String apn, int failCause)80 void notifyPreciseDataConnectionFailed(int phoneId, int subId, int apnType, String apn, 81 int failCause); notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo)82 void notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo); notifySrvccStateChanged(in int subId, in int lteState)83 void notifySrvccStateChanged(in int subId, in int lteState); notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId, int activationState, int activationType)84 void notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId, 85 int activationState, int activationType); notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData)86 void notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData); notifySubscriptionInfoChanged()87 void notifySubscriptionInfoChanged(); notifyOpportunisticSubscriptionInfoChanged()88 void notifyOpportunisticSubscriptionInfoChanged(); notifyCarrierNetworkChange(in boolean active)89 void notifyCarrierNetworkChange(in boolean active); notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state)90 void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state); notifyDisplayInfoChanged(int slotIndex, int subId, in TelephonyDisplayInfo telephonyDisplayInfo)91 void notifyDisplayInfoChanged(int slotIndex, int subId, in TelephonyDisplayInfo telephonyDisplayInfo); notifyPhoneCapabilityChanged(in PhoneCapability capability)92 void notifyPhoneCapabilityChanged(in PhoneCapability capability); notifyActiveDataSubIdChanged(int activeDataSubId)93 void notifyActiveDataSubIdChanged(int activeDataSubId); notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state)94 void notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state); notifyEmergencyNumberList(in int phoneId, in int subId)95 void notifyEmergencyNumberList(in int phoneId, in int subId); notifyOutgoingEmergencyCall(in int phoneId, in int subId, in EmergencyNumber emergencyNumber)96 void notifyOutgoingEmergencyCall(in int phoneId, in int subId, 97 in EmergencyNumber emergencyNumber); notifyOutgoingEmergencySms(in int phoneId, in int subId, in EmergencyNumber emergencyNumber)98 void notifyOutgoingEmergencySms(in int phoneId, in int subId, 99 in EmergencyNumber emergencyNumber); notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId, int callNetworkType)100 void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId, 101 int callNetworkType); notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo)102 void notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo); notifyRegistrationFailed(int slotIndex, int subId, in CellIdentity cellIdentity, String chosenPlmn, int domain, int causeCode, int additionalCauseCode)103 void notifyRegistrationFailed(int slotIndex, int subId, in CellIdentity cellIdentity, 104 String chosenPlmn, int domain, int causeCode, int additionalCauseCode); notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo)105 void notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo); 106 } 107