Question: I have created a system app signed with firmware key and it is asking for permission from the user when starting the app ex. for Storage / Location. How will I give permission at install time to it won't ask for any permission at runtime?

Answer: 
> 
> How will I give permission at install time to it won't ask for any
>  permission at runtime?
> 
> 
> 

If you are running your app on OS version >= Android M (API 23) and `targetSdkVersion` is set to >= 23, permissions falling under dangerous category (storage/location permissions fall under this category) have to be granted at run-time. Even System apps are not exempted from this request.

For generic apps only the normal-level permissions are granted at installation time. Since your app is signed with firmware key the advantage it gets is, the normal-level as well as signature-level permissions will be granted at installation time. Refer to [official document](https://developer.android.com/guide/topics/permissions/overview#normal-dangerous) for more details.
> 
> How will I give permission at install time to it won't ask for any permission at runtime?
> 
> 
> 

**AFAIK** it is not possible if you app **`targetSdkVersion >=23`** because since api 23 user grants all the dangerous permission at run time not while installing app

its a bad idea to make your targetSdkVersion below 23 because please read this [**Target API level requirement from late 2018**](https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html)

* Implicit intents for bindService() no longer supported `(Android 5.0)`
* Runtime permissions `(Android 6.0)`
* User-added CAs not trusted by default for secure connections `(Android 7.0)`
* Apps can't access user accounts without explicit user approval `(Android 8.0)`