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.os.Bundle; 23 import android.telephony.CallQuality; 24 import android.telephony.CellInfo; 25 import android.telephony.ims.ImsReasonInfo; 26 import android.telephony.PhoneCapability; 27 import android.telephony.PhysicalChannelConfig; 28 import android.telephony.ServiceState; 29 import android.telephony.SignalStrength; 30 import android.telephony.emergency.EmergencyNumber; 31 import com.android.internal.telephony.IPhoneStateListener; 32 import com.android.internal.telephony.IOnSubscriptionsChangedListener; 33 34 interface ITelephonyRegistry { addOnSubscriptionsChangedListener(String pkg, IOnSubscriptionsChangedListener callback)35 void addOnSubscriptionsChangedListener(String pkg, 36 IOnSubscriptionsChangedListener callback); addOnOpportunisticSubscriptionsChangedListener(String pkg, IOnSubscriptionsChangedListener callback)37 void addOnOpportunisticSubscriptionsChangedListener(String pkg, 38 IOnSubscriptionsChangedListener callback); removeOnSubscriptionsChangedListener(String pkg, IOnSubscriptionsChangedListener callback)39 void removeOnSubscriptionsChangedListener(String pkg, 40 IOnSubscriptionsChangedListener callback); 41 @UnsupportedAppUsage listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow)42 void listen(String pkg, IPhoneStateListener callback, int events, boolean notifyNow); listenForSubscriber(in int subId, String pkg, IPhoneStateListener callback, int events, boolean notifyNow)43 void listenForSubscriber(in int subId, String pkg, IPhoneStateListener callback, int events, 44 boolean notifyNow); 45 @UnsupportedAppUsage notifyCallState(int state, String incomingNumber)46 void notifyCallState(int state, String incomingNumber); notifyCallStateForPhoneId(in int phoneId, in int subId, int state, String incomingNumber)47 void notifyCallStateForPhoneId(in int phoneId, in int subId, int state, String incomingNumber); notifyServiceStateForPhoneId(in int phoneId, in int subId, in ServiceState state)48 void notifyServiceStateForPhoneId(in int phoneId, in int subId, in ServiceState state); notifySignalStrengthForPhoneId(in int phoneId, in int subId, in SignalStrength signalStrength)49 void notifySignalStrengthForPhoneId(in int phoneId, in int subId, 50 in SignalStrength signalStrength); notifyMessageWaitingChangedForPhoneId(in int phoneId, in int subId, in boolean mwi)51 void notifyMessageWaitingChangedForPhoneId(in int phoneId, in int subId, in boolean mwi); notifyCallForwardingChanged(boolean cfi)52 void notifyCallForwardingChanged(boolean cfi); notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi)53 void notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi); notifyDataActivity(int state)54 void notifyDataActivity(int state); notifyDataActivityForSubscriber(in int subId, int state)55 void notifyDataActivityForSubscriber(in int subId, int state); notifyDataConnection(int state, boolean isDataConnectivityPossible, String apn, String apnType, in LinkProperties linkProperties, in NetworkCapabilities networkCapabilities, int networkType, boolean roaming)56 void notifyDataConnection(int state, boolean isDataConnectivityPossible, 57 String apn, String apnType, in LinkProperties linkProperties, 58 in NetworkCapabilities networkCapabilities, int networkType, boolean roaming); notifyDataConnectionForSubscriber(int phoneId, int subId, int state, boolean isDataConnectivityPossible, String apn, String apnType, in LinkProperties linkProperties, in NetworkCapabilities networkCapabilities, int networkType, boolean roaming)59 void notifyDataConnectionForSubscriber(int phoneId, int subId, int state, 60 boolean isDataConnectivityPossible, 61 String apn, String apnType, in LinkProperties linkProperties, 62 in NetworkCapabilities networkCapabilities, int networkType, boolean roaming); 63 @UnsupportedAppUsage notifyDataConnectionFailed(String apnType)64 void notifyDataConnectionFailed(String apnType); notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType)65 void notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType); notifyCellLocation(in Bundle cellLocation)66 void notifyCellLocation(in Bundle cellLocation); notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation)67 void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation); notifyOtaspChanged(in int subId, in int otaspMode)68 void notifyOtaspChanged(in int subId, in int otaspMode); 69 @UnsupportedAppUsage notifyCellInfo(in List<CellInfo> cellInfo)70 void notifyCellInfo(in List<CellInfo> cellInfo); notifyPhysicalChannelConfiguration(in List<PhysicalChannelConfig> configs)71 void notifyPhysicalChannelConfiguration(in List<PhysicalChannelConfig> configs); notifyPhysicalChannelConfigurationForSubscriber(in int subId, in List<PhysicalChannelConfig> configs)72 void notifyPhysicalChannelConfigurationForSubscriber(in int subId, 73 in List<PhysicalChannelConfig> configs); notifyPreciseCallState(int phoneId, int subId, int ringingCallState, int foregroundCallState, int backgroundCallState)74 void notifyPreciseCallState(int phoneId, int subId, int ringingCallState, 75 int foregroundCallState, int backgroundCallState); notifyDisconnectCause(int phoneId, int subId, int disconnectCause, int preciseDisconnectCause)76 void notifyDisconnectCause(int phoneId, int subId, int disconnectCause, 77 int preciseDisconnectCause); notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType, String apn, int failCause)78 void notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType, String apn, 79 int failCause); notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo)80 void notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo); notifySrvccStateChanged(in int subId, in int lteState)81 void notifySrvccStateChanged(in int subId, in int lteState); notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId, int activationState, int activationType)82 void notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId, 83 int activationState, int activationType); notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData)84 void notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData); notifySubscriptionInfoChanged()85 void notifySubscriptionInfoChanged(); notifyOpportunisticSubscriptionInfoChanged()86 void notifyOpportunisticSubscriptionInfoChanged(); notifyCarrierNetworkChange(in boolean active)87 void notifyCarrierNetworkChange(in boolean active); notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state)88 void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state); notifyPhoneCapabilityChanged(in PhoneCapability capability)89 void notifyPhoneCapabilityChanged(in PhoneCapability capability); notifyActiveDataSubIdChanged(int activeDataSubId)90 void notifyActiveDataSubIdChanged(int activeDataSubId); notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state)91 void notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state); notifyEmergencyNumberList(in int phoneId, in int subId)92 void notifyEmergencyNumberList(in int phoneId, in int subId); notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId, int callNetworkType)93 void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId, 94 int callNetworkType); notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo)95 void notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo); 96 } 97