Android AOSP13 Car emulator in bootloop after CAR_VENDOR_EXTENSION permission request(priv-app)

153 Views Asked by At

My Android AOSP 13 Car emulator (sdk_car_x86_64-userdebug) gets stuck in a bootloop after a vendor application named VehiclePropertyTest requests the CAR_VENDOR_EXTENSION permission. It is found that the Boot sequence could not complete because of priv-app permission allowlist issue throwing the following error:

02-01 19:28:30.814  2590  2590 W PackageManager: Privileged permission android.car.permission.CAR_VENDOR_EXTENSION for package com.example.vehiclepropertytest (/system_ext/priv-app/VehiclePropertyTest) not in privapp-permissions allowlist
02-01 19:28:33.067  2590  2590 W PackageManager: Privileged permission android.car.permission.CAR_VENDOR_EXTENSION for package com.example.vehiclepropertytest (/system_ext/priv-app/VehiclePropertyTest) not in privapp-permissions allowlist
02-01 19:28:33.068  2590  2590 E System  : java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {com.example.vehiclepropertytest (/system_ext/priv-app/VehiclePropertyTest): android.car.permission.CAR_VENDOR_EXTENSION}
02-01 19:28:33.068  2590  2590 E Zygote  : java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {com.example.vehiclepropertytest (/system_ext/priv-app/VehiclePropertyTest): android.car.permission.CAR_VENDOR_EXTENSION}
02-01 19:28:33.068  2590  2590 E AndroidRuntime: java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {com.example.vehiclepropertytest (/system_ext/priv-app/VehiclePropertyTest): android.car.permission.CAR_VENDOR_EXTENSION}

Created a vendor application called VehiclePropertyTest, which is a priv-app and uses the CAR_VENDOR_EXTENSION for a vendor specific property (which was already added in aidl hal).

Added the following permission in AndroidManifest.xml

<uses-permission android:name="android.car.permission.CAR_VENDOR_EXTENSION"/>

Troubleshooting Attempts:

Added the CAR_VENDOR_EXTENSION to permission allowlist by two ways:

  1. Modified permission to frameworks/base/data/etc/permissions/privapp-permissions-platform.xml from Android Documentation

    <privapp-permssions package="com.example.vehiclepropertytest">
         <permission name="android.car.permission.CAR_VENDOR_EXTENSION"/>
    </privapp-permissions>
    
  2. Creating a custom permission xml and added it to prebuilt_etc in appliction's Android.bp

privapp-permission-vehiclepropertytest.xml

<?xml version="1.0" encoding="utf-8"?>

<permissions>
  <privapp-permissions package="com.example.vehiclepropertytest">
       <permission name="android.car.permission.CAR_VENDOR_EXTENSION"/>
   </privapp-permissions>
</permissions>

Android.bp

prebuilt_etc {
   name: "privapp-permission-vehiclepropertytest",
   src: "privapp-permissions-vehiclepropertytest.xml",
   sub_dir: "permissions",
   filename_from_src: true,
}

then required: ["privapp-permission-vehiclepropertytest"], inside android_app{}

Questions:

  1. How can I verify if the CAR_VENDOR_EXTENSION permission is correctly added to the allowlist?
  2. Are there known conflicts or issues with this permission in AOSP 13?

Any insights would be appreciated. Thanks in advance :)

1

There are 1 best solutions below

1
Wonil On

As described in s.a.c document, priv permissions allowlist should be located in product, vendor, or system partition's specified location. Please take a look document for more detail. (I assumed you build your emulator from source codes)