Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e771969 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Allow "experimental" class to be always loadable.

Previously, when a class with <clinit> is "experimental", even
the "<clinit>" would throw, which would render the class to be
unloadable, which would cause lot of problems.

Now, "experimental API hook" returns a boolean. If it returns "false"
(instead of throwing), we skip the rest of the method body, which
essentially simulates `@Ignore`.

For now, only <clinit> can return false.

It'd be nice if we can support other methods too, but:
- <init> must call super.<init>, so we can't inject an early return.
- For other methods, generating a stack map frame was kind of painful
unless it's void.

Supporting non-<clinit> methods isn't really critical at all, so let's
just ignore it for now.

Bug: 292141694
Flag: TEST_ONLY
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh -r
Change-Id: I68e5356465a2e6c4ae053d406ef0740b77968685
parent e6020b6c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment