I currently have only two use cases that require Bluetooth support in AAS. If I can adapt this ‘solution’ to allow toggling of BT support (to AAS, then back to SfOS) there will be nothing preventing me from using my Xperia 10 iii as my ‘daily driver’ device. All the other use cases for Bluetooth in my current Android phone can be achieved in SfOS without needing Bluetooth support in AAS.
My use cases:
- Garmin Smartwatch: download golf course data from Garmin Connect Android app running on the phone. As far as I know, this is the only way to achieve this: it is not possible to download Golf Course data from PC to watch. (Note this is a multi-sport watch and golf courses are not pre-loaded: they must be loaded from the phone. For dedicated Golf watches, with courses preloaded, course updates can be downloaded from PC or Web)
- BeMore Hearing Aid control app. Proprietary Android app that allows fine-grained control of hearing aids - volume, noise filters, favourite settings
These operations are both short in duration: the workflow would be
- Enable BT in AAS
- Perform the operation
- Disable BT in AAS and re-enable it in SfOS
I think this is achievable by creating scripts:
Enable BT in AAS (bt-to-aas.sh)
- stop AAS if it is running - (is this doable from a script?). Or leave it running while we do steps 2 & 3, and restart ASS in step 4
- stop bluetooth and bluebinder services
- add (or uncomment) this line (using
sed?) to/opt/appsupport/etc/appsupport.conf.d/10-hybris.conf
Proxies=android.hardware.bluetooth@1.1::IBluetoothHci,android.hardware.bluetooth@1.0::IBluetoothHci/default - start (or restart) AAS - (is this doable from a script, rather than from SFOS settings menu)
Enable BT in SfOS (bt-to-sfos.sh)
I am less sure about what is needed here. A 'quick and dirty solution might be to edit the 10-hybris.conf file then reboot the phone. I would prefer a slightly more elegant and less destructive solution ![]()
- do I need to stop bluetooth and bluebinder services again, or are they still not still not running since being stopped in the
bt-to-aas.shscript? - stop AAS
- is this necessary or can we just restart it once we have changed the
10-hybris.conffile? - is this: do-able from a script ?
- is this necessary or can we just restart it once we have changed the
- OR disable AAS Android Bluetooth package, but leave AAS running
- remove (or comment) this line( using
sed?) to/opt/appsupport/etc/appsupport.conf.d/10-hybris.conf
Proxies=android.hardware.bluetooth@1.1::IBluetoothHci,android.hardware.bluetooth@1.0::IBluetoothHci/default - restart bluetooth bluebinder and services
- restart AAS (optional: we could leave this to be done manually)
Running the scripts from an on-screen button or widget would be ‘nice to have’, once I am happy with the script functionality.
Some of the operations would require devel-su. Are there ways of working around that so that the scripts can be invoked by ‘normal’ users? e.g.
- invoke the scripts using
devel-su, and reading thedevel-supassword from some (hidden and maybe encrypted) file? - change the permissions on the scripts to make them executable by all?
- some other magic?
Note I am very new to SfOS, and don’t have a great deal of experience with shell programming, either so I apologise for any basic errors and misunderstandings.
Any thoughts or suggestions on the above before I start experimenting?
Thanks
EDITs:
Re-reading the thread, I saw the following posts
- I could look into that, but I don’t think it works well for my use cases. I will likely be running AAS most of the time, alongside SfOS, so I want to enable BT in AAS only when I want to perform one of the operations, leaving BT enabled in SfOS the rest of the time
- I have less experience of
systemdthan I have of shell programming. Which is likely to be easier -systemdunit or shell script?