Introduce VMRuntime.isValidClassLoaderContext

In the PackageManager server we need to validate class loader contexts
that we receive from an untrusted process. In order to keep class loader
context parsing logic centralized within the runtime let's create an API
which returns whether or not the runtime can parse the encoded class
loader context.

Test: Build system image, open app using secondary dex
Test: atest atest com.android.server.pm.dex.DexManagerTests
Test: m test-art-host-gtest-class_loader_context_test
Change-Id: Ied676e3239f70a8ab9d066df79f377b7036b28b7
4 files changed