本文整理汇总了Java中com.musala.atmosphere.commons.util.telephony.DataState类的典型用法代码示例。如果您正苦于以下问题:Java DataState类的具体用法?Java DataState怎么用?Java DataState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataState类属于com.musala.atmosphere.commons.util.telephony包,在下文中一共展示了DataState类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetTelephonyInformation
import com.musala.atmosphere.commons.util.telephony.DataState; //导入依赖的package包/类
@Test
public void testGetTelephonyInformation() throws Exception {
TelephonyInformation expectedTelephonyInformation = new TelephonyInformation();
expectedTelephonyInformation.setCallState(CallState.CALL_STATE_RINGING);
expectedTelephonyInformation.setDataActivity(DataActivity.DATA_ACTIVITY_INOUT);
expectedTelephonyInformation.setDataState(DataState.DATA_CONNECTING);
expectedTelephonyInformation.setDeviceId("007");
expectedTelephonyInformation.setDeviceSoftwareVersion("iOS 7");
expectedTelephonyInformation.setLine1Number("333");
expectedTelephonyInformation.setNetworkCountryIso("359");
expectedTelephonyInformation.setNetworkOperator("451343416978");
expectedTelephonyInformation.setNetworkOperatorName("MednaTel");
expectedTelephonyInformation.setNetworkType(NetworkType.NETWORK_TYPE_EVDO_B);
expectedTelephonyInformation.setPhoneType(PhoneType.PHONE_TYPE_SIP);
expectedTelephonyInformation.setSimOperator("175915619");
expectedTelephonyInformation.setSimOperatorName("SimOperatorName");
expectedTelephonyInformation.setSimState(SimState.SIM_STATE_PUK_REQUIRED); // Shit happens
expectedTelephonyInformation.setSubscriberId("123");
expectedTelephonyInformation.setVoiceMailAlphaTag("alphaTag");
expectedTelephonyInformation.setVoiceMailNumber("0879665321");
Mockito.doReturn(expectedTelephonyInformation).when(serviceCommunicator).getTelephonyInformation();
TelephonyInformation actualTelephonyInformation = (TelephonyInformation) testWrapDevice.route(RoutingAction.GET_TELEPHONY_INFO);
assertEquals("The expected telephony information did not match the actual.",
expectedTelephonyInformation,
actualTelephonyInformation);
}
示例2: getTelephonyInformation
import com.musala.atmosphere.commons.util.telephony.DataState; //导入依赖的package包/类
/**
* Obtains information about the telephony services on the device.
*
* @return {@link TelephonyInformation} instance.
*/
private Object getTelephonyInformation() {
TelephonyInformation telephonyInformation = new TelephonyInformation();
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
int callStateId = telephonyManager.getCallState();
int dataActivityId = telephonyManager.getDataActivity();
int dataStateId = telephonyManager.getDataState();
int networkTypeId = telephonyManager.getNetworkType();
int phoneTypeId = telephonyManager.getPhoneType();
int simStateId = telephonyManager.getSimState();
String deviceId = telephonyManager.getDeviceId();
String deviceSoftwareVersion = telephonyManager.getDeviceSoftwareVersion();
String line1Number = telephonyManager.getLine1Number();
String networkCountryIso = telephonyManager.getNetworkCountryIso();
String networkOperator = telephonyManager.getNetworkOperator();
String networkOperatorName = telephonyManager.getNetworkOperatorName();
String simOperator = telephonyManager.getSimOperator();
String simOperatorName = telephonyManager.getSimOperatorName();
String subscriberId = telephonyManager.getSubscriberId();
String voiceMailAlphaTag = telephonyManager.getVoiceMailAlphaTag();
String voiceMailNumber = telephonyManager.getVoiceMailNumber();
CallState callState = CallState.getById(callStateId);
DataActivity dataActivity = DataActivity.getById(dataActivityId);
DataState dataState = DataState.getById(dataStateId);
NetworkType networkType = NetworkType.getById(networkTypeId);
PhoneType phoneType = PhoneType.getById(phoneTypeId);
SimState simState = SimState.getById(simStateId);
telephonyInformation.setCallState(callState);
telephonyInformation.setDataActivity(dataActivity);
telephonyInformation.setDataState(dataState);
telephonyInformation.setDeviceId(deviceId);
telephonyInformation.setDeviceSoftwareVersion(deviceSoftwareVersion);
telephonyInformation.setLine1Number(line1Number);
telephonyInformation.setNetworkCountryIso(networkCountryIso);
telephonyInformation.setNetworkOperator(networkOperator);
telephonyInformation.setNetworkOperatorName(networkOperatorName);
telephonyInformation.setNetworkType(networkType);
telephonyInformation.setPhoneType(phoneType);
telephonyInformation.setSimOperator(simOperator);
telephonyInformation.setSimOperatorName(simOperatorName);
telephonyInformation.setSimState(simState);
telephonyInformation.setSubscriberId(subscriberId);
telephonyInformation.setVoiceMailAlphaTag(voiceMailAlphaTag);
telephonyInformation.setVoiceMailNumber(voiceMailNumber);
return telephonyInformation;
}
示例3: setDataState
import com.musala.atmosphere.commons.util.telephony.DataState; //导入依赖的package包/类
public void setDataState(DataState dataState) {
this.dataState = dataState;
}
示例4: getDataState
import com.musala.atmosphere.commons.util.telephony.DataState; //导入依赖的package包/类
/**
* Returns a constant indicating the current data connection state (cellular).
*
* @return {@link DataState} member.
*/
public DataState getDataState() {
return dataState;
}