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, String apnType, in PreciseDataConnectionState preciseState)67 void notifyDataConnectionForSubscriber( 68 int phoneId, int subId, String apnType, in PreciseDataConnectionState preciseState); 69 @UnsupportedAppUsage notifyDataConnectionFailed(String apnType)70 void notifyDataConnectionFailed(String apnType); notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType)71 void notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType); 72 // Uses CellIdentity which is Parcelable here; will convert to CellLocation in client. notifyCellLocation(in CellIdentity cellLocation)73 void notifyCellLocation(in CellIdentity cellLocation); notifyCellLocationForSubscriber(in int subId, in CellIdentity cellLocation)74 void notifyCellLocationForSubscriber(in int subId, in CellIdentity cellLocation); 75 @UnsupportedAppUsage notifyCellInfo(in List<CellInfo> cellInfo)76 void notifyCellInfo(in List<CellInfo> cellInfo); notifyPreciseCallState(int phoneId, int subId, int ringingCallState, int foregroundCallState, int backgroundCallState)77 void notifyPreciseCallState(int phoneId, int subId, int ringingCallState, 78 int foregroundCallState, int backgroundCallState); notifyDisconnectCause(int phoneId, int subId, int disconnectCause, int preciseDisconnectCause)79 void notifyDisconnectCause(int phoneId, int subId, int disconnectCause, 80 int preciseDisconnectCause); notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType, String apn, int failCause)81 void notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType, String apn, 82 int failCause); notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo)83 void notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo); notifySrvccStateChanged(in int subId, in int lteState)84 void notifySrvccStateChanged(in int subId, in int lteState); notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId, int activationState, int activationType)85 void notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId, 86 int activationState, int activationType); notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData)87 void notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData); notifySubscriptionInfoChanged()88 void notifySubscriptionInfoChanged(); notifyOpportunisticSubscriptionInfoChanged()89 void notifyOpportunisticSubscriptionInfoChanged(); notifyCarrierNetworkChange(in boolean active)90 void notifyCarrierNetworkChange(in boolean active); notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state)91 void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state); notifyDisplayInfoChanged(int slotIndex, int subId, in TelephonyDisplayInfo telephonyDisplayInfo)92 void notifyDisplayInfoChanged(int slotIndex, int subId, in TelephonyDisplayInfo telephonyDisplayInfo); notifyPhoneCapabilityChanged(in PhoneCapability capability)93 void notifyPhoneCapabilityChanged(in PhoneCapability capability); notifyActiveDataSubIdChanged(int activeDataSubId)94 void notifyActiveDataSubIdChanged(int activeDataSubId); notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state)95 void notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state); notifyEmergencyNumberList(in int phoneId, in int subId)96 void notifyEmergencyNumberList(in int phoneId, in int subId); notifyOutgoingEmergencyCall(in int phoneId, in int subId, in EmergencyNumber emergencyNumber)97 void notifyOutgoingEmergencyCall(in int phoneId, in int subId, 98 in EmergencyNumber emergencyNumber); notifyOutgoingEmergencySms(in int phoneId, in int subId, in EmergencyNumber emergencyNumber)99 void notifyOutgoingEmergencySms(in int phoneId, in int subId, 100 in EmergencyNumber emergencyNumber); notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId, int callNetworkType)101 void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId, 102 int callNetworkType); notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo)103 void notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo); notifyRegistrationFailed(int slotIndex, int subId, in CellIdentity cellIdentity, String chosenPlmn, int domain, int causeCode, int additionalCauseCode)104 void notifyRegistrationFailed(int slotIndex, int subId, in CellIdentity cellIdentity, 105 String chosenPlmn, int domain, int causeCode, int additionalCauseCode); notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo)106 void notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo); 107 } 108