Just in case anybody ever needs this, here is what I did :ĭownload the AOSP source code for the version of Android on the device.Įdit the 'ConnectivityServices.java' file accordingly. This is also what brings wifi up and tears down cellular data connections when in range of a recognised hotspot. It purposely only allows one connection to be up at a time and has a handler in the 'ConnectivityServices.java' file that tears down a 'non-preferred' network when a network with a priority is enabled.