amosproj / amos2022ws02-automotive-test-app

Android Automotive Testapp
MIT License
12 stars 0 forks source link

Implement functionality of reading and changing the vehicle identifier number #162

Closed i315315 closed 1 year ago

i315315 commented 1 year ago

User story

  1. As a user
  2. I want to be able to read and edit the vehicle identifier number in the vehicle properties context
  3. So that I can change the vehicle identifier number of my car.

With this user story, the functionality to change the vehicle identifier number is to be implemented. The button has been implemented with user story #141 .

Acceptance criteria

Notes

Please take into account the information we have received from the industry partner to make the app privileged in order to be able to change the vehicle identifier number. See below:

1.  Separates Permission xml File erstellen, Beispiel privapp-permissions-my.package.name:
<permissions>
    <privapp-permissions package=" my.package.name ">
        <permission name="android.permission.MY_PRIVAPP_PERMISSION "/>
    </privapp-permissions>
</permissions>
2.  Im Android makefile LOCAL_PRIVILEGED_MODULE := true und LOCAL_REQUIRED_MODULES := privapp-permissions-my.package.name.xml
3.  Privapp-permission.xml  und App in priv-app Folder packen:
a.  Installing an app as privileged means that the app needs to be installed in a folder /<partition>/priv-app, where <partition> may be system, system_ext, product, etc. , but not data.
# precondition: emulator has been started with parameter "-writable-system"
adb root
adb remount
adb shell mkdir /product/ my.package.name
adb push my.package.name.apk /product/priv-app/ my.package.name / my.package.name.apk
# "reboot" Android, e.g.
adb shell stop
adb shell start

The folder for the Privapp-permission.xml is either under priv-app or product, make sure it is the same partition.

The students can try this, but even if it works it's pretty stupid, because you have to install it manually on every target/emulator to get the permission.

Ressources: https://source.android.com/docs/core/permissions/perms-allowlist

Definition of done (DoD)

DoD general criteria

BETuncay commented 1 year ago

The issue can be indirectly solved by using the carPropertyManagers function isPropertyAvailable(). This function returns "False" if a property is available but the access rights are missing. This is the case for INFO_VIN, since it requires system rights.
The information from the buissness partner is very helpful but insufficient. The precondition: emulator started "-writable-system" did not work in my case. To access internal memory and get root rights it is necessary to build an AOSP Car AVD from ground up and then apply the changes given by the stakeholder.

stefanieschreiner commented 1 year ago

not feasible within the size of our project, no solution can be found.