title: Add new security policy in SElinux on Android 10
body: <p>I want witch <code>/dev/i2c-1</code> device to be outside the SELinux security policy on Android 10.</p>
  <p>I have the source code for Android 10. I tried creating a <code>.te</code> file in <code>/device/thales/mt8768q/sepolicy/edgelab.te</code></p>
  <p>In foo.te, I added a similar example to the site: <a href="https://source.android.com/security/selinux/customize" rel="nofollow noreferrer">https://source.android.com/security/selinux/customize</a>.</p>
  <pre><code>allow domain i2c-1_device:chr_file rw_file_perms
  </code></pre>
  <p>But, in compilation, this line generates an error.</p>
  <p>UPDATE:</p>
  <p>I add new line on <code>/device/manufacturer/device-name/BoardConfig.mk</code>:</p>
  <pre><code>BOARD_SEPOLICY_DIRS += device/thales/mt8768q/sepolicy
  </code></pre>
  <p>The error is:</p>
  <pre><code>#line 206
  device/mediatek/mt6765/sepolicy/bsp/mnld.te:8:ERROR 'syntax error' at token 'role' on line 97225:
  #line 2 &quot;device/thales/mt8768q/sepolicy/edgelab.te&quot;
  allow domain i2c-1_device:chr_file { { getattr open read ioctl lock map } { open append write lock map } }role r;
  checkpolicy:  error(s) encountered while parsing configuration
  </code></pre>
  <p>Maybe <code>i2c-1_device</code> is not a valid name, but I don't know how to refer to <code>/dev/i2c-1</code> in <code>.te</code> file.</p>