Permissions in Qt for Android Automotive
When deploying apps which use Qt for Android Automotive modules, the permissions required are automatically added to the Android manifest file by the deployment tool. Some of the Qt for Android Automotive APIs are geared towards use cases that by their nature require more restricted permissions, such as implementing a launcher app or accessing vehicle properties.
In most cases, you do not need all the permissions that come with the module. If you only want to use the QAndroidNotificationListener from Qt Android Automotive Base Module without using the permissions that come from other APIs in the module, you can do so.
This page lists what permissions each Qt for Android Automotive module uses and adds to the manifest automatically and shows how to override the default deployment tool behavior to manually control the permissions added.
The following table outlines the permissions used by the Qt Android Automotive Base Module.
|Permission||Used By||Used For|
|QUERY_ALL_PACKAGES||QAndroidAppsUtils, QAndroidNotificationListener||Getting the list of all the installed apps, getting their icons and notifications|
|REQUEST_DELETE_PACKAGES||QAndroidAppsUtils||Requesting to uninstall a package|
|MANAGE_USERS||QAndroidUserProfiles||Getting the user information|
The following table outlines the permissions used by the Qt Android Automotive Media Module.
|Permission||Used By||Used For|
|CAR_CONTROL_AUDIO_SETTINGS||QDynamicAudioRouting||Controlling application audio zone settings|
|CAR_CONTROL_AUDIO_VOLUME||QDynamicAudioRouting||Initializing the Dynamic Audio Routing API (only on Android 10)|
The Vehicle C++ and Quick libraries do not require any permissions. However, the Qt Android Automotive Vehicle Module inherits all its required permissions from its Vehicle Properties Library. This generated library gives access to all properties of a vehicle available through the Android Car API, so all permissions for these properties are required.
The following table outlines the permissions used by the Qt Android Automotive Vehicle Module.
|Permission||Used By||Used For|
|CONTROL_CAR_CLIMATE||Vehicle Properties library||Controlling all settings of the climate system in the car|
|CONTROL_CAR_WINDOWS||Vehicle Properties library||Controlling car windows and related parameters|
|CAR_ENERGY||Vehicle Properties library||Reading car energy information|
|CAR_ENERGY_PORTS||Vehicle Properties library||Accessing charging port or fuel door states of the car|
|CONTROL_CAR_ENERGY_PORTS||Vehicle Properties library||Controlling charging ports or fuel doors of the car|
|CAR_INFO||Vehicle Properties library||Reading car manufacturer information, capabilities, available features|
|CAR_IDENTIFICATION||Vehicle Properties library||Reading car identification data|
|CONTROL_CAR_MIRRORS||Vehicle Properties library||Controlling car mirror position and behavior|
|CONTROL_CAR_SEATS||Vehicle Properties library||Controlling car seat movement and state|
|CONTROL_CAR_DOORS||Vehicle Properties library||Controlling car doors|
|CAR_TIRES||Vehicle Properties library||Reading tire pressure|
|CAR_MILEAGE||Vehicle Properties library||Reading car odometer state|
|CAR_SPEED||Vehicle Properties library||Reading car speed data|
|CAR_POWERTRAIN||Vehicle Properties library||Reading car powertrain information|
|CAR_POWER||Vehicle Properties library||Reading car system power state information|
|CAR_ENGINE_DETAILED||Vehicle Properties library||Reading engine-related information like RPM, fluid levels and temps|
|CAR_DYNAMICS_STATE||Vehicle Properties library||Reading state of dynamics systems like ABS or traction control|
|READ_CAR_DISPLAY_UNITS||Vehicle Properties library||Reading various display units used by the car|
|CONTROL_CAR_DISPLAY_UNITS||Vehicle Properties library||Controlling what display units the car uses|
|CAR_EXTERIOR_ENVIRONMENT||Vehicle Properties library||Reading car exterior environment like outside temperature|
|CAR_EXTERIOR_LIGHTS||Vehicle Properties library||Reading the state of all exterior car lights and indicators|
|CONTROL_CAR_EXTERIOR_LIGHTS||Vehicle Properties library||Controlling exterior car lights|
|READ_CAR_INTERIOR_LIGHTS||Vehicle Properties library||Reading car interior lights state|
|CONTROL_CAR_INTERIOR_LIGHTS||Vehicle Properties library||Controlling interior lights in the car|
|ADJUST_RANGE_REMAINING||Vehicle Properties library||Adjusting the calculated remaining range of the car|
|CAR_VENDOR_EXTENSION||Vehicle Properties library||Accessing the vehicle vendor channel to exchange vendor-specific information|
Note that removing any of these permissions can lead to undefined behavior, as the implementation uses different system components based on the specific Android version being used. This is also the reason why some permissions here are internal to Android itself. All of them are used for allowing full interaction with the embedded content.
|android.permission.MANAGE_ACTIVITY_TASKS||from Android 12|
|android.permission.CAPTURE_BLACKOUT_CONTENT||from Android 12|
|android.permission.INTERACT_ACROSS_USERS_FULL||from Android 12|
|android.permission.ROTATE_SURFACE_FLINGER||from Android 12|
|android.permission.ACCESS_SURFACE_FLINGER||from Android 12|
|android.permission.READ_FRAME_BUFFER||from Android 12|
If you need more control over what permissions end up in the Android manifest, you can easily add a custom manifest file to your project. The steps to create such a manifest file template are described in the Qt Creator manual.
Once you have added the template Android manifest file, open it. You will find the placeholder for the permissions in it:
<!-- %%INSERT_PERMISSIONS -->
Remove that line to prevent the deployment from automatically adding all the permissions the modules list as their requirements. After this, you can manually add the permissions you would like to use there. For example, if you would like to state that your app uses the QUERY_ALL_PACKAGES permission, you would add an entry such as below:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
Note: You will need to add an entry for each permission your app needs, as the deployment tool will not handle this for you anymore. For more information, see the relevant Android Documentation.
Note: Keep in mind that modifications in your manifest file are affecting your whole project, not just Qt for Android Automotive permissions.
Available under certain Qt licenses.
Find out more.