Our prototype device (powered by Hikey 960) relies on BT for user input. When the PCB is enclosed in the housing, there are no ports, except for power. It runs AOSP with a MIPI display. A problem with this configuration is that once a user chooses to disable BT, he can no longer control the device. We can fix it by connecting adb over WiFi and run the following script:
adb root
adb shell settings put global airplane_mode_on 0
adb shell svc bluetooth enable
adb shell svc wifi enable
As you can see it also takes care of accidental Airplane and Wifi mode toggles. This works when using adb over usb, but not with adb over wifi. I would instead like to run these commands each time the device boots, but so far I haven’t been able to identify where and when I should run this script. I have tried the on boot section in init.rc (where I placed some other hacks succesfully), but it doesn’t work for these commands, probabaly because it is too early in the boot process.
What would be more suitable location?