title: Why Cameradevice null when accessing on foreground service
body: <p>I have app that works fine in Android 10 but now I need to make it work on Android 11.
  App uses broadcast receiver so it can be launched from background on notification widget/view
  First issue was that when I run it on 11 I got android.hardware.camera2.CameraAccessException: CAMERA_DISABLED (1):
  So I added permissions android:foregroundServiceType=&quot;camera&quot; so I got it run at first place</p>
  <p>Now when the app is in background and is activated from widget via broadcast message
  the app doesn't activate. I get the the receiver message and when getting the Controller.getInstance(context)
  and I check the context cameradevice it's null.</p>
  <p>I found this <a href="https://developer.android.com/guide/components/foreground-services#access-restrictions" rel="nofollow noreferrer">https://developer.android.com/guide/components/foreground-services#access-restrictions</a>
  I am just guessing that if this is the case shouldn't there be some Permission Restricted Message instead of having the cameradevice is null.
  And if this is the case that it now fails with access restrictions is there way to make it work.</p>