FileDocCategorySizeDatePackage
TelephonyTester.javaAPI DocAndroid 5.1 API5739Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony

TelephonyTester

public class TelephonyTester extends Object
Telephony tester receives the following intents where {name} is the phone name adb shell am broadcast -a com.android.internal.telephony.{name}.action_detached adb shell am broadcast -a com.android.internal.telephony.{name}.action_attached adb shell am broadcast -a com.android.internal.telephony.TestConferenceEventPackage -e filename test_filename.xml

Fields Summary
private static final String
LOG_TAG
private static final boolean
DBG
private static final String
ACTION_TEST_CONFERENCE_EVENT_PACKAGE
Test-only intent used to send a test conference event package to the IMS framework.
private static final String
EXTRA_FILENAME
private PhoneBase
mPhone
protected android.content.BroadcastReceiver
mIntentReceiver
Constructors Summary
TelephonyTester(PhoneBase phone)


      
        mPhone = phone;

        if (Build.IS_DEBUGGABLE) {
            IntentFilter filter = new IntentFilter();

            filter.addAction(mPhone.getActionDetached());
            log("register for intent action=" + mPhone.getActionDetached());

            filter.addAction(mPhone.getActionAttached());
            log("register for intent action=" + mPhone.getActionAttached());

            if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
                log("register for intent action=" + ACTION_TEST_CONFERENCE_EVENT_PACKAGE);
                filter.addAction(ACTION_TEST_CONFERENCE_EVENT_PACKAGE);
            }

            phone.getContext().registerReceiver(mIntentReceiver, filter, null, mPhone.getHandler());
        }
    
Methods Summary
voiddispose()

        if (Build.IS_DEBUGGABLE) {
            mPhone.getContext().unregisterReceiver(mIntentReceiver);
        }
    
private voidhandleTestConferenceEventPackage(android.content.Context context, java.lang.String fileName)
Handles request to send a test conference event package to the active Ims call.

see
com.android.internal.telephony.test.TestConferenceEventPackageParser
param
context The context.
param
fileName The name of the test conference event package file to read.

        // Attempt to get the active IMS call before parsing the test XML file.
        ImsPhone imsPhone = (ImsPhone) mPhone;
        if (imsPhone == null) {
            return;
        }

        ImsPhoneCall imsPhoneCall = imsPhone.getForegroundCall();
        if (imsPhoneCall == null) {
            return;
        }

        ImsCall imsCall = imsPhoneCall.getImsCall();
        if (imsCall == null) {
            return;
        }

        File packageFile = new File(context.getFilesDir(), fileName);
        final FileInputStream is;
        try {
            is = new FileInputStream(packageFile);
        } catch (FileNotFoundException ex) {
            log("Test conference event package file not found: " + packageFile.getAbsolutePath());
            return;
        }

        TestConferenceEventPackageParser parser = new TestConferenceEventPackageParser(is);
        ImsConferenceState imsConferenceState = parser.parse();
        if (imsConferenceState == null) {
            return;
        }

        imsCall.conferenceStateUpdated(imsConferenceState);
    
private static voidlog(java.lang.String s)

        Rlog.d(LOG_TAG, s);