Limit DPC app restrictions to a global maximum of 1000 packages

Adds validation in DevicePolicyManagerService to ensure that the total
number of application restrictions set on a device cannot exceed 1000
packages.
This limit is enforced globally across all admins combined by using
`getLocalPolicyKeysSetByAllAdmins`, ensuring that multiple Profile Owners
or Delegated Apps cannot bypass the cap.
Also includes comprehensive unit test coverage to validate the
enforcement for both single-admin and multi-admin configurations.

NO_JAVA_FORMAT=Not relevant to this change, existing and untouched lines.

Bug: b/281543351
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Tested: ab/I43100010583082947
Flag: EXEMPT BUGFIX
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:c9c04f595d904aff21ebdd67986b5a9250d6406a
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:598eddaabe731afbfb3c9265d36b637a346e5604
Merged-In: I8e13de9db9ef85f930958a88bb237648b36767c2
Change-Id: I8e13de9db9ef85f930958a88bb237648b36767c2
3 files changed