Skip to main content

Declaring permission

Vehicle SDK API requires Pleos vehicle permissions to be declared in the Android manifest. Refer to the @RequiresPermission annotation and constant definitions in PleosPermission.

Permission types

PleosPermission constants are distinguished by prefixes. Declare each permission in the manifest using the pleos.car.permission.{CONSTANT_NAME} format.

PrefixExamplePurpose
CAR_*CAR_DOORSpleos.car.permission.CAR_DOORSRetrieve domain data (get)
CONTROL_CAR_*CONTROL_CAR_DOORSControl a domain (set)

Representative permissions by domain (CAR_*)

These are typical read permissions per domain. Each API may require a different permission—check @RequiresPermission before calling.

DomainConstantManifest value
DoorCAR_DOORSpleos.car.permission.CAR_DOORS
Window, WiperCAR_WINDOWSpleos.car.permission.CAR_WINDOWS
HVACCAR_CLIMATEpleos.car.permission.CAR_CLIMATE
DrivingMode, Brake, OdometerCAR_DRIVEpleos.car.permission.CAR_DRIVE
EvBattery, FuelCAR_ENERGYpleos.car.permission.CAR_ENERGY
CarInfo, DisplayCAR_INFOpleos.car.permission.CAR_INFO
Light, TurnSignalCAR_LIGHTSpleos.car.permission.CAR_LIGHTS
SideMirrorCAR_MIRRORSpleos.car.permission.CAR_MIRRORS
Safety, TireCAR_SAFETYpleos.car.permission.CAR_SAFETY
SeatCAR_SEATSpleos.car.permission.CAR_SEATS
TollCAR_TOLLpleos.car.permission.CAR_TOLL

Permission declaration example

Declare only permissions for domains you use. For dependencies, see Importing Vehicle SDK.

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="pleos.car.permission.CAR_DOORS" />
<uses-permission android:name="pleos.car.permission.CAR_INFO" />

<!-- Declare only the permissions for domains you use -->

</manifest>

Missing permissions

When a required permission is missing, the API passes an Exception to onFailed. If the exception is a VehicleException, it can correspond to ERROR_SECURITY_PERMISSION. For handling instructions, see Error code.