Example usage for android.telephony TelephonyManager PHONE_TYPE_GSM

List of usage examples for android.telephony TelephonyManager PHONE_TYPE_GSM

Introduction

In this page you can find the example usage for android.telephony TelephonyManager PHONE_TYPE_GSM.

Prototype

int PHONE_TYPE_GSM

To view the source code for android.telephony TelephonyManager PHONE_TYPE_GSM.

Click Source Link

Document

Phone radio is GSM.

Usage

From source file:com.android.mms.ui.MessageUtils.java

/**
 * M: for check CSIM in gsm mode or not.
 * @param subId the CSIM's sub id.//from  ww w  .  j  a v a2  s .  co m
 * @return true: in gsm; false: no.
 */
public static boolean isCSIMInGsmMode(int subId) {
    if (isUSimType(subId)) {
        TelephonyManagerEx tmEx = TelephonyManagerEx.getDefault();
        int vnt = tmEx.getPhoneType(SubscriptionManager.getSlotId(subId));
        Log.d(TAG, "[isCSIMInGsmMode]:[NO_PHONE = 0; GSM_PHONE = 1; CDMA_PHONE = 2;]; phoneType:" + vnt);
        if (vnt == TelephonyManager.PHONE_TYPE_GSM) {
            return true;
        }
    }
    return false;
}

From source file:com.guardtrax.ui.screens.HomeScreen.java

String getPhoneType() {
    TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

    int phoneType = telephonyManager.getPhoneType();
    switch (phoneType) {
    case TelephonyManager.PHONE_TYPE_NONE:
        return "NONE";

    case TelephonyManager.PHONE_TYPE_GSM:
        return "GSM";

    case TelephonyManager.PHONE_TYPE_CDMA:
        return "CDMA";

    /*/*from ww  w  .ja v  a2s.  c o  m*/
     *  for API Level 11 or above
     *  case TelephonyManager.PHONE_TYPE_SIP:
     *   return "SIP";
     */

    default:
        return "UNKNOWN";
    }
}