My App has a background service which keeps running as foreground service. This service controls the device WiFi/Bluetooth programmatically on certain conditions. Everything works fine BUT on few devices (specifically the devices with custom ROMs) this is failing with the permission error. For example on OppoF9, I am getting below messages in the logcat:
D OppoPermissionInterceptPolicy: not foreground app, reject it! <My App Package>
W ServiceManager: Permission failure: android.permission.CHANGE_WIFI_STATE from uid=10424 pid=8894
E CheckPermission: Permission Denial: can't change wifi state pid=8894, uid=10424
I am not sure weather this issue is related with "adding the app under white listed categories" in few devices(again for devices with custom ROMs).
So,
- Is this device specific issue (Which I predict as "YES")?
- Is there any possible solution (Programatically possible solution OR manual settings before trying my service on these phone)?
Any suggestions how to fix it? TIA.