当前位置: 首页>>代码示例>>Java>>正文


Java DataState类代码示例

本文整理汇总了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);
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:28,代码来源:AbstractWrapDeviceTest.java

示例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;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:56,代码来源:AgentRequestHandler.java

示例3: setDataState

import com.musala.atmosphere.commons.util.telephony.DataState; //导入依赖的package包/类
public void setDataState(DataState dataState) {
    this.dataState = dataState;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-commons,代码行数:4,代码来源:TelephonyInformation.java

示例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;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-commons,代码行数:9,代码来源:TelephonyInformation.java


注:本文中的com.musala.atmosphere.commons.util.telephony.DataState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。