Validate package name passed to setApplicationRestrictions. (Reland)

This adds validation that the package name passed to
setApplicationRestrictions is in the correct format. This will avoid
an issue where a path could be entered resulting in a file being
written to an unexpected place.

Bug: 239701237
Merged-In: I1ab2b7228470f10ec26fe3a608ae540cfc9e9a96
Change-Id: I56c2fc14f906cdad80181ab577e2ebc276c151c1
(cherry picked from commit 1b9b59c63bffc675a042cba6cd666831abef2c3e)
Merged-In: I56c2fc14f906cdad80181ab577e2ebc276c151c1
1 file changed