Set threshold of historical sessions size in PackageInstallerService

In extreme cases, size of historical sessions recorded in PackageInstallerService
is very large, resulting in huge memory usage in system server.
This commit adds threshold of historical sessions size and the oldest historical
sessions will be cleared if the list size reaches the threshold.

Bug: 248960979
Fixed: 248960979
Test: presubmit

Signed-off-by: Jiaquan Si <sijiaquan@oppo.corp-partner.google.com>
Change-Id: Ie0af8f00e73a59bdacc4b9a6f5bea0a2a3f9258b
1 file changed