A foreground service should be enough (at least according to Android's official documentation). A wake lock should not be used/needed. This works perfectly fine on "original" Android devices such as Google Pixel devices. Some chinese phone manufacturers might neglect the intended behaviour for a foreground service and kills the process anyway though after some undocumented rules, unless the app is white listed or similar.

The sample application at https://github.com/50ButtonsEach/flic2lib-android-sample uses a foreground service. You can check that out.