title: Android 11: avc: denied { read } for name="sdcard"
body: <p>After upgrading to Android 11, access to my app’s files under <code>/sdcard/Android/data/&lt;packageId&gt;/files</code> is no longer possible. I get the following error:</p>
  <pre><code>type=1400 audit(0.0:672): avc: denied { read } for name=&quot;sdcard&quot; dev=&quot;tmpfs&quot; ino=6474 scontext=u:r:untrusted_app_29:s0:c244,c256,c512,c768 tcontext=u:object_r:mnt_sdcard_file:s0 tclass=lnk_file permissive=0 app=com.example.myapp
  </code></pre>
  <p>This behavior presists even after I request <code>MANAGE_EXTERNAL_STORAGE</code> in the manifest and grant it to the app.</p>
  <p>I understand that, even with maximum storage permissions, Android 11 <a href="https://developer.android.com/training/data-storage/manage-all-files#operations-allowed-manage-external-storage" rel="nofollow noreferrer">restricts access</a> to certain paths, including <code>/sdcard/Android/data</code>. <strong>However, the directory I am trying to access is the app’s own data dir.</strong></p>
  <p>How do I get access to this path while using <code>File</code> and the like, rather than SAF?</p>