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);
}
}
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());
}
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));
}
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;
}
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));
}
Aggregations