[HostStubGen] Allow method policy to override native substitution

A policy explicitly set on the method should override the class-level
native substitution setting. In order to do so, we introduce a new
method-level "NativeSubstitution" policy that can only be propagated
from a class-wide level, which makes it possible to override it in outer
filter levels (e.g. text policy + annotation policy).

We also update BodyReplacingMethodVisitor to support writing code into
methods without a body, so that all body replacing policies can be used
on any method.

Bug: 292141694
Flag: EXEMPT host test change only
Test: atest hoststubgen-test-tiny-test
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Change-Id: I75c016b96bf52e97dc0e685419abad23650e958b
16 files changed