How can I configure a separate MMS APN on LineageOS


Question

Some mobile phone providers (e.g. Optus, including MVNOs that deliver service through Optus' networks) have a separate mobile APN (access point name) for sending MMS to what is used for mobile data.



However, the user interface in LineageOS (and probably other Android variants) does not seem to let you configure two APNs.



Through the UI, under Settings -> Network & Internet -> Mobile network -> Advanced -> Access point names it is only possible to select a single APN as 'preferred'.



How can I configure my MMS APN at the same time as my data APN?


Answer

Firstly configure the mobile data APN through the UI and verify that is working.



Next, we will need to configure to MMS APN without using the API. To do this, you will need access to the phone through adb, and you will need a rooted phone (see other posts on how to do this if you don't already have that). All of the commands could alternatively be performed on the device itself through a shell.



In Android, the different networks that can be configured are identified by a 'subscriber ID' or subId. The first step is to find the correct subId to use.



If you haven't already, restart adb as root using adb root.



Now find the subId already in use for data with:



adb shell content query --uri content://telephony/carriers/preferapn 


Look for the part of the line that looks like sub_id=3, - you may have a different number in place of 3. That is the subId for mobile data - not the one we want to use, but useful for elimination. Also make a note of the _id number and the numeric from the response - you will need those in another step.



Run adb logcat -d -e "matching subId" and look at the subIds that come back. If you only have one SIM enabled, but you need to enable a separate network for MMS, you should see two different numbers in the results. Eliminate the one that matches the mobile data subId. This is the subId you will need to configure (in my case, it is 2).



Now list the options with



adb shell content query --uri content://telephony/carriers/ --where "numeric='50502'"


(replacing 50502 with the numeric you recorded from the earlier query). In the results, find the row that matches the APN you want to configure. In the Optus case, the row will like something like



Row: 5 _id=2912, name=Optus MMS, numeric=50502, mcc=505, mnc=02, apn=mms, user=*, 
server=*, password=*, proxy=202.139.83.152, port=8070, mmsproxy=61.88.190.10, mmsport=8070,
mmsc=http://mmsc.optus.com.au:8002/, authtype=-1, type=mms, current=1, protocol=IP,
roaming_protocol=IP, carrier_enabled=1, bearer=0, bearer_bitmask=0, mvno_type=,
mvno_match_data=, sub_id=3, profile_id=0, modem_cognitive=0, max_conns=0, wait_time=0,
max_conns_time=0, mtu=0, edited=0, user_visible=1, user_editable=1


If there are several options and you are not sure which one, you could try each one in turn using the following steps. Note the number after _id= - that is your APN ID you need to configure.



To configure the MMS APN, use the command



adb shell content insert --uri content://telephony/carriers/preferapn/subId/2 --bind apn_id:l:2912


Replace the 2 with the subId you worked out you needed to configure (i.e. the one that is not the mobile data subId). Replace the 2912 in the above with the apn_id from the above command.



If you configured the APN successfully, you should now be able to send MMS and use mobile data at the same time.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes