Loading src/java/com/android/internal/telephony/Phone.java +8 −1 Original line number Diff line number Diff line Loading @@ -325,7 +325,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) protected AtomicReference<UiccCardApplication> mUiccApplication = new AtomicReference<UiccCardApplication>(); TelephonyTester mTelephonyTester; private TelephonyTester mTelephonyTester; private String mName; private final String mActionDetached; private final String mActionAttached; Loading Loading @@ -4875,6 +4875,13 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void setTerminalBasedCallWaitingSupported(boolean supported) { } /** * @return Telephony tester instance. */ public @Nullable TelephonyTester getTelephonyTester() { return mTelephonyTester; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("Phone: subId=" + getSubId()); pw.println(" mPhoneId=" + mPhoneId); Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +2 −2 Original line number Diff line number Diff line Loading @@ -3400,8 +3400,8 @@ public class ServiceStateTracker extends Handler { updateNrFrequencyRangeFromPhysicalChannelConfigs(mLastPhysicalChannelConfigList, mNewSS); updateNrStateFromPhysicalChannelConfigs(mLastPhysicalChannelConfigList, mNewSS); if (TelephonyUtils.IS_DEBUGGABLE && mPhone.mTelephonyTester != null) { mPhone.mTelephonyTester.overrideServiceState(mNewSS); if (TelephonyUtils.IS_DEBUGGABLE && mPhone.getTelephonyTester() != null) { mPhone.getTelephonyTester().overrideServiceState(mNewSS); } NetworkRegistrationInfo networkRegState = mNewSS.getNetworkRegistrationInfo( Loading src/java/com/android/internal/telephony/TelephonyTester.java +40 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import android.annotation.NonNull; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading Loading @@ -200,11 +201,7 @@ public class TelephonyTester { sendTestSuppServiceNotification(intent); } else if (action.equals(ACTION_TEST_SERVICE_STATE)) { log("handle test service state changed intent"); // Trigger the service state update. The replacement will be done in // overrideServiceState(). mServiceStateTestIntent = intent; mPhone.getServiceStateTracker().sendEmptyMessage( ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED); setServiceStateTestIntent(intent); } else if (action.equals(ACTION_TEST_IMS_E_CALL)) { log("handle test IMS ecall intent"); testImsECall(); Loading Loading @@ -388,6 +385,19 @@ public class TelephonyTester { } } /** * Set the service state test intent. * * @param intent The service state test intent. */ public void setServiceStateTestIntent(@NonNull Intent intent) { mServiceStateTestIntent = intent; // Trigger the service state update. The replacement will be done in // overrideServiceState(). mPhone.getServiceStateTracker().sendEmptyMessage( ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED); } void overrideServiceState(ServiceState ss) { if (mServiceStateTestIntent == null || ss == null) return; if (mPhone.getPhoneId() != mServiceStateTestIntent.getIntExtra( Loading @@ -401,13 +411,36 @@ public class TelephonyTester { } if (mServiceStateTestIntent.hasExtra(EXTRA_VOICE_REG_STATE)) { int state = mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE); ss.setVoiceRegState(mServiceStateTestIntent.getIntExtra(EXTRA_VOICE_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE)); NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); NetworkRegistrationInfo.Builder builder = new NetworkRegistrationInfo.Builder(nri); if (state == ServiceState.STATE_IN_SERVICE) { builder.setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME); } else { builder.setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING); } ss.addNetworkRegistrationInfo(builder.build()); log("Override voice service state with " + ss.getState()); } if (mServiceStateTestIntent.hasExtra(EXTRA_DATA_REG_STATE)) { ss.setDataRegState(mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE)); int state = mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE); ss.setDataRegState(state); NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); NetworkRegistrationInfo.Builder builder = new NetworkRegistrationInfo.Builder(nri); if (state == ServiceState.STATE_IN_SERVICE) { builder.setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME); } else { builder.setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING); } ss.addNetworkRegistrationInfo(builder.build()); log("Override data service state with " + ss.getDataRegistrationState()); } if (mServiceStateTestIntent.hasExtra(EXTRA_OPERATOR)) { Loading Loading
src/java/com/android/internal/telephony/Phone.java +8 −1 Original line number Diff line number Diff line Loading @@ -325,7 +325,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) protected AtomicReference<UiccCardApplication> mUiccApplication = new AtomicReference<UiccCardApplication>(); TelephonyTester mTelephonyTester; private TelephonyTester mTelephonyTester; private String mName; private final String mActionDetached; private final String mActionAttached; Loading Loading @@ -4875,6 +4875,13 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void setTerminalBasedCallWaitingSupported(boolean supported) { } /** * @return Telephony tester instance. */ public @Nullable TelephonyTester getTelephonyTester() { return mTelephonyTester; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("Phone: subId=" + getSubId()); pw.println(" mPhoneId=" + mPhoneId); Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +2 −2 Original line number Diff line number Diff line Loading @@ -3400,8 +3400,8 @@ public class ServiceStateTracker extends Handler { updateNrFrequencyRangeFromPhysicalChannelConfigs(mLastPhysicalChannelConfigList, mNewSS); updateNrStateFromPhysicalChannelConfigs(mLastPhysicalChannelConfigList, mNewSS); if (TelephonyUtils.IS_DEBUGGABLE && mPhone.mTelephonyTester != null) { mPhone.mTelephonyTester.overrideServiceState(mNewSS); if (TelephonyUtils.IS_DEBUGGABLE && mPhone.getTelephonyTester() != null) { mPhone.getTelephonyTester().overrideServiceState(mNewSS); } NetworkRegistrationInfo networkRegState = mNewSS.getNetworkRegistrationInfo( Loading
src/java/com/android/internal/telephony/TelephonyTester.java +40 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.internal.telephony; import android.annotation.NonNull; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading Loading @@ -200,11 +201,7 @@ public class TelephonyTester { sendTestSuppServiceNotification(intent); } else if (action.equals(ACTION_TEST_SERVICE_STATE)) { log("handle test service state changed intent"); // Trigger the service state update. The replacement will be done in // overrideServiceState(). mServiceStateTestIntent = intent; mPhone.getServiceStateTracker().sendEmptyMessage( ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED); setServiceStateTestIntent(intent); } else if (action.equals(ACTION_TEST_IMS_E_CALL)) { log("handle test IMS ecall intent"); testImsECall(); Loading Loading @@ -388,6 +385,19 @@ public class TelephonyTester { } } /** * Set the service state test intent. * * @param intent The service state test intent. */ public void setServiceStateTestIntent(@NonNull Intent intent) { mServiceStateTestIntent = intent; // Trigger the service state update. The replacement will be done in // overrideServiceState(). mPhone.getServiceStateTracker().sendEmptyMessage( ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED); } void overrideServiceState(ServiceState ss) { if (mServiceStateTestIntent == null || ss == null) return; if (mPhone.getPhoneId() != mServiceStateTestIntent.getIntExtra( Loading @@ -401,13 +411,36 @@ public class TelephonyTester { } if (mServiceStateTestIntent.hasExtra(EXTRA_VOICE_REG_STATE)) { int state = mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE); ss.setVoiceRegState(mServiceStateTestIntent.getIntExtra(EXTRA_VOICE_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE)); NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); NetworkRegistrationInfo.Builder builder = new NetworkRegistrationInfo.Builder(nri); if (state == ServiceState.STATE_IN_SERVICE) { builder.setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME); } else { builder.setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING); } ss.addNetworkRegistrationInfo(builder.build()); log("Override voice service state with " + ss.getState()); } if (mServiceStateTestIntent.hasExtra(EXTRA_DATA_REG_STATE)) { ss.setDataRegState(mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE)); int state = mServiceStateTestIntent.getIntExtra(EXTRA_DATA_REG_STATE, ServiceState.STATE_OUT_OF_SERVICE); ss.setDataRegState(state); NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); NetworkRegistrationInfo.Builder builder = new NetworkRegistrationInfo.Builder(nri); if (state == ServiceState.STATE_IN_SERVICE) { builder.setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME); } else { builder.setRegistrationState( NetworkRegistrationInfo.REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING); } ss.addNetworkRegistrationInfo(builder.build()); log("Override data service state with " + ss.getDataRegistrationState()); } if (mServiceStateTestIntent.hasExtra(EXTRA_OPERATOR)) { Loading