title: how to grand permission to priv-app in AOSP built
body: <p>I want add different default launcher in my AOSP A11 builds. I have a selfbuild apk which is located in /prebuilts/prebuitapks. I hav ecreated a android.mk</p>
  <pre><code>    LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE := Peace-Launcher
  LOCAL_CERTIFICATE := platform
  LOCAL_SRC_FILES := Peace-Launcher.apk
  LOCAL_MODULE_CLASS := APPS
  LOCAL_PRIVILEGED_MODULE := true
  LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
  include $(BUILD_PREBUILT)
  
  
  include $(CLEAR_VARS)
  LOCAL_MODULE := privapp-permissions-com.harvey186.peace.dev.xml
  LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_CLASS := ETC
  LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
  LOCAL_SRC_FILES := $(LOCAL_MODULE)
  include $(BUILD_PREBUILT)
  </code></pre>
  <p>and a permission.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;permissions&gt;
      &lt;privapp-permissions package=&quot;com.harvey186.peace.dev&quot;&gt;
          &lt;permission name=&quot;android.permission.WRITE_SYNC_SETTINGS&quot; /&gt;
          &lt;permission name=&quot;android.permission.READ_SYNC_SETTINGS&quot; /&gt;
          &lt;permission name=&quot;android.permission.WRITE_SETTINGS&quot; /&gt;
          &lt;permission name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
          &lt;permission name=&quot;android.permission.ACCESS_WIFI_STATE&quot; /&gt;
          &lt;permission name=&quot;android.permission.BLUETOOTH&quot; /&gt;
          &lt;permission name=&quot;android.permission.BLUETOOTH_ADMIN&quot; /&gt;
          &lt;permission name=&quot;android.permission.CALL_PHONE&quot; /&gt;
          &lt;permission name=&quot;android.permission.SET_WALLPAPER&quot; /&gt;
          &lt;permission name=&quot;android.permission.SET_WALLPAPER_HINTS&quot; /&gt;
          &lt;permission name=&quot;android.permission.BIND_APPWIDGET&quot; /&gt;
          &lt;permission name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
          &lt;permission name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot; /&gt;
          &lt;permission name=&quot;android.permission.REQUEST_DELETE_PACKAGES&quot; /&gt;
          &lt;permission name=&quot;android.permission.READ_DEVICE_CONFIG&quot; /&gt;
          &lt;permission name=&quot;android.permission.QUERY_ALL_PACKAGES&quot; /&gt;
          &lt;permission name=&quot;android.permission.MANAGE_DOCUMENTS&quot; /&gt;
          &lt;permission name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot;/&gt;
          &lt;permission name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/&gt;
      &lt;/privapp-permissions&gt;
  &lt;/permission&gt;
  </code></pre>
  <p>but after building/flashing/booting the app sill has none of these permissions. But it is needed that the app has access to 'files and media'</p>
  <p>What am I doing wrong ?</p>