當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。