Introduce VMRuntime#isValidClassLoaderContext

This API is needed by the PackageManager server to validate class loader
context strings passed to it from untrusted applications. See the
discussion on I00357cfe086ff149f92c1078c6df6daa713c8f7c.

Test: atest com.android.server.pm.dex.DexManagerTests
Change-Id: I1a4fb1f863db94d27a84fd93f612541d2deb7bff
2 files changed