Searching for flashlight app whose behavior you can control and customise? Shake Flashlight App is super easy to use and gives you lots of optional extras (all free). Option to enable shake to activate flashlight. Option to run in background - this will let you shake to activate the flashlight or screen light anytime. On your lockscreen and even with your screen off. No need for a hardware button torch shortcut. Works on the majority of Android devices with an accelerometer and is designed to be battery friendly. To optimise background experience within app settings you can select enable 'Allow modify system settings' and ensure the app is whitelisted by any battery saver/app killers.
You can also customise the shake strength (for example '70' would require a firm shake to prevent accidental shakes but is still easy to shake with one hand). You could choose a low shake setting & turn your phone's screen into a useful shake nightlight. You can also choose to use this as a simple lightweight torch app, place it as a shortcut on your homescreen and you'll get the fastest light on/off times at a tap. Option to use screen light instead of camera LED for flashlight (you don't need a camera flash light). You'll get the brightest light possible. Optional vibration feedback. Compatible with most devices, supports save app to SD card and new aspect ratio devices (Galaxy S8/LG G6).