0

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,

  1. Is this device specific issue (Which I predict as "YES")?
  2. 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.

Akki
  • 775
  • 8
  • 19
  • Have you get this permission: android.permission.CHANGE_WIFI_STATE ? – Faysal Ahmed Jul 09 '19 at 07:05
  • @Faysal, Yes, All permissions declarations in Manifest file and run time permissions handling is correctly present. – Akki Jul 09 '19 at 07:19
  • Seems like this issue is related to Device OS version. Newer version of Android OS not directly permit to access the components. – Faysal Ahmed Jul 09 '19 at 07:22
  • @Faysal, DUTs Android version is 8 and below. I think WiFi restricted access came in Android 9 and later. Though I doubt issue is device specific (possibly due to ROM customization in these devices for power and security managements). So I am looking for any possible workaround. – Akki Jul 10 '19 at 04:53
  • Any solution ?? – Amin Pinjari Sep 27 '19 at 14:10
  • try https://stackoverflow.com/a/58162451/7579041 – Amin Pinjari Sep 30 '19 at 06:58

0 Answers0