title: android add_service(android.hardware.camera.provider@2.4-service) fails- /dev/vndbinder permission denied
body: <p>I'm working on HiKey aosp installed running on Linux 16.04, trying to connect v4l2 camera and use it. Currently, I've added the device drivers for v4l2 and usbcamera, and added the <a href="https://github.com/antmicro/android-camera-hal" rel="nofollow noreferrer">camera-hal</a> to <code>~/(aosp)/device/linaro/hikey/camera</code> directory. media_profiles.xml is contained in this directory.</p>
  
  <p>I'm facing this problem where the camera service provider is killed in the init process and runs infinite loop of the booting process as it constantly tries to start camera service and kill all related processes.</p>
  
  <p>Logcat:</p>
  
  <pre><code>01-01 00:00:14.067  1999  1999 I mediaserver: ServiceManager: 0xf69994c0
  01-01 00:00:14.068  1903  1903 E SELinux : avc:  denied  { add } for service=media.cas pid=1999 uid=1013 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0
  01-01 00:00:14.069  1903  1903 E ServiceManager: **add_service**('media.cas',3) uid=1013 - **PERMISSION DENIED**
  01-01 00:00:14.199  1968  1968 W android.hardwar: type=1400 audit(0.0:61): avc: denied { read write } for name="vndbinder" dev="tmpfs" ino=10306 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:vndbinder_device:s0 tclass=chr_file permissive=0
  01-01 00:00:14.205  1968  1968 I **android.hardware.camera.provider@2.4-service**: Camera provider Service is starting.
  01-01 00:00:14.205  1968  1968 W ProcessState: **Opening '/dev/vndbinder' failed: Permission denied**
  01-01 00:00:14.205  1968  1968 F **ProcessState: Binder driver could not be opened.  Terminating.**
  --------- beginning of crash
  01-01 00:00:14.205  1968  1968 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1968 (android.hardwar), pid 1968 (android.hardwar)
  01-01 00:00:14.266  2005  2005 I /vendor/bin/hw/android.hardware.media.omx@1.0-service: mediacodecservice starting
  01-01 00:00:14.266  2005  2005 I ProcessState: Wonn1e: initWithDriver [1]
  01-01 00:00:14.288  2005  2005 W /vendor/bin/hw/android.hardware.media.omx@1.0-service: Could not read additional policy file '/vendor/etc/seccomp_policy/mediacodec.policy'
  01-01 00:00:14.288  2005  2005 W /vendor/bin/hw/android.hardware.media.omx@1.0-service: libminijail[2005]: failed to get path of fd 5: No such file or directory
  </code></pre>
  
  <p>According to the answer given to <a href="https://stackoverflow.com/questions/46128774/start-native-service-at-early-init-before-coldboot-done/48294126#48294126">Start native service at early-init before coldboot done</a>, native service including this camera provider service would not open the /dev/binder because it starts before the coldboot. Also, it uses the passthrough mode. How can I tweak the init process so that camera provider service would run and not kill itself?</p>