Record AppFunction access after execution

Insert the access record into the database along with the attribution
after the execution is finished.

Also setup a periodic clean up task to delete any access histories that
is older than 30 days every 24 hours.

Bug: 427996654
Flag: android.permission.flags.app_function_access_api_enabled
Test: FrameworksAppFunctionsTests
Change-Id: Ie91e54364a08c56b215514ff6c605e277b7d717e
14 files changed