I always admire people who like to mod things, especially those who like to dig into the code. Apps that do things for you are very useful, and things like Xposed are incredibly clever, but there's something very satisfying about doing it yourself. Plus, the more people experiment, the more mods they come up with. Which is good for everybody!
Unfortunately I can't help too much with this. I've no idea how Android stops people from editing particular settings. It's got to be in the smali, but which smali file inside which APK/JAR I've no idea.
Normally I'd find the hex reference for the string used in the notification and search for that in the smali. Hopefully that'd give me a start which I could then build on. Have you tried that? I know you've found something in the code but I'm not sure if that's what you found.
I had a Samsung Galaxy Tab back when the first one came out. Everytime it booted up the device played a happy little sound which was great...unless you'd just rocked your infant son to sleep and you couldn't put him because the little
bastard angel would wake up as soon as you did and you just wanted to do something for an hour while he dozed and that stupid little sound woke him up so you had to rock him back to sleep again and that took ages and he still doesn't go to sleep easily now but that's because he's too busy reading Harry Potter or something so he's not actually being naughty so you can't really get angry with him but you just know he's going to be tired in the morning and you're just so tempted to spike his dinner drink with vodka but you're not really because you're just joking but deep down in your heart you know there's a kernel of truth..
Sorry about that. I quit caffeine for New Year's and clearly I'm not coping well.
Anyway. I couldn't find out how to stop that sound from being played in the code so I eventually just tracked down the sound file itself and deleted it. It wasn't a great fix but it worked.
If you're looking to get rid of the low battery notification sound, rather than the notification itself, that might be worth a try. I know it's cheating but if it works it works!
And thanks for your kind words. It's always good to know that the stuff I do here actually makes a difference.
However i already disabled the sound but wanted a more elegant way to disable the notification.
The workaround i found is to change the low battery notification threshold (using a home-made systemless magisk module with an overlay apk for framework-res) from 15 to 1. Now when i get the notification my phone is really going to die in a few seconds!