Add new getHistoricalSessions API to PMInternal

Sessions were written to strings to be stored as a historical session to
avoid keeping references on Bitmaps and other heavy-weight objects.
Since referenes to these heavy-weight object are all in SessionParams,
we just write the SessionParams to a string into a new
PackageInstallerHistoricalSession object.

Bug: 292091934
Test: manual install and check the dump
Change-Id: I839d67dff735a8e45ff206a0c9b08a1e72353042
5 files changed