Loading src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +78 −188 Original line number Diff line number Diff line Loading @@ -18,11 +18,13 @@ package com.android.internal.telephony; import android.annotation.NonNull; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.os.telephony.TelephonyRegistryManager; import android.telephony.CallQuality; import android.telephony.CellInfo; import android.telephony.CellLocation; Loading @@ -38,21 +40,27 @@ import android.telephony.data.ApnSetting; import android.telephony.emergency.EmergencyNumber; import android.telephony.ims.ImsReasonInfo; import com.android.internal.telephony.PhoneInternalInterface.DataActivityState; import java.util.List; /** * broadcast intents */ public class DefaultPhoneNotifier implements PhoneNotifier { private static final String LOG_TAG = "DefaultPhoneNotifier"; private static final boolean DBG = false; // STOPSHIP if true @UnsupportedAppUsage protected ITelephonyRegistry mRegistry; private TelephonyRegistryManager mTelephonyRegistryMgr; public DefaultPhoneNotifier() { public DefaultPhoneNotifier(Context context) { mRegistry = ITelephonyRegistry.Stub.asInterface(ServiceManager.getService( "telephony.registry")); mTelephonyRegistryMgr = (TelephonyRegistryManager) context.getSystemService( Context.TELEPHONY_REGISTRY_SERVICE); } @Override Loading @@ -64,15 +72,8 @@ public class DefaultPhoneNotifier implements PhoneNotifier { if (ringingCall != null && ringingCall.getEarliestConnection() != null) { incomingNumber = ringingCall.getEarliestConnection().getAddress(); } try { if (mRegistry != null) { mRegistry.notifyCallStateForPhoneId(phoneId, subId, PhoneConstantConversions.convertCallState( sender.getState()), incomingNumber); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyCallStateChanged(subId, phoneId, PhoneConstantConversions.convertCallState(sender.getState()), incomingNumber); } @Override Loading @@ -87,13 +88,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier { ss = new ServiceState(); ss.setStateOutOfService(); } try { if (mRegistry != null) { mRegistry.notifyServiceStateForPhoneId(phoneId, subId, ss); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyServiceStateChanged(subId, phoneId, ss); } @Override Loading @@ -105,58 +100,35 @@ public class DefaultPhoneNotifier implements PhoneNotifier { Rlog.d(LOG_TAG, "notifySignalStrength: mRegistry=" + mRegistry + " ss=" + sender.getSignalStrength() + " sender=" + sender); } try { if (mRegistry != null) { mRegistry.notifySignalStrengthForPhoneId(phoneId, subId, mTelephonyRegistryMgr.notifySignalStrengthChanged(subId, phoneId, sender.getSignalStrength()); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyMessageWaitingChanged(Phone sender) { int phoneId = sender.getPhoneId(); int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyMessageWaitingChangedForPhoneId(phoneId, subId, mTelephonyRegistryMgr.notifyMessageWaitingChanged(subId, phoneId, sender.getMessageWaitingIndicator()); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyCallForwardingChanged(Phone sender) { int subId = sender.getSubId(); try { if (mRegistry != null) { Rlog.d(LOG_TAG, "notifyCallForwardingChanged: subId=" + subId + ", isCFActive=" + sender.getCallForwardingIndicator()); mRegistry.notifyCallForwardingChangedForSubscriber(subId, mTelephonyRegistryMgr.notifyCallForwardingChanged(subId, sender.getCallForwardingIndicator()); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyDataActivity(Phone sender) { int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyDataActivityForSubscriber(subId, mTelephonyRegistryMgr.notifyDataActivityChanged(subId, convertDataActivityState(sender.getDataActivityState())); } } catch (RemoteException ex) { // system process is dead } } @Override Loading @@ -170,7 +142,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { int subId = sender.getSubId(); int phoneId = sender.getPhoneId(); long dds = SubscriptionManager.getDefaultDataSubscriptionId(); if (DBG) log("subId = " + subId + ", DDS = " + dds); if (DBG) { log("subId = " + subId + ", DDS = " + dds); } // TODO // use apnType as the key to which connection we're talking about. Loading @@ -185,11 +159,10 @@ public class DefaultPhoneNotifier implements PhoneNotifier { networkCapabilities = sender.getNetworkCapabilities(apnType); } ServiceState ss = sender.getServiceState(); if (ss != null) roaming = ss.getDataRoaming(); try { if (mRegistry != null) { mRegistry.notifyDataConnectionForSubscriber(phoneId, subId, if (ss != null) { roaming = ss.getDataRoaming(); } mTelephonyRegistryMgr.notifyDataConnectionForSubscriber(phoneId, subId, PhoneConstantConversions.convertDataState(state), sender.isDataAllowed(ApnSetting.getApnTypesBitmaskFromString(apnType)), sender.getActiveApnHost(apnType), Loading @@ -199,21 +172,11 @@ public class DefaultPhoneNotifier implements PhoneNotifier { ((telephony != null) ? telephony.getDataNetworkType(subId) : TelephonyManager.NETWORK_TYPE_UNKNOWN), roaming); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyDataConnectionFailed(Phone sender, String apnType) { try { if (mRegistry != null) { mRegistry.notifyDataConnectionFailedForSubscriber(sender.getPhoneId(), sender.getSubId(), apnType); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyDataConnectionFailed(sender.getSubId(), sender.getPhoneId(), apnType); } @Override Loading @@ -221,25 +184,13 @@ public class DefaultPhoneNotifier implements PhoneNotifier { int subId = sender.getSubId(); Bundle data = new Bundle(); cl.fillInNotifierBundle(data); try { if (mRegistry != null) { mRegistry.notifyCellLocationForSubscriber(subId, data); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyCellLocation(subId, data); } @Override public void notifyCellInfo(Phone sender, List<CellInfo> cellInfo) { int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyCellInfoForSubscriber(subId, cellInfo); } } catch (RemoteException ex) { } mTelephonyRegistryMgr.notifyCellInfoChanged(subId, cellInfo); } @Override Loading @@ -259,13 +210,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier { @Override public void notifyOtaspChanged(Phone sender, int otaspMode) { int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyOtaspChanged(subId, otaspMode); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyOtaspChanged(subId, otaspMode); } public void notifyPreciseCallState(Phone sender) { Loading @@ -273,122 +218,73 @@ public class DefaultPhoneNotifier implements PhoneNotifier { Call foregroundCall = sender.getForegroundCall(); Call backgroundCall = sender.getBackgroundCall(); if (ringingCall != null && foregroundCall != null && backgroundCall != null) { try { mRegistry.notifyPreciseCallState(sender.getPhoneId(), sender.getSubId(), mTelephonyRegistryMgr.notifyPreciseCallState(sender.getSubId(), sender.getPhoneId(), convertPreciseCallState(ringingCall.getState()), convertPreciseCallState(foregroundCall.getState()), convertPreciseCallState(backgroundCall.getState())); } catch (RemoteException ex) { // system process is dead } } } public void notifyDisconnectCause(Phone sender, int cause, int preciseCause) { try { mRegistry.notifyDisconnectCause(sender.getPhoneId(), sender.getSubId(), cause, mTelephonyRegistryMgr.notifyDisconnectCause(sender.getSubId(), sender.getPhoneId(), cause, preciseCause); } catch (RemoteException ex) { // system process is dead } } @Override public void notifyImsDisconnectCause(@NonNull Phone sender, ImsReasonInfo imsReasonInfo) { try { mRegistry.notifyImsDisconnectCause(sender.getSubId(), imsReasonInfo); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyImsDisconnectCause(sender.getSubId(), imsReasonInfo); } public void notifyPreciseDataConnectionFailed(Phone sender, String apnType, String apn, @DataFailCause.FailCause int failCause) { try { mRegistry.notifyPreciseDataConnectionFailed(sender.getPhoneId(), sender.getSubId(), apnType, apn, failCause); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyPreciseDataConnectionFailed(sender.getSubId(), sender.getPhoneId(), apnType, apn, failCause); } @Override public void notifySrvccStateChanged(Phone sender, @TelephonyManager.SrvccState int state) { try { mRegistry.notifySrvccStateChanged(sender.getSubId(), state); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifySrvccStateChanged(sender.getSubId(), state); } @Override public void notifyDataActivationStateChanged(Phone sender, int activationState) { try { mRegistry.notifySimActivationStateChangedForPhoneId(sender.getPhoneId(), sender.getSubId(), PhoneConstants.SIM_ACTIVATION_TYPE_DATA, activationState); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyDataActivationStateChanged(sender.getSubId(), sender.getPhoneId(), activationState); } @Override public void notifyVoiceActivationStateChanged(Phone sender, int activationState) { try { mRegistry.notifySimActivationStateChangedForPhoneId(sender.getPhoneId(), sender.getSubId(), PhoneConstants.SIM_ACTIVATION_TYPE_VOICE, activationState); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyVoiceActivationStateChanged(sender.getSubId(), sender.getPhoneId(), activationState); } @Override public void notifyUserMobileDataStateChanged(Phone sender, boolean state) { try { mRegistry.notifyUserMobileDataStateChangedForPhoneId( sender.getPhoneId(), sender.getSubId(), state); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyUserMobileDataStateChanged( sender.getSubId(), sender.getPhoneId(), state); } @Override public void notifyOemHookRawEventForSubscriber(Phone sender, byte[] rawData) { try { mRegistry.notifyOemHookRawEventForSubscriber(sender.getPhoneId(), sender.getSubId(), rawData); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyOemHookRawEventForSubscriber(sender.getSubId(), sender.getPhoneId(), rawData); } @Override public void notifyPhoneCapabilityChanged(PhoneCapability capability) { try { mRegistry.notifyPhoneCapabilityChanged(capability); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyPhoneCapabilityChanged(capability); } @Override public void notifyRadioPowerStateChanged(Phone sender, @TelephonyManager.RadioPowerState int state) { try { mRegistry.notifyRadioPowerStateChanged(sender.getPhoneId(), sender.getSubId(), state); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyRadioPowerStateChanged(sender.getSubId(), sender.getPhoneId(), state); } @Override public void notifyEmergencyNumberList(Phone sender) { try { if (mRegistry != null) { mRegistry.notifyEmergencyNumberList(sender.getPhoneId(), sender.getSubId()); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyEmergencyNumberList(sender.getSubId(), sender.getPhoneId()); } @Override Loading Loading @@ -418,21 +314,15 @@ public class DefaultPhoneNotifier implements PhoneNotifier { @Override public void notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType) { try { if (mRegistry != null) { mRegistry.notifyCallQualityChanged(callQuality, sender.getPhoneId(), sender.getSubId(), callNetworkType); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyCallQualityChanged(sender.getSubId(), sender.getPhoneId(), callQuality, callNetworkType); } /** * Convert the {@link Phone.DataActivityState} enum into the TelephonyManager.DATA_* constants * for the public API. * Convert the {@link DataActivityState} enum into the TelephonyManager.DATA_* constants for the * public API. */ public static int convertDataActivityState(Phone.DataActivityState state) { public static int convertDataActivityState(DataActivityState state) { switch (state) { case DATAIN: return TelephonyManager.DATA_ACTIVITY_IN; Loading src/java/com/android/internal/telephony/Phone.java +0 −1 Original line number Diff line number Diff line Loading @@ -581,7 +581,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) { mCi.registerForSrvccStateChanged(this, EVENT_SRVCC_STATE_CHANGED, null); } mCi.setOnUnsolOemHookRaw(this, EVENT_UNSOL_OEM_HOOK_RAW, null); mCi.startLceService(DEFAULT_REPORT_INTERVAL_MS, LCE_PULL_MODE, obtainMessage(EVENT_CONFIG_LCE)); } Loading src/java/com/android/internal/telephony/PhoneConfigurationManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ public class PhoneConfigurationManager { } private void notifyCapabilityChanged() { PhoneNotifier notifier = new DefaultPhoneNotifier(); PhoneNotifier notifier = new DefaultPhoneNotifier(mContext); notifier.notifyPhoneCapabilityChanged(mStaticCapability); } Loading src/java/com/android/internal/telephony/PhoneFactory.java +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ public class PhoneFactory { } } sPhoneNotifier = new DefaultPhoneNotifier(); sPhoneNotifier = new DefaultPhoneNotifier(context); int cdmaSubscription = CdmaSubscriptionSourceManager.getDefault(context); Rlog.i(LOG_TAG, "Cdma Subscription set to " + cdmaSubscription); Loading tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java +5 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import android.os.IInterface; import android.os.PersistableBundle; import android.os.UserHandle; import android.os.UserManager; import android.os.telephony.TelephonyRegistryManager; import android.preference.PreferenceManager; import android.provider.Settings; import android.provider.Telephony.ServiceStateTable; Loading Loading @@ -247,6 +248,8 @@ public class ContextFixture implements TestFixture<Context> { return mTelecomManager; case Context.DOWNLOAD_SERVICE: return mDownloadManager; case Context.TELEPHONY_REGISTRY_SERVICE: return mTelephonyRegistryManager; case Context.DISPLAY_SERVICE: case Context.POWER_SERVICE: // PowerManager and DisplayManager are final classes so cannot be mocked, Loading Loading @@ -569,6 +572,8 @@ public class ContextFixture implements TestFixture<Context> { private final EuiccManager mEuiccManager = mock(EuiccManager.class); private final TelecomManager mTelecomManager = mock(TelecomManager.class); private final PackageInfo mPackageInfo = mock(PackageInfo.class); private final TelephonyRegistryManager mTelephonyRegistryManager = mock(TelephonyRegistryManager.class); private final ContentProvider mContentProvider = spy(new FakeContentProvider()); Loading Loading
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +78 −188 Original line number Diff line number Diff line Loading @@ -18,11 +18,13 @@ package com.android.internal.telephony; import android.annotation.NonNull; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.os.telephony.TelephonyRegistryManager; import android.telephony.CallQuality; import android.telephony.CellInfo; import android.telephony.CellLocation; Loading @@ -38,21 +40,27 @@ import android.telephony.data.ApnSetting; import android.telephony.emergency.EmergencyNumber; import android.telephony.ims.ImsReasonInfo; import com.android.internal.telephony.PhoneInternalInterface.DataActivityState; import java.util.List; /** * broadcast intents */ public class DefaultPhoneNotifier implements PhoneNotifier { private static final String LOG_TAG = "DefaultPhoneNotifier"; private static final boolean DBG = false; // STOPSHIP if true @UnsupportedAppUsage protected ITelephonyRegistry mRegistry; private TelephonyRegistryManager mTelephonyRegistryMgr; public DefaultPhoneNotifier() { public DefaultPhoneNotifier(Context context) { mRegistry = ITelephonyRegistry.Stub.asInterface(ServiceManager.getService( "telephony.registry")); mTelephonyRegistryMgr = (TelephonyRegistryManager) context.getSystemService( Context.TELEPHONY_REGISTRY_SERVICE); } @Override Loading @@ -64,15 +72,8 @@ public class DefaultPhoneNotifier implements PhoneNotifier { if (ringingCall != null && ringingCall.getEarliestConnection() != null) { incomingNumber = ringingCall.getEarliestConnection().getAddress(); } try { if (mRegistry != null) { mRegistry.notifyCallStateForPhoneId(phoneId, subId, PhoneConstantConversions.convertCallState( sender.getState()), incomingNumber); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyCallStateChanged(subId, phoneId, PhoneConstantConversions.convertCallState(sender.getState()), incomingNumber); } @Override Loading @@ -87,13 +88,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier { ss = new ServiceState(); ss.setStateOutOfService(); } try { if (mRegistry != null) { mRegistry.notifyServiceStateForPhoneId(phoneId, subId, ss); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyServiceStateChanged(subId, phoneId, ss); } @Override Loading @@ -105,58 +100,35 @@ public class DefaultPhoneNotifier implements PhoneNotifier { Rlog.d(LOG_TAG, "notifySignalStrength: mRegistry=" + mRegistry + " ss=" + sender.getSignalStrength() + " sender=" + sender); } try { if (mRegistry != null) { mRegistry.notifySignalStrengthForPhoneId(phoneId, subId, mTelephonyRegistryMgr.notifySignalStrengthChanged(subId, phoneId, sender.getSignalStrength()); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyMessageWaitingChanged(Phone sender) { int phoneId = sender.getPhoneId(); int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyMessageWaitingChangedForPhoneId(phoneId, subId, mTelephonyRegistryMgr.notifyMessageWaitingChanged(subId, phoneId, sender.getMessageWaitingIndicator()); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyCallForwardingChanged(Phone sender) { int subId = sender.getSubId(); try { if (mRegistry != null) { Rlog.d(LOG_TAG, "notifyCallForwardingChanged: subId=" + subId + ", isCFActive=" + sender.getCallForwardingIndicator()); mRegistry.notifyCallForwardingChangedForSubscriber(subId, mTelephonyRegistryMgr.notifyCallForwardingChanged(subId, sender.getCallForwardingIndicator()); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyDataActivity(Phone sender) { int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyDataActivityForSubscriber(subId, mTelephonyRegistryMgr.notifyDataActivityChanged(subId, convertDataActivityState(sender.getDataActivityState())); } } catch (RemoteException ex) { // system process is dead } } @Override Loading @@ -170,7 +142,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { int subId = sender.getSubId(); int phoneId = sender.getPhoneId(); long dds = SubscriptionManager.getDefaultDataSubscriptionId(); if (DBG) log("subId = " + subId + ", DDS = " + dds); if (DBG) { log("subId = " + subId + ", DDS = " + dds); } // TODO // use apnType as the key to which connection we're talking about. Loading @@ -185,11 +159,10 @@ public class DefaultPhoneNotifier implements PhoneNotifier { networkCapabilities = sender.getNetworkCapabilities(apnType); } ServiceState ss = sender.getServiceState(); if (ss != null) roaming = ss.getDataRoaming(); try { if (mRegistry != null) { mRegistry.notifyDataConnectionForSubscriber(phoneId, subId, if (ss != null) { roaming = ss.getDataRoaming(); } mTelephonyRegistryMgr.notifyDataConnectionForSubscriber(phoneId, subId, PhoneConstantConversions.convertDataState(state), sender.isDataAllowed(ApnSetting.getApnTypesBitmaskFromString(apnType)), sender.getActiveApnHost(apnType), Loading @@ -199,21 +172,11 @@ public class DefaultPhoneNotifier implements PhoneNotifier { ((telephony != null) ? telephony.getDataNetworkType(subId) : TelephonyManager.NETWORK_TYPE_UNKNOWN), roaming); } } catch (RemoteException ex) { // system process is dead } } @Override public void notifyDataConnectionFailed(Phone sender, String apnType) { try { if (mRegistry != null) { mRegistry.notifyDataConnectionFailedForSubscriber(sender.getPhoneId(), sender.getSubId(), apnType); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyDataConnectionFailed(sender.getSubId(), sender.getPhoneId(), apnType); } @Override Loading @@ -221,25 +184,13 @@ public class DefaultPhoneNotifier implements PhoneNotifier { int subId = sender.getSubId(); Bundle data = new Bundle(); cl.fillInNotifierBundle(data); try { if (mRegistry != null) { mRegistry.notifyCellLocationForSubscriber(subId, data); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyCellLocation(subId, data); } @Override public void notifyCellInfo(Phone sender, List<CellInfo> cellInfo) { int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyCellInfoForSubscriber(subId, cellInfo); } } catch (RemoteException ex) { } mTelephonyRegistryMgr.notifyCellInfoChanged(subId, cellInfo); } @Override Loading @@ -259,13 +210,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier { @Override public void notifyOtaspChanged(Phone sender, int otaspMode) { int subId = sender.getSubId(); try { if (mRegistry != null) { mRegistry.notifyOtaspChanged(subId, otaspMode); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyOtaspChanged(subId, otaspMode); } public void notifyPreciseCallState(Phone sender) { Loading @@ -273,122 +218,73 @@ public class DefaultPhoneNotifier implements PhoneNotifier { Call foregroundCall = sender.getForegroundCall(); Call backgroundCall = sender.getBackgroundCall(); if (ringingCall != null && foregroundCall != null && backgroundCall != null) { try { mRegistry.notifyPreciseCallState(sender.getPhoneId(), sender.getSubId(), mTelephonyRegistryMgr.notifyPreciseCallState(sender.getSubId(), sender.getPhoneId(), convertPreciseCallState(ringingCall.getState()), convertPreciseCallState(foregroundCall.getState()), convertPreciseCallState(backgroundCall.getState())); } catch (RemoteException ex) { // system process is dead } } } public void notifyDisconnectCause(Phone sender, int cause, int preciseCause) { try { mRegistry.notifyDisconnectCause(sender.getPhoneId(), sender.getSubId(), cause, mTelephonyRegistryMgr.notifyDisconnectCause(sender.getSubId(), sender.getPhoneId(), cause, preciseCause); } catch (RemoteException ex) { // system process is dead } } @Override public void notifyImsDisconnectCause(@NonNull Phone sender, ImsReasonInfo imsReasonInfo) { try { mRegistry.notifyImsDisconnectCause(sender.getSubId(), imsReasonInfo); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyImsDisconnectCause(sender.getSubId(), imsReasonInfo); } public void notifyPreciseDataConnectionFailed(Phone sender, String apnType, String apn, @DataFailCause.FailCause int failCause) { try { mRegistry.notifyPreciseDataConnectionFailed(sender.getPhoneId(), sender.getSubId(), apnType, apn, failCause); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyPreciseDataConnectionFailed(sender.getSubId(), sender.getPhoneId(), apnType, apn, failCause); } @Override public void notifySrvccStateChanged(Phone sender, @TelephonyManager.SrvccState int state) { try { mRegistry.notifySrvccStateChanged(sender.getSubId(), state); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifySrvccStateChanged(sender.getSubId(), state); } @Override public void notifyDataActivationStateChanged(Phone sender, int activationState) { try { mRegistry.notifySimActivationStateChangedForPhoneId(sender.getPhoneId(), sender.getSubId(), PhoneConstants.SIM_ACTIVATION_TYPE_DATA, activationState); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyDataActivationStateChanged(sender.getSubId(), sender.getPhoneId(), activationState); } @Override public void notifyVoiceActivationStateChanged(Phone sender, int activationState) { try { mRegistry.notifySimActivationStateChangedForPhoneId(sender.getPhoneId(), sender.getSubId(), PhoneConstants.SIM_ACTIVATION_TYPE_VOICE, activationState); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyVoiceActivationStateChanged(sender.getSubId(), sender.getPhoneId(), activationState); } @Override public void notifyUserMobileDataStateChanged(Phone sender, boolean state) { try { mRegistry.notifyUserMobileDataStateChangedForPhoneId( sender.getPhoneId(), sender.getSubId(), state); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyUserMobileDataStateChanged( sender.getSubId(), sender.getPhoneId(), state); } @Override public void notifyOemHookRawEventForSubscriber(Phone sender, byte[] rawData) { try { mRegistry.notifyOemHookRawEventForSubscriber(sender.getPhoneId(), sender.getSubId(), rawData); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyOemHookRawEventForSubscriber(sender.getSubId(), sender.getPhoneId(), rawData); } @Override public void notifyPhoneCapabilityChanged(PhoneCapability capability) { try { mRegistry.notifyPhoneCapabilityChanged(capability); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyPhoneCapabilityChanged(capability); } @Override public void notifyRadioPowerStateChanged(Phone sender, @TelephonyManager.RadioPowerState int state) { try { mRegistry.notifyRadioPowerStateChanged(sender.getPhoneId(), sender.getSubId(), state); } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyRadioPowerStateChanged(sender.getSubId(), sender.getPhoneId(), state); } @Override public void notifyEmergencyNumberList(Phone sender) { try { if (mRegistry != null) { mRegistry.notifyEmergencyNumberList(sender.getPhoneId(), sender.getSubId()); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyEmergencyNumberList(sender.getSubId(), sender.getPhoneId()); } @Override Loading Loading @@ -418,21 +314,15 @@ public class DefaultPhoneNotifier implements PhoneNotifier { @Override public void notifyCallQualityChanged(Phone sender, CallQuality callQuality, int callNetworkType) { try { if (mRegistry != null) { mRegistry.notifyCallQualityChanged(callQuality, sender.getPhoneId(), sender.getSubId(), callNetworkType); } } catch (RemoteException ex) { // system process is dead } mTelephonyRegistryMgr.notifyCallQualityChanged(sender.getSubId(), sender.getPhoneId(), callQuality, callNetworkType); } /** * Convert the {@link Phone.DataActivityState} enum into the TelephonyManager.DATA_* constants * for the public API. * Convert the {@link DataActivityState} enum into the TelephonyManager.DATA_* constants for the * public API. */ public static int convertDataActivityState(Phone.DataActivityState state) { public static int convertDataActivityState(DataActivityState state) { switch (state) { case DATAIN: return TelephonyManager.DATA_ACTIVITY_IN; Loading
src/java/com/android/internal/telephony/Phone.java +0 −1 Original line number Diff line number Diff line Loading @@ -581,7 +581,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) { mCi.registerForSrvccStateChanged(this, EVENT_SRVCC_STATE_CHANGED, null); } mCi.setOnUnsolOemHookRaw(this, EVENT_UNSOL_OEM_HOOK_RAW, null); mCi.startLceService(DEFAULT_REPORT_INTERVAL_MS, LCE_PULL_MODE, obtainMessage(EVENT_CONFIG_LCE)); } Loading
src/java/com/android/internal/telephony/PhoneConfigurationManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,7 @@ public class PhoneConfigurationManager { } private void notifyCapabilityChanged() { PhoneNotifier notifier = new DefaultPhoneNotifier(); PhoneNotifier notifier = new DefaultPhoneNotifier(mContext); notifier.notifyPhoneCapabilityChanged(mStaticCapability); } Loading
src/java/com/android/internal/telephony/PhoneFactory.java +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ public class PhoneFactory { } } sPhoneNotifier = new DefaultPhoneNotifier(); sPhoneNotifier = new DefaultPhoneNotifier(context); int cdmaSubscription = CdmaSubscriptionSourceManager.getDefault(context); Rlog.i(LOG_TAG, "Cdma Subscription set to " + cdmaSubscription); Loading
tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java +5 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import android.os.IInterface; import android.os.PersistableBundle; import android.os.UserHandle; import android.os.UserManager; import android.os.telephony.TelephonyRegistryManager; import android.preference.PreferenceManager; import android.provider.Settings; import android.provider.Telephony.ServiceStateTable; Loading Loading @@ -247,6 +248,8 @@ public class ContextFixture implements TestFixture<Context> { return mTelecomManager; case Context.DOWNLOAD_SERVICE: return mDownloadManager; case Context.TELEPHONY_REGISTRY_SERVICE: return mTelephonyRegistryManager; case Context.DISPLAY_SERVICE: case Context.POWER_SERVICE: // PowerManager and DisplayManager are final classes so cannot be mocked, Loading Loading @@ -569,6 +572,8 @@ public class ContextFixture implements TestFixture<Context> { private final EuiccManager mEuiccManager = mock(EuiccManager.class); private final TelecomManager mTelecomManager = mock(TelecomManager.class); private final PackageInfo mPackageInfo = mock(PackageInfo.class); private final TelephonyRegistryManager mTelephonyRegistryManager = mock(TelephonyRegistryManager.class); private final ContentProvider mContentProvider = spy(new FakeContentProvider()); Loading