Not allow to register for the same PackageMonitorCallback

Add a limitation for PackageManager#registerPackageMonitorCallback()
that not allow to register the same callback. We cannot limit the
count of the registered client. Most of registered clients are
different system service in the system_server, the count limitation
will crash the system.

Bug: 289567218
Test: atest FrameworksCorePackageMonitorTests
Test: atest FrameworksCorePackageMonitorWithoutPermissionTests
Test: manual. Boot success and the system registered callback can
receive callback

Change-Id: Ia79b4f49c0ac7cd8f3b11f6f2950c9b696fe2661
2 files changed