androidgsm3gtelephonymanagercdma

The value of TelephonyManager.getPhoneType is related to phone and a fixed constant or related to sim card?


The value of TelephonyManager.getPhoneType is related to phone and is fixed or related to sim card? The return value is a fixed constant no matter what the type of sim is ? Thanks


Solution

  • Th term 'PhoneType' is definitely confusing here - it appears to actually mean the type of device the phone is currently acting as. So the same physical phone could report different values for different subscriptions:

    TelephonyManager.getPhoneType
    

    calls

    getCurrentPhoneType(getDefaultSubscription())
    

    The comments for 'getCurrentPhoneType' indicate that it returns a device type for a particular subscription:

    /**
     * Returns a constant indicating the device phone type for a subscription.
     *
     * @see #PHONE_TYPE_NONE
     * @see #PHONE_TYPE_GSM
     * @see #PHONE_TYPE_CDMA
     *
     * @param subId for which phone type is returned
     */