Search in sources :

Example 1 with SuppServiceNotification

use of com.android.internal.telephony.gsm.SuppServiceNotification in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyTester method sendTestSuppServiceNotification.

private void sendTestSuppServiceNotification(Intent intent) {
    if (intent.hasExtra(EXTRA_CODE)) {
        int code = intent.getIntExtra(EXTRA_CODE, -1);
        ImsPhone imsPhone = (ImsPhone) mPhone;
        if (imsPhone == null) {
            return;
        }
        log("Test supp service notification:" + code);
        SuppServiceNotification suppServiceNotification = new SuppServiceNotification();
        suppServiceNotification.code = code;
        imsPhone.notifySuppSvcNotification(suppServiceNotification);
    }
}
Also used : SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification) ImsPhone(com.android.internal.telephony.imsphone.ImsPhone)

Example 2 with SuppServiceNotification

use of com.android.internal.telephony.gsm.SuppServiceNotification in project android_frameworks_opt_telephony by LineageOS.

the class ImsPhoneTest method testSuppServiceNotification.

@Test
@SmallTest
public void testSuppServiceNotification() {
    SuppServiceNotification ssn = new SuppServiceNotification();
    mImsPhoneUT.notifySuppSvcNotification(ssn);
    // verify registrants are notified
    ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
    verify(mTestHandler, times(1)).sendMessageAtTime(messageArgumentCaptor.capture(), anyLong());
    Message message = messageArgumentCaptor.getValue();
    assertEquals(EVENT_SUPP_SERVICE_NOTIFICATION, message.what);
    assertEquals(ssn, ((AsyncResult) message.obj).result);
    assertEquals(null, ((AsyncResult) message.obj).userObj);
    assertEquals(null, ((AsyncResult) message.obj).exception);
    // verify no notification is received after unregister (verify() still sees only 1
    // notification)
    mImsPhoneUT.unregisterForSuppServiceNotification(mTestHandler);
    mImsPhoneUT.notifySuppSvcNotification(ssn);
    verify(mTestHandler, times(1)).sendMessageAtTime(any(Message.class), anyLong());
}
Also used : Message(android.os.Message) SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification) TelephonyTest(com.android.internal.telephony.TelephonyTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) FlakyTest(android.support.test.filters.FlakyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 3 with SuppServiceNotification

use of com.android.internal.telephony.gsm.SuppServiceNotification in project XobotOS by xamarin.

the class SimulatedCommands method triggerSsn.

public void triggerSsn(int type, int code) {
    SuppServiceNotification not = new SuppServiceNotification();
    not.notificationType = type;
    not.code = code;
    mSsnRegistrant.notifyRegistrant(new AsyncResult(null, not, null));
}
Also used : SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification) AsyncResult(android.os.AsyncResult)

Example 4 with SuppServiceNotification

use of com.android.internal.telephony.gsm.SuppServiceNotification in project XobotOS by xamarin.

the class RIL method responseSuppServiceNotification.

private Object responseSuppServiceNotification(Parcel p) {
    SuppServiceNotification notification = new SuppServiceNotification();
    notification.notificationType = p.readInt();
    notification.code = p.readInt();
    notification.index = p.readInt();
    notification.type = p.readInt();
    notification.number = p.readString();
    return notification;
}
Also used : SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification)

Example 5 with SuppServiceNotification

use of com.android.internal.telephony.gsm.SuppServiceNotification in project android_frameworks_opt_telephony by LineageOS.

the class SimulatedCommands method triggerSsn.

@Override
public void triggerSsn(int type, int code) {
    SuppServiceNotification not = new SuppServiceNotification();
    not.notificationType = type;
    not.code = code;
    mSsnRegistrant.notifyRegistrant(new AsyncResult(null, not, null));
}
Also used : SuppServiceNotification(com.android.internal.telephony.gsm.SuppServiceNotification) AsyncResult(android.os.AsyncResult)

Aggregations

SuppServiceNotification (com.android.internal.telephony.gsm.SuppServiceNotification)7 AsyncResult (android.os.AsyncResult)4 Message (android.os.Message)2 PersistableBundle (android.os.PersistableBundle)1 FlakyTest (android.support.test.filters.FlakyTest)1 CarrierConfigManager (android.telephony.CarrierConfigManager)1 SmallTest (android.test.suitebuilder.annotation.SmallTest)1 TelephonyTest (com.android.internal.telephony.TelephonyTest)1 GsmMmiCode (com.android.internal.telephony.gsm.GsmMmiCode)1 ImsPhone (com.android.internal.telephony.imsphone.ImsPhone)1 IccException (com.android.internal.telephony.uicc.IccException)1 IccRecords (com.android.internal.telephony.uicc.IccRecords)1 IccVmNotSupportedException (com.android.internal.telephony.uicc.IccVmNotSupportedException)1 Test (org.junit.Test)1