Search code examples
androidandroid-sourceandroid-wifiandroid-bluetoothandroid-gps

Disabling all radios from the system level; AOSP


I'm trying to disable radios for things like WiFi, BT, GPS, and any other telemetry from the system level on AOSP. Specifically, I'm trying to do it in a quick-settings tile or an item on the shutdown menu, but I'm not quite sure how to embark on this task. I can make APKs and quick-settings tiles, but I don't know how to access radios on a low level, setting them to off, not dormant.


Solution

  • Airplane mode does the same. You can look into Airplane mode implementation and can do similar implementation for your requirement.

    Once Airplane mode is changed, ConnectivityService broadcasts ACTION_AIRPLANE_MODE_CHANGED action to all the radio classes (WiFi, Bluetooth, Network, etc.). Based on this action device's radio is turned off.