androidadbtelephonymanagercellular-networklte

preferred_network_mode values for GWL/LTE ONLY/WCDMA ONLY/GSM using adb


I am using below adb commands for changing preferred network mode to GSM where value is 1, Can any one give the values for other modes like - GWL (GSM/WCDMA/LTEONLY) - LTE ONLY - WCDMA PREFERRED etc

adb root
adb wait-for-devices
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global SET value=12 WHERE name='preferred_network_mode'"
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "select value FROM secure WHERE name='preferred_network_mode'"
adb reboot 

Solution

  • include/telephony/ril.h

    typedef enum {
        PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
        PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
        PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
        PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
        PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
        PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
        PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
        PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
        PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
        PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
        PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
        PREF_NET_TYPE_LTE_ONLY                 = 11, /* LTE only */
        PREF_NET_TYPE_LTE_WCDMA                = 12,  /* LTE/WCDMA */
        PREF_NET_TYPE_TD_SCDMA_ONLY            = 13, /* TD-SCDMA only */
        PREF_NET_TYPE_TD_SCDMA_WCDMA           = 14, /* TD-SCDMA and WCDMA */
        PREF_NET_TYPE_TD_SCDMA_LTE             = 15, /* TD-SCDMA and LTE */
        PREF_NET_TYPE_TD_SCDMA_GSM             = 16, /* TD-SCDMA and GSM */
        PREF_NET_TYPE_TD_SCDMA_GSM_LTE         = 17, /* TD-SCDMA,GSM and LTE */
        PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA       = 18, /* TD-SCDMA, GSM/WCDMA */
        PREF_NET_TYPE_TD_SCDMA_WCDMA_LTE       = 19, /* TD-SCDMA, WCDMA and LTE */
        PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_LTE   = 20, /* TD-SCDMA, GSM/WCDMA and LTE */
        PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO  = 21, /* TD-SCDMA, GSM/WCDMA, CDMA and EvDo */
        PREF_NET_TYPE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA   = 22  /* TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA */
    } RIL_PreferredNetworkType;