C

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.

Permissions by module

Permissions in Qt Android Automotive Base Module

The following table outlines the permissions used by the Qt Android Automotive Base Module.

PermissionUsed ByUsed For
QUERY_ALL_PACKAGESQAndroidAppsUtils, QAndroidNotificationListenerGetting the list of all the installed apps, getting their icons and notifications
REQUEST_DELETE_PACKAGESQAndroidAppsUtilsRequesting to uninstall a package
MANAGE_USERSQAndroidUserProfilesGetting the user information

Permissions in Qt Android Automotive Media Module

The following table outlines the permissions used by the Qt Android Automotive Media Module.

PermissionUsed ByUsed For
CAR_CONTROL_AUDIO_SETTINGSQDynamicAudioRoutingControlling application audio zone settings
CAR_CONTROL_AUDIO_VOLUMEQDynamicAudioRoutingInitializing the Dynamic Audio Routing API (only on Android 10)

Permissions in Qt Android Automotive Vehicle Module

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.

PermissionUsed ByUsed For
CONTROL_CAR_CLIMATEVehicle Properties libraryControlling all settings of the climate system in the car
CONTROL_CAR_WINDOWSVehicle Properties libraryControlling car windows and related parameters
CAR_ENERGYVehicle Properties libraryReading car energy information
CAR_ENERGY_PORTSVehicle Properties libraryAccessing charging port or fuel door states of the car
CONTROL_CAR_ENERGY_PORTSVehicle Properties libraryControlling charging ports or fuel doors of the car
CAR_INFOVehicle Properties libraryReading car manufacturer information, capabilities, available features
CAR_IDENTIFICATIONVehicle Properties libraryReading car identification data
CONTROL_CAR_MIRRORSVehicle Properties libraryControlling car mirror position and behavior
CONTROL_CAR_SEATSVehicle Properties libraryControlling car seat movement and state
CONTROL_CAR_DOORSVehicle Properties libraryControlling car doors
CAR_TIRESVehicle Properties libraryReading tire pressure
CAR_MILEAGEVehicle Properties libraryReading car odometer state
CAR_SPEEDVehicle Properties libraryReading car speed data
CAR_POWERTRAINVehicle Properties libraryReading car powertrain information
CAR_POWERVehicle Properties libraryReading car system power state information
CAR_ENGINE_DETAILEDVehicle Properties libraryReading engine-related information like RPM, fluid levels and temps
CAR_DYNAMICS_STATEVehicle Properties libraryReading state of dynamics systems like ABS or traction control
READ_CAR_DISPLAY_UNITSVehicle Properties libraryReading various display units used by the car
CONTROL_CAR_DISPLAY_UNITSVehicle Properties libraryControlling what display units the car uses
CAR_EXTERIOR_ENVIRONMENTVehicle Properties libraryReading car exterior environment like outside temperature
CAR_EXTERIOR_LIGHTSVehicle Properties libraryReading the state of all exterior car lights and indicators
CONTROL_CAR_EXTERIOR_LIGHTSVehicle Properties libraryControlling exterior car lights
READ_CAR_INTERIOR_LIGHTSVehicle Properties libraryReading car interior lights state
CONTROL_CAR_INTERIOR_LIGHTSVehicle Properties libraryControlling interior lights in the car
ADJUST_RANGE_REMAININGVehicle Properties libraryAdjusting the calculated remaining range of the car
CAR_VENDOR_EXTENSIONVehicle Properties libraryAccessing the vehicle vendor channel to exchange vendor-specific information

Permissions in Qt Android Activity View Module

The Qt Android Activity View Module uses the following permissions to be able to launch external Activities embedded into a QActivityView.

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.

PermissionRequired from
android.permission.ACTIVITY_EMBEDDINGall versions
android.permission.INJECT_EVENTSall versions
android.permission.INTERNAL_SYSTEM_WINDOWall versions
android.permission.MANAGE_ACTIVITY_STACKSall versions
android.permission.MANAGE_ACTIVITY_TASKSfrom Android 12
android.permission.QUERY_ALL_PACKAGESall versions
android.permission.REMOVE_TASKSall versions
android.permission.REORDER_TASKSall versions
android.permission.START_ANY_ACTIVITYall versions
android.permission.CAPTURE_BLACKOUT_CONTENTfrom Android 12
android.permission.INTERACT_ACROSS_USERS_FULLfrom Android 12
android.permission.ROTATE_SURFACE_FLINGERfrom Android 12
android.permission.ACCESS_SURFACE_FLINGERfrom Android 12
android.permission.READ_FRAME_BUFFERfrom Android 12

Handling permissions manually

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.