[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Disable 2G\n\nThe most severe threat to a user's security and privacy when using a mobile\nnetwork is 2G connections. While legitimate 2G cellular networks are being\nphased out across the world, devices are still susceptible to attacks from false\nbase stations (FBS). An adversary with a FBS can trick a device into connecting\nto it instead of a legitimate cellular network. This is most often accomplished\nby downgrading a device's connection to 2G, and it allows the operator of the\nFBS to intercept or inject traffic to a device.\n\nAndroid allows users to disable 2G at the radio hardware level on any device\nthat implements the capability constant,\n\"CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK\". This stops a device from\nscanning or connecting to 2G networks.\n| **Note:** Emergency calling is never impacted. A device still scans and connects to 2G networks for emergency services.\n\nStarting in Android 14, you must have MODIFY_PRIVILEGED_PHONE_STATE to disable\n2G with reason ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G. Carrier privileges don't\nsuffice. \n\n TelephonyManager tm = getSystemService(TelephonyManager.class);\n\n if (tm != null && tm.isRadioInterfaceCapabilitySupported(\"CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK\")) {\n long disable2gBitMask = 0xFFFF &~ TelephonyManager.NETWORK_CLASS_BITMASK_2G;\n tm.setAllowedNetworkTypesForReason(TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G, disable2gBitMask);\n }\n\nFAQs\n----\n\n### Are users still vulnerable if their carriers no longer support 2G?\n\nDisabling 2G is an important security measure even if the user's carrier no\nlonger maintains 2G infrastructure. The user's device still supports scanning\nand connecting to 2G base stations, so they are still vulnerable to a 2G\ndowngrade attack if they do not disable 2G on their device.\n\n### How does disabling 2G impact roaming?\n\nWhen 2G is disabled for security purposes it will not be re-enabled, even if the\ndevice is roaming. Certain areas in the world depend on 2G coverage and some\nroaming agreements assume devices will be able to connect to 2G. In these\nsituations, the user will not have connectivity unless they re-enable 2G.\nIt's not possible to reliably detect 2G roaming because of the lack of mutual\nauthentication in 2G. Leaving 2G off despite roaming signals, prevents a FBS\nfrom spoofing its network identifiers to convince a device to re-enable 2G."]]