diff options
28 files changed, 1645 insertions, 178 deletions
diff --git a/core/java/android/content/BroadcastReceiver.java b/core/java/android/content/BroadcastReceiver.java index 964a8be0f153..ad2b50e66728 100644 --- a/core/java/android/content/BroadcastReceiver.java +++ b/core/java/android/content/BroadcastReceiver.java @@ -52,6 +52,8 @@ import com.android.internal.os.DebugStore; * <a href="{@docRoot}guide/components/broadcasts.html">Broadcasts</a> developer guide.</p></div> * */ +@android.ravenwood.annotation.RavenwoodPartiallyAllowlisted +@android.ravenwood.annotation.RavenwoodKeepPartialClass public abstract class BroadcastReceiver { @UnsupportedAppUsage private PendingResult mPendingResult; @@ -361,6 +363,7 @@ public abstract class BroadcastReceiver { } } + @android.ravenwood.annotation.RavenwoodKeep public BroadcastReceiver() { } diff --git a/ravenwood/texts/ravenwood-framework-policies.txt b/ravenwood/texts/ravenwood-framework-policies.txt index fff9e6ad41d5..bd51b9303f7e 100644 --- a/ravenwood/texts/ravenwood-framework-policies.txt +++ b/ravenwood/texts/ravenwood-framework-policies.txt @@ -50,8 +50,10 @@ class android.net.UriCodec keepclass # no-pta class android.telephony.PinResult keepclass # no-pta # Just enough to support mocking, no further functionality -class android.content.BroadcastReceiver keep # no-pta - method <init> ()V keep +class android.content.BroadcastReceiver allow-annotation + method <init> ()V allow-annotation + +# TODO: Convert the following policies to "allow-annotation". class android.content.Context keep # no-pta method <init> ()V keep method getSystemService (Ljava/lang/Class;)Ljava/lang/Object; keep # no-pta diff --git a/ravenwood/texts/ravenwood-standard-options.txt b/ravenwood/texts/ravenwood-standard-options.txt index 0edc348fc7f2..233657557747 100644 --- a/ravenwood/texts/ravenwood-standard-options.txt +++ b/ravenwood/texts/ravenwood-standard-options.txt @@ -36,6 +36,9 @@ --ignore-annotation android.ravenwood.annotation.RavenwoodIgnore +--partially-allowed-annotation + android.ravenwood.annotation.RavenwoodPartiallyAllowlisted + --substitute-annotation android.ravenwood.annotation.RavenwoodReplace diff --git a/ravenwood/tools/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestPartiallyAllowlisted.java b/ravenwood/tools/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestPartiallyAllowlisted.java new file mode 100644 index 000000000000..49b5938941fb --- /dev/null +++ b/ravenwood/tools/hoststubgen/annotations-src/android/hosttest/annotation/HostSideTestPartiallyAllowlisted.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hosttest.annotation; + +import static java.lang.annotation.ElementType.TYPE; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({TYPE}) +@Retention(RetentionPolicy.CLASS) +public @interface HostSideTestPartiallyAllowlisted { +} diff --git a/ravenwood/tools/hoststubgen/hoststubgen-standard-options.txt b/ravenwood/tools/hoststubgen/hoststubgen-standard-options.txt index 9c46a1646560..062541241d2c 100644 --- a/ravenwood/tools/hoststubgen/hoststubgen-standard-options.txt +++ b/ravenwood/tools/hoststubgen/hoststubgen-standard-options.txt @@ -20,6 +20,9 @@ --keep-class-annotation android.hosttest.annotation.HostSideTestWholeClassKeep +--partially-allowed-annotation + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + --throw-annotation android.hosttest.annotation.HostSideTestThrow diff --git a/ravenwood/tools/hoststubgen/hoststubgen-test-policy-override.txt b/ravenwood/tools/hoststubgen/hoststubgen-test-policy-override.txt deleted file mode 100644 index 000771a7022e..000000000000 --- a/ravenwood/tools/hoststubgen/hoststubgen-test-policy-override.txt +++ /dev/null @@ -1,82 +0,0 @@ -# ************************************************************************************************* -# This file contains "policies" for HostStubGen used by its automated tests. -# For the "real" Ravenwood policies, see the frameworks/base/ravenwood/texts/ directory. -# ************************************************************************************************* - -# -------------------------------------------------------------------------------------------------- -# Directions on auto-generated classes, where we can't use Java annotations (yet). -# -------------------------------------------------------------------------------------------------- -class android.Manifest stubclass -class android.R stubclass -class android.os.PersistableBundleProto keepclass - -# This is in module-utils, where using a HostStubGen annotation would be complicated, so we -# add a direction here rather than using a java annotation. -# The build file says it's deprecated, anyway...? Figure out what to do with it. -class com.android.internal.util.Preconditions keepclass - -# -------------------------------------------------------------------------------------------------- -# Actual framework classes -# -------------------------------------------------------------------------------------------------- - -# Put basic exception classes in the "impl" jar. -# We don't put them in stub yet (until something actually needs them). -class android.os.DeadObjectException keepclass -class android.os.DeadSystemRuntimeException keepclass -class android.os.NetworkOnMainThreadException keepclass -class android.os.RemoteException keepclass -class android.os.ServiceSpecificException keepclass -class android.util.AndroidException keepclass -class android.util.AndroidRuntimeException keepclass -class android.os.DeadSystemException keepclass - - -# For now, we only want to expose ArrayMap and Log, but they and their tests depend on -# more classes. - -class android.util.ArrayMap stubclass - -# Used by ArrayMap. No need to put them in the stub, but we need them in impl. -class android.util.MapCollections keepclass -class android.util.ContainerHelpers keepclass -class android.util.EmptyArray stubclass -class com.android.internal.util.XmlUtils keepclass -class com.android.internal.util.FastMath keepclass -class android.util.MathUtils keepclass - - -class android.util.Log stubclass -class android.util.Slog stubclass -# We don't use Log's native code, yet. Instead, the following line enables the Java substitution. -# Comment it out to disable Java substitution of Log's native methods. -class android.util.Log !com.android.hoststubgen.nativesubstitution.Log_host - -# Used by log -class com.android.internal.util.FastPrintWriter keepclass -class com.android.internal.util.LineBreakBufferedWriter keepclass - -class android.util.EventLog stubclass -class android.util.EventLog !com.android.hoststubgen.nativesubstitution.EventLog_host -class android.util.EventLog$Event stubclass - -# Expose Context because it's referred to by AndroidTestCase, but don't need to expose any of -# its members. -class android.content.Context keep - -# Expose Parcel, Parcel and there relevant classes, which are used by ArrayMapTets. -class android.os.Parcelable StubClass -class android.os.Parcel StubClass -class android.os.Parcel !com.android.hoststubgen.nativesubstitution.Parcel_host - -class android.os.IBinder stubClass -class android.os.IInterface stubclass - -class android.os.BadParcelableException stubclass -class android.os.BadTypeParcelableException stubclass - -class android.os.BaseBundle stubclass -class android.os.Bundle stubclass -class android.os.PersistableBundle stubclass - -class android.os.MessageQueue stubclass -class android.os.MessageQueue !com.android.hoststubgen.nativesubstitution.MessageQueue_host diff --git a/ravenwood/tools/hoststubgen/invoketest/hoststubgen-invoke-test.sh b/ravenwood/tools/hoststubgen/invoketest/hoststubgen-invoke-test.sh index 084448d0a797..da1e40a27944 100755 --- a/ravenwood/tools/hoststubgen/invoketest/hoststubgen-invoke-test.sh +++ b/ravenwood/tools/hoststubgen/invoketest/hoststubgen-invoke-test.sh @@ -47,6 +47,7 @@ INJAR=hoststubgen-test-tiny-framework.jar OUTJAR=$TEMP/host.jar ANNOTATION_FILTER=$TEMP/annotation-filter.txt +POLICY_FILE=$TEMP/policy-file.txt HOSTSTUBGEN_OUT=$TEMP/output.txt @@ -66,12 +67,14 @@ hoststubgen() { run_hoststubgen() { local test_name="$1" local annotation_filter="$2" + local policy="$3" echo "# Test: $test_name" cleanup_temp local filter_arg="" + local policy_arg="" if [[ "$annotation_filter" != "" ]] ; then echo "$annotation_filter" > $ANNOTATION_FILTER @@ -80,6 +83,13 @@ run_hoststubgen() { cat $ANNOTATION_FILTER fi + if [[ "$policy" != "" ]] ; then + echo "$policy" > $POLICY_FILE + policy_arg="--policy-override-file $POLICY_FILE" + echo "=== policy ===" + cat $POLICY_FILE + fi + local out_arg="" if [[ "$OUTJAR" != "" ]] ; then @@ -108,7 +118,10 @@ run_hoststubgen() { android.hosttest.annotation.HostSideTestClassLoadHook \ --keep-static-initializer-annotation \ android.hosttest.annotation.HostSideTestStaticInitializerKeep \ + --partially-allowed-annotation \ + android.hosttest.annotation.HostSideTestPartiallyAllowlisted \ $filter_arg \ + $policy_arg \ $EXTRA_ARGS \ |& tee $HOSTSTUBGEN_OUT HOSTSTUBGEN_RC=${PIPESTATUS[0]} @@ -132,10 +145,11 @@ assert_file_generated() { } run_hoststubgen_for_success() { + local test_name="$1" run_hoststubgen "$@" if (( $HOSTSTUBGEN_RC != 0 )) ; then - echo "HostStubGen expected to finish successfully, but failed with $rc" + echo "HostStubGen expected to finish successfully, but failed with $HOSTSTUBGEN_RC: Test=$test_name" return 1 fi @@ -151,7 +165,7 @@ run_hoststubgen_for_failure() { run_hoststubgen "$test_name" "$@" if (( $HOSTSTUBGEN_RC == 0 )) ; then - echo "HostStubGen expected to fail, but it didn't fail" + echo "HostStubGen expected to fail, but it didn't fail. Test=$test_name" return 1 fi @@ -161,24 +175,31 @@ run_hoststubgen_for_failure() { # Start the tests... +# These classes require special care, so let's delete them in most tests... +DELETE_PARTIAL_ANNOTATION_CLASSESS=' +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove +' + # Pass "" as a filter to _not_ add `--annotation-allowed-classes-file`. -run_hoststubgen_for_success "No annotation filter" "" +run_hoststubgen_for_success "No annotation filter" "" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" # Now, we use " ", so we do add `--annotation-allowed-classes-file`. run_hoststubgen_for_failure "No classes are allowed to have annotations" \ "not allowed to have Ravenwood annotations" \ - " " + " " "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_success "All classes allowed (wildcard)" \ " * # Allow all classes -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_failure "All classes disallowed (wildcard)" \ "not allowed to have Ravenwood annotations" \ " !* # Disallow all classes -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_failure "Some classes not allowed (1)" \ "not allowed to have Ravenwood annotations" \ @@ -186,7 +207,7 @@ run_hoststubgen_for_failure "Some classes not allowed (1)" \ android.hosttest.* com.android.hoststubgen.* com.supported.* -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_failure "Some classes not allowed (2)" \ "not allowed to have Ravenwood annotations" \ @@ -194,7 +215,7 @@ run_hoststubgen_for_failure "Some classes not allowed (2)" \ android.hosttest.* com.android.hoststubgen.* com.unsupported.* -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_success "All classes allowed (package wildcard)" \ " @@ -202,27 +223,109 @@ android.hosttest.* com.android.hoststubgen.* com.supported.* com.unsupported.* -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_failure "One specific class disallowed" \ "TinyFrameworkAnnotations is not allowed to have Ravenwood annotations" \ " !com.android.hoststubgen.test.tinyframework.TinyFrameworkAnnotations * # All other classes allowed -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" run_hoststubgen_for_success "One specific class disallowed, but it doesn't use annotations" \ " !com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPolicy * # All other classes allowed -" +" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" -OUTJAR="" run_hoststubgen_for_success "No output generation" "" +OUTJAR="" run_hoststubgen_for_success "No output generation" "" "$DELETE_PARTIAL_ANNOTATION_CLASSESS" EXTRA_ARGS="--in-jar abc" run_hoststubgen_for_failure "Duplicate arg" \ "Duplicate or conflicting argument found: --in-jar" \ "" +# --------------------------------------------------------------------------------------------- +# Tests for "partially-allowlisted". +# --------------------------------------------------------------------------------------------- + +# Allowlist used by hoststubgen-test-tiny-test. +ALLOWLIST=' +com.android.hoststubgen.test.tinyframework.* +com.supported.* +com.unsupported.* +!* +' + +run_hoststubgen_for_success 'The settings used by hoststubgen-test-tiny-test' \ + "$ALLOWLIST" \ + ' +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation + method foo2 allow-annotation + +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove +' + +run_hoststubgen_for_failure 'PartiallyAllowlisted does not have allow-annotation' \ + "PartiallyAllowlisted has annotation android.hosttest.annotation.HostSideTestPartiallyAllowlisted, but" \ + "$ALLOWLIST" \ + ' +#class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation +# method foo2 allow-annotation + +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove +' + + +run_hoststubgen_for_failure 'PartiallyAllowlisted.foo2 does not have allow-annotation' \ + "foo2(I)I is not allowed to have Ravenwood annotations. (Class is partially allowlisted.)" \ + "$ALLOWLIST" \ + ' +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation +# method foo2 allow-annotation + +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove +' + +run_hoststubgen_for_failure 'Partially-allowlisted classes cannot have class-wide policies' \ + "PartialWithWholeClass_bad has class wide annotation android.hosttest.annotation.HostSideTestWholeClassKeep" \ + "$ALLOWLIST" \ + ' +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation + method foo2 allow-annotation + +# Now with allow-annotation +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad allow-annotation + +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove +' + +run_hoststubgen_for_failure 'Partially-allowlisted classes cannot have class-wide policies' \ + "PartiallyAllowlistedWithoutAnnot_bad must have android.hosttest.annotation.HostSideTestPartiallyAllowlisted" \ + "$ALLOWLIST" \ + ' +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation + method foo2 allow-annotation +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove + +# Now with allow-annotation +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad allow-annotation +' + +run_hoststubgen_for_success 'The settings used by hoststubgen-test-tiny-test' \ + "$ALLOWLIST" \ + ' +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation + method foo2 allow-annotation +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove + +# NoAnnotations has no annotations at all. Setting "allow-annotation" to it is okay even though +# it does not have an @HostSideTestPartiallyAllowlisted, because it does nott have any other annotations anyway. +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$NoAnnotations allow-annotation +' echo "All tests passed" exit 0 diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt index 83a7069bb308..7e294ed652d3 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGen.kt @@ -151,7 +151,7 @@ class HostStubGen(val options: HostStubGenOptions) { filter ) - val annotationAllowedClassesFilter = options.annotationAllowedClassesFile.get.let { file -> + val annotationAllowedPredicate = options.annotationAllowedClassesFile.get.let { file -> if (file == null) { ClassPredicate.newConstantPredicate(true) // Allow all classes } else { @@ -160,7 +160,7 @@ class HostStubGen(val options: HostStubGenOptions) { } // Next, Java annotation based filter. - filter = AnnotationBasedFilter( + val annotFilter = AnnotationBasedFilter( errors, allClasses, options.keepAnnotations, @@ -172,10 +172,12 @@ class HostStubGen(val options: HostStubGenOptions) { options.redirectAnnotations, options.redirectionClassAnnotations, options.classLoadHookAnnotations, + options.partiallyAllowedAnnotations, options.keepStaticInitializerAnnotations, - annotationAllowedClassesFilter, + annotationAllowedPredicate, filter ) + filter = annotFilter // Next, "text based" filter, which allows to override polices without touching // the target code. @@ -183,6 +185,7 @@ class HostStubGen(val options: HostStubGenOptions) { val builder = TextFileFilterPolicyBuilder(allClasses, filter) options.policyOverrideFiles.forEach(builder::parse) filter = builder.createOutputFilter() + annotFilter.annotationAllowedMembers = builder.annotationAllowedMembersFilter } // Apply the implicit filter. diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt index 297420d08ac1..1ab88d24ab28 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt @@ -86,6 +86,7 @@ class HostStubGenOptions( var removeAnnotations: MutableSet<String> = mutableSetOf(), var ignoreAnnotations: MutableSet<String> = mutableSetOf(), var keepClassAnnotations: MutableSet<String> = mutableSetOf(), + var partiallyAllowedAnnotations: MutableSet<String> = mutableSetOf(), var redirectAnnotations: MutableSet<String> = mutableSetOf(), var substituteAnnotations: MutableSet<String> = mutableSetOf(), @@ -181,6 +182,9 @@ class HostStubGenOptions( "--keep-class-annotation" -> ret.keepClassAnnotations.addUniqueAnnotationArg() + "--partially-allowed-annotation" -> + ret.partiallyAllowedAnnotations.addUniqueAnnotationArg() + "--throw-annotation" -> ret.throwAnnotations.addUniqueAnnotationArg() @@ -287,6 +291,7 @@ class HostStubGenOptions( removeAnnotations=$removeAnnotations, ignoreAnnotations=$ignoreAnnotations, keepClassAnnotations=$keepClassAnnotations, + partiallyAllowedAnnotations=$partiallyAllowedAnnotations, substituteAnnotations=$substituteAnnotations, nativeSubstituteAnnotations=$redirectionClassAnnotations, classLoadHookAnnotations=$classLoadHookAnnotations, diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt index f47aaba8ef22..735635cc309a 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt @@ -191,7 +191,14 @@ fun String.toJvmClassName(): String { } fun String.toHumanReadableClassName(): String { - return this.replace('/', '.') + var ret = this + if (ret.startsWith("L")) { + ret = ret.substring(1) + } + if (ret.endsWith(";")) { + ret = ret.substring(0, ret.length - 1) + } + return ret.replace('/', '.') } fun String.toHumanReadableMethodName(): String { diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt index 9b5d60237db0..73c72a21ef7b 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/AnnotationBasedFilter.kt @@ -53,10 +53,19 @@ class AnnotationBasedFilter( redirectAnnotations_: Set<String>, redirectionClassAnnotations_: Set<String>, classLoadHookAnnotations_: Set<String>, + partiallyAllowlistedClassAnnotations_: Set<String>, keepStaticInitializerAnnotations_: Set<String>, private val annotationAllowedClassesFilter: ClassPredicate, fallback: OutputFilter, ) : DelegatingFilter(fallback) { + + /** + * This is a filter chain to check if an entity (class/member) has a "allow-annotation" + * policy. + */ + var annotationAllowedMembers: OutputFilter = + ConstantFilter(FilterPolicy.Remove, "default disallowed") + private val keepAnnotations = convertToInternalNames(keepAnnotations_) private val keepClassAnnotations = convertToInternalNames(keepClassAnnotations_) private val throwAnnotations = convertToInternalNames(throwAnnotations_) @@ -67,6 +76,9 @@ class AnnotationBasedFilter( private val redirectionClassAnnotations = convertToInternalNames(redirectionClassAnnotations_) private val classLoadHookAnnotations = convertToInternalNames(classLoadHookAnnotations_) + private val partiallyAllowlistedClassAnnotations = + convertToInternalNames(partiallyAllowlistedClassAnnotations_) + private val keepStaticInitializerAnnotations = convertToInternalNames(keepStaticInitializerAnnotations_) @@ -79,17 +91,22 @@ class AnnotationBasedFilter( redirectAnnotations + substituteAnnotations - /** All the annotations we use. */ - private val allAnnotations = visibilityAnnotations + + /** + * Annotations that require "fully" allowlisting. + */ + private val allowlistRequiringAnnotations = visibilityAnnotations + redirectionClassAnnotations + classLoadHookAnnotations + keepStaticInitializerAnnotations + // partiallyAllowlistedClassAnnotations // This is excluded. /** - * All the annotations we use. Note, this one is in a [convertToJvmNames] format unlike - * other ones, because of how it's used. + * We always keep these types. + * + * Note, this one is in a [convertToJvmNames] format unlike other ones, because of how it's + * used. */ - private val allAnnotationClasses: Set<String> = convertToJvmNames( + private val alwaysKeepClasses: Set<String> = convertToJvmNames( keepAnnotations_ + keepClassAnnotations_ + throwAnnotations_ + @@ -98,6 +115,7 @@ class AnnotationBasedFilter( substituteAnnotations_ + redirectionClassAnnotations_ + classLoadHookAnnotations_ + + partiallyAllowlistedClassAnnotations_ + keepStaticInitializerAnnotations_ ) @@ -122,7 +140,7 @@ class AnnotationBasedFilter( override fun getPolicyForClass(className: String): FilterPolicyWithReason { // If it's any of the annotations, then always keep it. - if (allAnnotationClasses.contains(className)) { + if (alwaysKeepClasses.contains(className)) { return FilterPolicy.KeepClass.withReason("HostStubGen Annotation") } @@ -197,13 +215,34 @@ class AnnotationBasedFilter( val classLoadHooks: List<String> init { - val allowAnnotation = annotationAllowedClassesFilter.matches(cn.name) - detectInvalidAnnotations( - cn.name, allowAnnotation, + // First, check if the class has "partially-allowed" policy. + // This filter chain contains + val annotationPartiallyAllowedClass = + annotationAllowedMembers.getPolicyForClass(cn.name).policy == + FilterPolicy.AnnotationAllowed + + // If a class is partially-allowlisted, then it's not fully-allowlisted. + // Otherwise, just use annotationAllowedClassesFilter. + val fullyAllowAnnotation = !annotationPartiallyAllowedClass && + annotationAllowedClassesFilter.matches(cn.name) + detectInvalidAnnotations(isClass = true, + cn.name, fullyAllowAnnotation, annotationPartiallyAllowedClass, + annotationPartiallyAllowedClass, cn.visibleAnnotations, cn.invisibleAnnotations, "class", cn.name ) - classPolicy = cn.findAnyAnnotation(visibilityAnnotations)?.policy + + val classAnnot = cn.findAnyAnnotation(visibilityAnnotations) + classPolicy = classAnnot?.policy + + classPolicy?.let { policy -> + if (policy.policy.isClassWide && annotationPartiallyAllowedClass) { + errors.onErrorFound("Class ${cn.name.toHumanReadableClassName()}" + + " has class wide annotation" + + " ${classAnnot?.desc?.toHumanReadableClassName()}" + + ", which can't be used in a partially-allowlisted class") + } + } redirectionClass = cn.findAnyAnnotation(redirectionClassAnnotations)?.let { an -> getAnnotationField(an, "value")?.let { resolveRelativeClass(cn, it) } } @@ -216,8 +255,10 @@ class AnnotationBasedFilter( } for (fn in cn.fields ?: emptyList()) { - detectInvalidAnnotations( - cn.name, allowAnnotation, + val partiallyAllowAnnotation = false // No partial allowlisting on fields (yet) + detectInvalidAnnotations(isClass = false, + cn.name, fullyAllowAnnotation, partiallyAllowAnnotation, + annotationPartiallyAllowedClass, fn.visibleAnnotations, fn.invisibleAnnotations, "field", cn.name, fn.name ) @@ -227,8 +268,12 @@ class AnnotationBasedFilter( } for (mn in cn.methods ?: emptyList()) { - detectInvalidAnnotations( - cn.name, allowAnnotation, + val partiallyAllowAnnotation = + annotationAllowedMembers.getPolicyForMethod(cn.name, mn.name, mn.desc).policy == + FilterPolicy.AnnotationAllowed + detectInvalidAnnotations(isClass = false, + cn.name, fullyAllowAnnotation, partiallyAllowAnnotation, + annotationPartiallyAllowedClass, mn.visibleAnnotations, mn.invisibleAnnotations, "method", cn.name, mn.name, mn.desc ) @@ -263,8 +308,11 @@ class AnnotationBasedFilter( * to avoid unnecessary string concatenations. */ private fun detectInvalidAnnotations( + isClass: Boolean, className: String, - allowAnnotation: Boolean, + fullyAllowAnnotation: Boolean, + partiallyAllowAnnotation: Boolean, + classPartiallyAllowAnnotation: Boolean, visibles: List<AnnotationNode>?, invisibles: List<AnnotationNode>?, type: String, @@ -272,13 +320,26 @@ class AnnotationBasedFilter( name2: String = "", name3: String = "", ) { + // Lazily create the description. + val desc = { getItemDescription(type, name1, name2, name3) } + + val partiallyAllowlistAnnotation = + findAnyAnnotation(partiallyAllowlistedClassAnnotations, visibles, invisibles) + partiallyAllowlistAnnotation?.let { anot -> + if (!partiallyAllowAnnotation) { + errors.onErrorFound(desc() + + " has annotation ${anot.desc?.toHumanReadableClassName()}, but" + + " doesn't have" + + " '${FilterPolicy.AnnotationAllowed.policyStringOrPrefix}' policy.'") + } + } var count = 0 var visibleCount = 0 for (an in visibles ?: emptyList()) { if (visibilityAnnotations.contains(an.desc)) { visibleCount++ } - if (allAnnotations.contains(an.desc)) { + if (allowlistRequiringAnnotations.contains(an.desc)) { count++ } } @@ -286,28 +347,54 @@ class AnnotationBasedFilter( if (visibilityAnnotations.contains(an.desc)) { visibleCount++ } - if (allAnnotations.contains(an.desc)) { + if (allowlistRequiringAnnotations.contains(an.desc)) { count++ } } - if (count > 0 && !allowAnnotation) { + // Special case -- if it's a class, and has an "allow-annotation" policy + // *and* if it actually has an annotation, then it must have the + // "PartiallyAllowlisted" annotation. + // Conversely, even if it has an "allow-annotation" policy, it's okay + // if it doesn't have the annotation, as long as it doesn't have any + // annotations. + if (isClass && count > 0 && partiallyAllowAnnotation) { + if (partiallyAllowlistAnnotation == null) { + val requiredAnnot = partiallyAllowlistedClassAnnotations.firstOrNull() + throw InvalidAnnotationException( + "${desc()} must have ${requiredAnnot?.toHumanReadableClassName()} to use" + + " annotations") + } + } + + if (count > 0 && !(fullyAllowAnnotation || partiallyAllowAnnotation)) { + val extInfo = if (classPartiallyAllowAnnotation) { + " (Class is partially allowlisted.)" + } else {""} throw InvalidAnnotationException( - "Class ${className.toHumanReadableClassName()} is not allowed to have " + - "Ravenwood annotations. Contact g/ravenwood for more details." + "${desc()} is not allowed to have " + + "Ravenwood annotations.$extInfo Contact g/ravenwood for more details." ) } if (visibleCount > 1) { - val description = if (name2 == "" && name3 == "") { - "$type $name1" - } else { - "$type $name1.$name2$name3" - } throw InvalidAnnotationException( - "Found more than one visibility annotations on $description" + "Found more than one visibility annotations on ${desc()}" ) } } + private fun getItemDescription( + type: String, + name1: String, + name2: String, + name3: String, + ): String { + return if (name2 == "" && name3 == "") { + "$type $name1" + } else { + "$type $name1.$name2$name3" + } + } + /** * Return the (String) value of 'value' parameter from an annotation. */ diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt index 2f2f81b05ad1..81c26ffdf1f4 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/FilterPolicy.kt @@ -15,44 +15,51 @@ */ package com.android.hoststubgen.filters -enum class FilterPolicy { +enum class FilterPolicy(val policyStringOrPrefix: String) { /** * Keep the item in the jar file. */ - Keep, + Keep("keep"), /** * Only usable with classes. Keep the class in the jar, and also all its members. * Each member can have another policy to override it. */ - KeepClass, + KeepClass("keepclass"), /** * Only usable with methods. Replace a method with a "substitution" method. */ - Substitute, + Substitute("@"), // @ is a prefix /** * Only usable with methods. Redirect a method to a method in the substitution class. */ - Redirect, + Redirect("redirect"), /** * Only usable with methods. The item will be kept in the impl jar file, but when called, * it'll throw. */ - Throw, + Throw("throw"), /** * Only usable with methods. The item will be kept in the impl jar file, but when called, * it'll no-op. */ - Ignore, + Ignore("ignore"), /** * Remove the item completely. */ - Remove; + Remove("remove"), + + /** + * Special policy used for "partial annotation allowlisting". This policy must not be + * used in the "main" filter chain. (which would be detected by [SanitizationFilter].) + * It's used in a separate filter chain used by [AnnotationBasedFilter]. + */ + AnnotationAllowed("allow-annotation"); val needsInOutput: Boolean get() { @@ -66,7 +73,7 @@ enum class FilterPolicy { val isUsableWithClasses: Boolean get() { return when (this) { - Keep, KeepClass, Remove -> true + Keep, KeepClass, Remove, AnnotationAllowed -> true else -> false } } @@ -75,6 +82,7 @@ enum class FilterPolicy { val isUsableWithFields: Boolean get() { return when (this) { + // AnnotationAllowed isn't supported on fields (yet). We could support it if needed. Keep, Remove -> true else -> false } @@ -102,7 +110,7 @@ enum class FilterPolicy { val isSupported: Boolean get() { return when (this) { - Keep, KeepClass, Substitute, Redirect -> true + Keep, KeepClass, Substitute, Redirect, AnnotationAllowed -> true else -> false } } @@ -115,6 +123,25 @@ enum class FilterPolicy { } } + val isClassWide: Boolean + get() { + return when (this) { + Remove, KeepClass -> true + else -> false + } + } + + /** + * Internal policies must not be used in the main filter chain. + */ + val isInternalPolicy: Boolean + get() { + return when (this) { + AnnotationAllowed -> true + else -> false + } + } + /** * Convert KeepClass to Keep, or return itself. */ diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt index 18a1e16bcf3a..4375c6500b62 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/SanitizationFilter.kt @@ -16,6 +16,7 @@ package com.android.hoststubgen.filters import com.android.hoststubgen.HostStubGenErrors +import com.android.hoststubgen.HostStubGenInternalException import com.android.hoststubgen.asm.ClassNodes import com.android.hoststubgen.asm.toHumanReadableClassName import com.android.hoststubgen.log @@ -28,12 +29,30 @@ class SanitizationFilter( private val classes: ClassNodes, fallback: OutputFilter ) : DelegatingFilter(fallback) { + private fun validate(policy: FilterPolicyWithReason): FilterPolicyWithReason { + // "Internal" policies shouldn't be used in the "main" filter chain. + // They're for filter chains for other purposes. + if (policy.policy.isInternalPolicy) { + throw HostStubGenInternalException( + "Policy $policy must not be used in the \"real\" filter chain.") + } + return policy + } + + override fun getPolicyForClass(className: String): FilterPolicyWithReason { + return validate(super.getPolicyForClass(className)) + } + + override fun getPolicyForField(className: String, fieldName: String): FilterPolicyWithReason { + return validate(super.getPolicyForField(className, fieldName)) + } + override fun getPolicyForMethod( className: String, methodName: String, descriptor: String ): FilterPolicyWithReason { - val policy = super.getPolicyForMethod(className, methodName, descriptor) + val policy = validate(super.getPolicyForMethod(className, methodName, descriptor)) if (policy.policy == FilterPolicy.Redirect) { // Check whether the hosting class has a redirection class if (getRedirectionClass(className) == null) { diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt index 9782f3d0f591..d0c97c006647 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/filters/TextFileFilterPolicyParser.kt @@ -122,6 +122,25 @@ class TextFileFilterPolicyBuilder( mutableListOf<TextFilePolicyMethodReplaceFilter.MethodCallReplaceSpec>() /** + * Fields for a filter chain used for "partial allowlisting", which are used by + * [AnnotationBasedFilter]. + */ + private val annotationAllowedInMemoryFilter: InMemoryOutputFilter + val annotationAllowedMembersFilter: OutputFilter + + private val annotationAllowedPolicy = FilterPolicy.AnnotationAllowed.withReason(FILTER_REASON) + + init { + // Create a filter that checks "partial allowlisting". + var aaf: OutputFilter = ConstantFilter(FilterPolicy.Remove, "default disallowed") + + aaf = InMemoryOutputFilter(classes, aaf) + annotationAllowedInMemoryFilter = aaf + + annotationAllowedMembersFilter = annotationAllowedInMemoryFilter + } + + /** * Parse a given policy file. This method can be called multiple times to read from * multiple files. To get the resulting filter, use [createOutputFilter] */ @@ -153,6 +172,11 @@ class TextFileFilterPolicyBuilder( private inner class Processor : PolicyFileProcessor { override fun onPackage(name: String, policy: FilterPolicyWithReason) { + if (policy.policy == FilterPolicy.AnnotationAllowed) { + throw ParseException("${FilterPolicy.AnnotationAllowed.policyStringOrPrefix}" + + " on `package` isn't supported yet.") + return + } packageFilter.addPolicy(name, policy) } @@ -169,6 +193,11 @@ class TextFileFilterPolicyBuilder( } override fun onSimpleClassPolicy(className: String, policy: FilterPolicyWithReason) { + if (policy.policy == FilterPolicy.AnnotationAllowed) { + annotationAllowedInMemoryFilter.setPolicyForClass( + className, annotationAllowedPolicy) + return + } imf.setPolicyForClass(className, policy) } @@ -224,6 +253,11 @@ class TextFileFilterPolicyBuilder( methodDesc: String, policy: FilterPolicyWithReason, ) { + if (policy.policy == FilterPolicy.AnnotationAllowed) { + annotationAllowedInMemoryFilter.setPolicyForMethod( + className, methodName, methodDesc, annotationAllowedPolicy) + return + } imf.setPolicyForMethod(className, methodName, methodDesc, policy) } @@ -375,14 +409,15 @@ class TextFileFilterPolicyParser { private fun parsePolicy(s: String): FilterPolicy { return when (s.lowercase()) { - "k", "keep" -> FilterPolicy.Keep - "t", "throw" -> FilterPolicy.Throw - "r", "remove" -> FilterPolicy.Remove - "kc", "keepclass" -> FilterPolicy.KeepClass - "i", "ignore" -> FilterPolicy.Ignore - "rdr", "redirect" -> FilterPolicy.Redirect + "k", FilterPolicy.Keep.policyStringOrPrefix -> FilterPolicy.Keep + "t", FilterPolicy.Throw.policyStringOrPrefix -> FilterPolicy.Throw + "r", FilterPolicy.Remove.policyStringOrPrefix -> FilterPolicy.Remove + "kc", FilterPolicy.KeepClass.policyStringOrPrefix -> FilterPolicy.KeepClass + "i", FilterPolicy.Ignore.policyStringOrPrefix -> FilterPolicy.Ignore + "rdr", FilterPolicy.Redirect.policyStringOrPrefix -> FilterPolicy.Redirect + FilterPolicy.AnnotationAllowed.policyStringOrPrefix -> FilterPolicy.AnnotationAllowed else -> { - if (s.startsWith("@")) { + if (s.startsWith(FilterPolicy.Substitute.policyStringOrPrefix)) { FilterPolicy.Substitute } else { throw ParseException("Invalid policy \"$s\"") diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/utils/ClassPredicate.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/utils/ClassPredicate.kt index 810dd71732c8..4c53bc8fba97 100644 --- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/utils/ClassPredicate.kt +++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/utils/ClassPredicate.kt @@ -22,7 +22,9 @@ import com.android.hoststubgen.normalizeTextLine import java.io.File /** - * General purpose filter for class names. + * General purpose class "selector", which returns a boolean for a given class name. + * + * (It's used to check if a class is in the "annotations allowed classes" allowlist.) */ class ClassPredicate private constructor( private val defaultResult: Boolean, diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/annotation-allowed-classes-tiny-framework.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/annotation-allowed-classes-tiny-framework.txt index de4cb0c536c1..8e41a87d349d 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/annotation-allowed-classes-tiny-framework.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/annotation-allowed-classes-tiny-framework.txt @@ -1,29 +1,8 @@ -# Only classes listed here can use the hoststubgen annotations. - -# For each class, we check each item in this file, and when a match is found, we -# either allow it if the line doesn't have a !, or disallow if the line has a !. -# All the lines after the matching line will be ignored. - - -# To allow a specific class to use annotations: -# com.android.hoststubgen.test.tinyframework.TinyFrameworkAnnotations - -# To disallow a specific class to use annotations: -# !com.android.hoststubgen.test.tinyframework.TinyFrameworkAnnotations - -# To allow a specific package to use annotations: -# com.android.hoststubgen.test.* - -# To disallow a specific package to use annotations: -# !com.android.hoststubgen.test.* - +# Policy file for "tiny-framework" used by hoststubgen's own tests. com.android.hoststubgen.test.tinyframework.* com.supported.* com.unsupported.* -# Use this to allow all packages -# * - -# Use this to allow all packages -# !*
\ No newline at end of file +# Disallow all other classes +!*
\ No newline at end of file diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/01-hoststubgen-test-tiny-framework-orig-dump.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/01-hoststubgen-test-tiny-framework-orig-dump.txt index b009b0957919..635f66d8e90c 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/01-hoststubgen-test-tiny-framework-orig-dump.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/01-hoststubgen-test-tiny-framework-orig-dump.txt @@ -67,6 +67,28 @@ RuntimeVisibleAnnotations: java.lang.annotation.Retention( value=Ljava/lang/annotation/RetentionPolicy;.CLASS ) +## Class: android/hosttest/annotation/HostSideTestPartiallyAllowlisted.class + Compiled from "HostSideTestPartiallyAllowlisted.java" +public interface android.hosttest.annotation.HostSideTestPartiallyAllowlisted extends java.lang.annotation.Annotation + minor version: 0 + major version: 65 + flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION + this_class: #x // android/hosttest/annotation/HostSideTestPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ +} +SourceFile: "HostSideTestPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x(#x=[e#x.#x]) + java.lang.annotation.Target( + value=[Ljava/lang/annotation/ElementType;.TYPE] + ) + x: #x(#x=e#x.#x) + java.lang.annotation.Retention( + value=Ljava/lang/annotation/RetentionPolicy;.CLASS + ) ## Class: android/hosttest/annotation/HostSideTestRedirect.class Compiled from "HostSideTestRedirect.java" public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation @@ -2946,6 +2968,228 @@ SourceFile: "TinyFrameworkPackageRedirect.java" RuntimeInvisibleAnnotations: x: #x() android.hosttest.annotation.HostSideTestWholeClassKeep +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$NoAnnotations + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 3 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$NoAnnotations(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations; +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // NoAnnotations=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad; +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestWholeClassKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // PartialWithWholeClass_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted; + + public static int foo1(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_1 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad; + + public static int foo1(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_1 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlistedWithoutAnnot_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 3 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted; +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +NestMembers: + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // NoAnnotations=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + public static #x= #x of #x; // PartiallyAllowlistedWithoutAnnot_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + public static #x= #x of #x; // PartialWithWholeClass_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted ## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller.class Compiled from "TinyFrameworkRenamedClassCaller.java" public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/03-hoststubgen-test-tiny-framework-host-dump.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/03-hoststubgen-test-tiny-framework-host-dump.txt index 84a8373008d7..51a33554afa9 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/03-hoststubgen-test-tiny-framework-host-dump.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/03-hoststubgen-test-tiny-framework-host-dump.txt @@ -7,6 +7,8 @@ public interface android.hosttest.annotation.HostSideTestClassLoadHook extends j this_class: #x // android/hosttest/annotation/HostSideTestClassLoadHook super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ public abstract java.lang.String value(); descriptor: ()Ljava/lang/String; flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT @@ -35,6 +37,8 @@ public interface android.hosttest.annotation.HostSideTestKeep extends java.lang. this_class: #x // android/hosttest/annotation/HostSideTestKeep super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestKeep.java" RuntimeVisibleAnnotations: @@ -48,6 +52,30 @@ RuntimeVisibleAnnotations: java.lang.annotation.Retention( value=Ljava/lang/annotation/RetentionPolicy;.CLASS ) +## Class: android/hosttest/annotation/HostSideTestPartiallyAllowlisted.class + Compiled from "HostSideTestPartiallyAllowlisted.java" +public interface android.hosttest.annotation.HostSideTestPartiallyAllowlisted extends java.lang.annotation.Annotation + minor version: 0 + major version: 65 + flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION + this_class: #x // android/hosttest/annotation/HostSideTestPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ +} +SourceFile: "HostSideTestPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + x: #x(#x=[e#x.#x]) + java.lang.annotation.Target( + value=[Ljava/lang/annotation/ElementType;.TYPE] + ) + x: #x(#x=e#x.#x) + java.lang.annotation.Retention( + value=Ljava/lang/annotation/RetentionPolicy;.CLASS + ) ## Class: android/hosttest/annotation/HostSideTestRedirect.class Compiled from "HostSideTestRedirect.java" public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation @@ -57,6 +85,8 @@ public interface android.hosttest.annotation.HostSideTestRedirect extends java.l this_class: #x // android/hosttest/annotation/HostSideTestRedirect super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestRedirect.java" RuntimeVisibleAnnotations: @@ -79,6 +109,8 @@ public interface android.hosttest.annotation.HostSideTestRedirectionClass extend this_class: #x // android/hosttest/annotation/HostSideTestRedirectionClass super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ public abstract java.lang.String value(); descriptor: ()Ljava/lang/String; flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT @@ -107,6 +139,8 @@ public interface android.hosttest.annotation.HostSideTestRemove extends java.lan this_class: #x // android/hosttest/annotation/HostSideTestRemove super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestRemove.java" RuntimeVisibleAnnotations: @@ -129,6 +163,8 @@ public interface android.hosttest.annotation.HostSideTestStaticInitializerKeep e this_class: #x // android/hosttest/annotation/HostSideTestStaticInitializerKeep super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestStaticInitializerKeep.java" RuntimeVisibleAnnotations: @@ -151,6 +187,8 @@ public interface android.hosttest.annotation.HostSideTestSubstitute extends java this_class: #x // android/hosttest/annotation/HostSideTestSubstitute super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ public abstract java.lang.String suffix(); descriptor: ()Ljava/lang/String; flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT @@ -179,6 +217,8 @@ public interface android.hosttest.annotation.HostSideTestThrow extends java.lang this_class: #x // android/hosttest/annotation/HostSideTestThrow super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestThrow.java" RuntimeVisibleAnnotations: @@ -201,6 +241,8 @@ public interface android.hosttest.annotation.HostSideTestWholeClassKeep extends this_class: #x // android/hosttest/annotation/HostSideTestWholeClassKeep super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestWholeClassKeep.java" RuntimeVisibleAnnotations: @@ -223,6 +265,8 @@ public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Pro this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -273,6 +317,8 @@ public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -323,6 +369,8 @@ public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 4 +Constant pool: +{ } InnerClasses: public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl @@ -343,6 +391,8 @@ public class com.android.hoststubgen.test.tinyframework.R$Nested this_class: #x // com/android/hoststubgen/test/tinyframework/R$Nested super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public static int[] ARRAY; descriptor: [I flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -400,6 +450,8 @@ public class com.android.hoststubgen.test.tinyframework.R this_class: #x // com/android/hoststubgen/test/tinyframework/R super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.R(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -433,6 +485,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkAnnotations this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotations super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 7, attributes: 3 +Constant pool: +{ public int keep; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -591,6 +645,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 3, attributes: 3 +Constant pool: +{ public static final java.util.Set<java.lang.Class<?>> sLoadedClasses; descriptor: Ljava/util/Set; flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL @@ -668,6 +724,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWideAn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWideAnnotations super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 4, attributes: 3 +Constant pool: +{ public int keep; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -768,6 +826,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializerDefault super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 0, attributes: 3 +Constant pool: +{ public static boolean sInitialized; descriptor: Z flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -805,6 +865,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializerStub super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 1, attributes: 3 +Constant pool: +{ public static boolean sInitialized; descriptor: Z flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -867,6 +929,8 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex super_class: #x // java/lang/Enum interfaces: 0, fields: 6, methods: 7, attributes: 4 +Constant pool: +{ public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex; flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM @@ -1112,6 +1176,8 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple super_class: #x // java/lang/Enum interfaces: 0, fields: 3, methods: 5, attributes: 4 +Constant pool: +{ public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple; flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM @@ -1260,6 +1326,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTester(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -1323,6 +1391,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 15, attributes: 2 +Constant pool: +{ public int stub; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -1562,6 +1632,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 8, attributes: 6 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -1749,6 +1821,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 8, attributes: 6 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -1937,6 +2011,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallR this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkMethodCallReplace$ReplaceTo super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallReplace$ReplaceTo(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -2006,6 +2082,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallR this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkMethodCallReplace super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallReplace(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -2115,6 +2193,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 14, attributes: 3 +Constant pool: +{ int value; descriptor: I flags: (0x0000) @@ -2373,6 +2453,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 7, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -2503,6 +2585,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses); descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V flags: (0x0000) @@ -2573,6 +2657,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2(); descriptor: ()V flags: (0x0000) @@ -2639,6 +2725,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3(com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses); descriptor: (Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses;)V flags: (0x0000) @@ -2709,6 +2797,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4(); descriptor: ()V flags: (0x0000) @@ -2775,6 +2865,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 1, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -2818,6 +2910,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 1, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -2864,6 +2958,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$StaticNestedClass$1(); descriptor: ()V flags: (0x0000) @@ -2931,6 +3027,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$Double$NestedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 1, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -2974,6 +3072,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3033,6 +3133,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass super_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$SubClass(int); descriptor: (I)V flags: (0x0001) ACC_PUBLIC @@ -3068,6 +3170,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 4, attributes: 5 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -3193,6 +3297,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPackageRedirect super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedirect(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -3235,6 +3341,49 @@ RuntimeVisibleAnnotations: RuntimeInvisibleAnnotations: x: #x() android.hosttest.annotation.HostSideTestWholeClassKeep +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 5 +Constant pool: +{ + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted ## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller.class Compiled from "TinyFrameworkRenamedClassCaller.java" public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller @@ -3244,6 +3393,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClas this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -3295,6 +3446,8 @@ public class com.android.hoststubgen.test.tinyframework.packagetest.A this_class: #x // com/android/hoststubgen/test/tinyframework/packagetest/A super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "A.java" RuntimeVisibleAnnotations: @@ -3309,6 +3462,8 @@ public class com.android.hoststubgen.test.tinyframework.packagetest.sub.A this_class: #x // com/android/hoststubgen/test/tinyframework/packagetest/sub/A super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "A.java" RuntimeVisibleAnnotations: @@ -3323,6 +3478,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C1 this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "C1.java" RuntimeVisibleAnnotations: @@ -3337,6 +3494,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C2 extends this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "C2.java" RuntimeVisibleAnnotations: @@ -3351,6 +3510,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C3 extends this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C3 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "C3.java" RuntimeVisibleAnnotations: @@ -3365,6 +3526,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.CA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/CA super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "CA.java" RuntimeVisibleAnnotations: @@ -3379,6 +3542,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.CB this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/CB super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "CB.java" RuntimeVisibleAnnotations: @@ -3393,6 +3558,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C1 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C1 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_C1.java" RuntimeVisibleAnnotations: @@ -3407,6 +3574,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C2 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C2 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_C2.java" RuntimeVisibleAnnotations: @@ -3421,6 +3590,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C3 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C3 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C3 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_C3.java" RuntimeVisibleAnnotations: @@ -3435,6 +3606,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I1 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I1.java" RuntimeVisibleAnnotations: @@ -3449,6 +3622,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I1_IA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I1_IA super_class: #x // java/lang/Object interfaces: 2, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I1_IA.java" RuntimeVisibleAnnotations: @@ -3463,6 +3638,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I2 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I2.java" RuntimeVisibleAnnotations: @@ -3477,6 +3654,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I3 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I3.java" RuntimeVisibleAnnotations: @@ -3491,6 +3670,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I1 this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I1 super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "I1.java" RuntimeVisibleAnnotations: @@ -3505,6 +3686,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I2 exte this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "I2.java" RuntimeVisibleAnnotations: @@ -3519,6 +3702,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I3 exte this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "I3.java" RuntimeVisibleAnnotations: @@ -3533,6 +3718,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.IA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/IA super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "IA.java" RuntimeVisibleAnnotations: @@ -3547,6 +3734,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.IB this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/IB super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "IB.java" RuntimeVisibleAnnotations: @@ -3561,6 +3750,8 @@ public class com.supported.UnsupportedClass this_class: #x // com/supported/UnsupportedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 3 +Constant pool: +{ private final int mValue; descriptor: I flags: (0x0012) ACC_PRIVATE, ACC_FINAL @@ -3620,6 +3811,8 @@ public class com.unsupported.UnsupportedClass this_class: #x // com/unsupported/UnsupportedClass super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.unsupported.UnsupportedClass(int); descriptor: (I)V flags: (0x0001) ACC_PUBLIC @@ -3675,6 +3868,8 @@ public class rename_prefix.com.android.hoststubgen.test.tinyframework.TinyFramew this_class: #x // rename_prefix/com/android/hoststubgen/test/tinyframework/TinyFrameworkToBeRenamed super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 3 +Constant pool: +{ private final int mValue; descriptor: I flags: (0x0012) ACC_PRIVATE, ACC_FINAL diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/13-hoststubgen-test-tiny-framework-host-ext-dump.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/13-hoststubgen-test-tiny-framework-host-ext-dump.txt index fb225ff1aa21..a466a2e2c3a7 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/13-hoststubgen-test-tiny-framework-host-ext-dump.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output.RELEASE_TARGET_JAVA_21/13-hoststubgen-test-tiny-framework-host-ext-dump.txt @@ -52,6 +52,30 @@ RuntimeVisibleAnnotations: java.lang.annotation.Retention( value=Ljava/lang/annotation/RetentionPolicy;.CLASS ) +## Class: android/hosttest/annotation/HostSideTestPartiallyAllowlisted.class + Compiled from "HostSideTestPartiallyAllowlisted.java" +public interface android.hosttest.annotation.HostSideTestPartiallyAllowlisted extends java.lang.annotation.Annotation + minor version: 0 + major version: 65 + flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION + this_class: #x // android/hosttest/annotation/HostSideTestPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ +} +SourceFile: "HostSideTestPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + x: #x(#x=[e#x.#x]) + java.lang.annotation.Target( + value=[Ljava/lang/annotation/ElementType;.TYPE] + ) + x: #x(#x=e#x.#x) + java.lang.annotation.Retention( + value=Ljava/lang/annotation/RetentionPolicy;.CLASS + ) ## Class: android/hosttest/annotation/HostSideTestRedirect.class Compiled from "HostSideTestRedirect.java" public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation @@ -241,6 +265,8 @@ public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Pro this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -311,6 +337,8 @@ public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -381,6 +409,8 @@ public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -410,6 +440,8 @@ public class com.android.hoststubgen.test.tinyframework.R$Nested this_class: #x // com/android/hoststubgen/test/tinyframework/R$Nested super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public static int[] ARRAY; descriptor: [I flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -480,6 +512,8 @@ public class com.android.hoststubgen.test.tinyframework.R this_class: #x // com/android/hoststubgen/test/tinyframework/R super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 4 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -528,6 +562,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkAnnotations this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotations super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 7, attributes: 3 +Constant pool: +{ public int keep; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -719,6 +755,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 3, attributes: 3 +Constant pool: +{ public static final java.util.Set<java.lang.Class<?>> sLoadedClasses; descriptor: Ljava/util/Set; flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL @@ -814,6 +852,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWideAn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWideAnnotations super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 5, attributes: 3 +Constant pool: +{ public int keep; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -944,6 +984,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializerDefault super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 0, attributes: 3 +Constant pool: +{ public static boolean sInitialized; descriptor: Z flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -981,6 +1023,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializerStub super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 1, attributes: 3 +Constant pool: +{ public static boolean sInitialized; descriptor: Z flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -1051,6 +1095,8 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex super_class: #x // java/lang/Enum interfaces: 0, fields: 6, methods: 7, attributes: 4 +Constant pool: +{ public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex; flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM @@ -1334,6 +1380,8 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple super_class: #x // java/lang/Enum interfaces: 0, fields: 3, methods: 5, attributes: 4 +Constant pool: +{ public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple; flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM @@ -1510,6 +1558,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 3 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -1593,6 +1643,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 15, attributes: 2 +Constant pool: +{ public int stub; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -1905,6 +1957,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 8, attributes: 6 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -2135,6 +2189,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 8, attributes: 6 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -2366,6 +2422,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallR this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkMethodCallReplace$ReplaceTo super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 4, attributes: 4 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -2460,6 +2518,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallR this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkMethodCallReplace super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 5, attributes: 6 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -2599,6 +2659,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 15, attributes: 3 +Constant pool: +{ int value; descriptor: I flags: (0x0000) @@ -2932,6 +2994,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 8, attributes: 3 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3107,6 +3171,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3202,6 +3268,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3293,6 +3361,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3388,6 +3458,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3479,6 +3551,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3537,6 +3611,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3598,6 +3674,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3690,6 +3768,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$Double$NestedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3748,6 +3828,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 3, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3827,6 +3909,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass super_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass interfaces: 0, fields: 0, methods: 2, attributes: 4 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -3877,6 +3961,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 4, attributes: 5 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -4025,6 +4111,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPackageRedirect super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 3 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4087,6 +4175,64 @@ RuntimeVisibleAnnotations: RuntimeInvisibleAnnotations: x: #x() android.hosttest.annotation.HostSideTestWholeClassKeep +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + minor version: 0 + major version: 65 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 2, attributes: 5 +Constant pool: +{ + private static {}; + descriptor: ()V + flags: (0x000a) ACC_PRIVATE, ACC_STATIC + Code: + stack=2, locals=0, args_size=0 + x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded + x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V + x: return + + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=4, locals=1, args_size=1 + x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + x: ldc #x // String foo2 + x: ldc #x // String (I)I + x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall + x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 11 4 0 value I + RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted ## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller.class Compiled from "TinyFrameworkRenamedClassCaller.java" public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller @@ -4096,6 +4242,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClas this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 3 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4167,6 +4315,8 @@ public class com.android.hoststubgen.test.tinyframework.packagetest.A this_class: #x // com/android/hoststubgen/test/tinyframework/packagetest/A super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4190,6 +4340,8 @@ public class com.android.hoststubgen.test.tinyframework.packagetest.sub.A this_class: #x // com/android/hoststubgen/test/tinyframework/packagetest/sub/A super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4213,6 +4365,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C1 this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4236,6 +4390,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C2 extends this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4259,6 +4415,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C3 extends this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C3 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4282,6 +4440,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.CA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/CA super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4305,6 +4465,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.CB this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/CB super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4328,6 +4490,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C1 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C1 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4351,6 +4515,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C2 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C2 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4374,6 +4540,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C3 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C3 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C3 interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4397,6 +4565,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I1 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4420,6 +4590,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I1_IA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I1_IA super_class: #x // java/lang/Object interfaces: 2, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4443,6 +4615,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I2 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4466,6 +4640,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I3 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4489,6 +4665,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I1 this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I1 super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4512,6 +4690,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I2 exte this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4535,6 +4715,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I3 exte this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4558,6 +4740,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.IA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/IA super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4581,6 +4765,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.IB this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/IB super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4604,6 +4790,8 @@ public class com.supported.UnsupportedClass this_class: #x // com/supported/UnsupportedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 3, attributes: 3 +Constant pool: +{ private final int mValue; descriptor: I flags: (0x0012) ACC_PRIVATE, ACC_FINAL @@ -4683,6 +4871,8 @@ public class com.unsupported.UnsupportedClass this_class: #x // com/unsupported/UnsupportedClass super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 3 +Constant pool: +{ private static {}; descriptor: ()V flags: (0x000a) ACC_PRIVATE, ACC_STATIC @@ -4758,6 +4948,8 @@ public class rename_prefix.com.android.hoststubgen.test.tinyframework.TinyFramew this_class: #x // rename_prefix/com/android/hoststubgen/test/tinyframework/TinyFrameworkToBeRenamed super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 3, attributes: 3 +Constant pool: +{ private final int mValue; descriptor: I flags: (0x0012) ACC_PRIVATE, ACC_FINAL diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt index ad413425801b..78341d7afbb9 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt @@ -67,6 +67,28 @@ RuntimeVisibleAnnotations: java.lang.annotation.Retention( value=Ljava/lang/annotation/RetentionPolicy;.CLASS ) +## Class: android/hosttest/annotation/HostSideTestPartiallyAllowlisted.class + Compiled from "HostSideTestPartiallyAllowlisted.java" +public interface android.hosttest.annotation.HostSideTestPartiallyAllowlisted extends java.lang.annotation.Annotation + minor version: 0 + major version: 61 + flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION + this_class: #x // android/hosttest/annotation/HostSideTestPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ +} +SourceFile: "HostSideTestPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x(#x=[e#x.#x]) + java.lang.annotation.Target( + value=[Ljava/lang/annotation/ElementType;.TYPE] + ) + x: #x(#x=e#x.#x) + java.lang.annotation.Retention( + value=Ljava/lang/annotation/RetentionPolicy;.CLASS + ) ## Class: android/hosttest/annotation/HostSideTestRedirect.class Compiled from "HostSideTestRedirect.java" public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation @@ -2967,6 +2989,228 @@ SourceFile: "TinyFrameworkPackageRedirect.java" RuntimeInvisibleAnnotations: x: #x() android.hosttest.annotation.HostSideTestWholeClassKeep +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$NoAnnotations + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 3 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$NoAnnotations(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations; +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // NoAnnotations=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad; +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestWholeClassKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // PartialWithWholeClass_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted; + + public static int foo1(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_1 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad; + + public static int foo1(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_1 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlistedWithoutAnnot_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 3 +Constant pool: +{ + public com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted(); + descriptor: ()V + flags: (0x0001) ACC_PUBLIC + Code: + stack=1, locals=1, args_size=1 + x: aload_0 + x: invokespecial #x // Method java/lang/Object."<init>":()V + x: return + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 5 0 this Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted; +} +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +NestMembers: + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad + com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted +InnerClasses: + public static #x= #x of #x; // NoAnnotations=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$NoAnnotations of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + public static #x= #x of #x; // PartiallyAllowlistedWithoutAnnot_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + public static #x= #x of #x; // PartialWithWholeClass_bad=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted ## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller.class Compiled from "TinyFrameworkRenamedClassCaller.java" public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt index eeec554e954c..2e0b1820a696 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/03-hoststubgen-test-tiny-framework-host-dump.txt @@ -7,6 +7,8 @@ public interface android.hosttest.annotation.HostSideTestClassLoadHook extends j this_class: #x // android/hosttest/annotation/HostSideTestClassLoadHook super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ public abstract java.lang.String value(); descriptor: ()Ljava/lang/String; flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT @@ -35,6 +37,8 @@ public interface android.hosttest.annotation.HostSideTestKeep extends java.lang. this_class: #x // android/hosttest/annotation/HostSideTestKeep super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestKeep.java" RuntimeVisibleAnnotations: @@ -48,6 +52,30 @@ RuntimeVisibleAnnotations: java.lang.annotation.Retention( value=Ljava/lang/annotation/RetentionPolicy;.CLASS ) +## Class: android/hosttest/annotation/HostSideTestPartiallyAllowlisted.class + Compiled from "HostSideTestPartiallyAllowlisted.java" +public interface android.hosttest.annotation.HostSideTestPartiallyAllowlisted extends java.lang.annotation.Annotation + minor version: 0 + major version: 61 + flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION + this_class: #x // android/hosttest/annotation/HostSideTestPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ +} +SourceFile: "HostSideTestPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + x: #x(#x=[e#x.#x]) + java.lang.annotation.Target( + value=[Ljava/lang/annotation/ElementType;.TYPE] + ) + x: #x(#x=e#x.#x) + java.lang.annotation.Retention( + value=Ljava/lang/annotation/RetentionPolicy;.CLASS + ) ## Class: android/hosttest/annotation/HostSideTestRedirect.class Compiled from "HostSideTestRedirect.java" public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation @@ -57,6 +85,8 @@ public interface android.hosttest.annotation.HostSideTestRedirect extends java.l this_class: #x // android/hosttest/annotation/HostSideTestRedirect super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestRedirect.java" RuntimeVisibleAnnotations: @@ -79,6 +109,8 @@ public interface android.hosttest.annotation.HostSideTestRedirectionClass extend this_class: #x // android/hosttest/annotation/HostSideTestRedirectionClass super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ public abstract java.lang.String value(); descriptor: ()Ljava/lang/String; flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT @@ -107,6 +139,8 @@ public interface android.hosttest.annotation.HostSideTestRemove extends java.lan this_class: #x // android/hosttest/annotation/HostSideTestRemove super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestRemove.java" RuntimeVisibleAnnotations: @@ -129,6 +163,8 @@ public interface android.hosttest.annotation.HostSideTestStaticInitializerKeep e this_class: #x // android/hosttest/annotation/HostSideTestStaticInitializerKeep super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestStaticInitializerKeep.java" RuntimeVisibleAnnotations: @@ -151,6 +187,8 @@ public interface android.hosttest.annotation.HostSideTestSubstitute extends java this_class: #x // android/hosttest/annotation/HostSideTestSubstitute super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 1, attributes: 2 +Constant pool: +{ public abstract java.lang.String suffix(); descriptor: ()Ljava/lang/String; flags: (0x0401) ACC_PUBLIC, ACC_ABSTRACT @@ -179,6 +217,8 @@ public interface android.hosttest.annotation.HostSideTestThrow extends java.lang this_class: #x // android/hosttest/annotation/HostSideTestThrow super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestThrow.java" RuntimeVisibleAnnotations: @@ -201,6 +241,8 @@ public interface android.hosttest.annotation.HostSideTestWholeClassKeep extends this_class: #x // android/hosttest/annotation/HostSideTestWholeClassKeep super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "HostSideTestWholeClassKeep.java" RuntimeVisibleAnnotations: @@ -223,6 +265,8 @@ public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Pro this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub$Proxy super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub$Proxy(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -273,6 +317,8 @@ public class com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.IPretendingAidl$Stub(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -323,6 +369,8 @@ public interface com.android.hoststubgen.test.tinyframework.IPretendingAidl this_class: #x // com/android/hoststubgen/test/tinyframework/IPretendingAidl super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 4 +Constant pool: +{ } InnerClasses: public static #x= #x of #x; // Stub=class com/android/hoststubgen/test/tinyframework/IPretendingAidl$Stub of class com/android/hoststubgen/test/tinyframework/IPretendingAidl @@ -343,6 +391,8 @@ public class com.android.hoststubgen.test.tinyframework.R$Nested this_class: #x // com/android/hoststubgen/test/tinyframework/R$Nested super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public static int[] ARRAY; descriptor: [I flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -400,6 +450,8 @@ public class com.android.hoststubgen.test.tinyframework.R this_class: #x // com/android/hoststubgen/test/tinyframework/R super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.R(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -433,6 +485,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkAnnotations this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotations super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 7, attributes: 3 +Constant pool: +{ public int keep; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -591,6 +645,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassLoadHo this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassLoadHook super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 3, attributes: 3 +Constant pool: +{ public static final java.util.Set<java.lang.Class<?>> sLoadedClasses; descriptor: Ljava/util/Set; flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL @@ -668,6 +724,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWideAn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWideAnnotations super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 4, attributes: 3 +Constant pool: +{ public int keep; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -768,6 +826,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializerDefault super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 0, attributes: 3 +Constant pool: +{ public static boolean sInitialized; descriptor: Z flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -805,6 +865,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassWithIn this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkClassWithInitializerStub super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 1, attributes: 3 +Constant pool: +{ public static boolean sInitialized; descriptor: Z flags: (0x0009) ACC_PUBLIC, ACC_STATIC @@ -867,6 +929,8 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumC this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex super_class: #x // java/lang/Enum interfaces: 0, fields: 6, methods: 7, attributes: 4 +Constant pool: +{ public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumComplex RED; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumComplex; flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM @@ -1112,6 +1176,8 @@ public final class com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumS this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple super_class: #x // java/lang/Enum interfaces: 0, fields: 3, methods: 5, attributes: 4 +Constant pool: +{ public static final com.android.hoststubgen.test.tinyframework.TinyFrameworkEnumSimple CAT; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkEnumSimple; flags: (0x4019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ENUM @@ -1260,6 +1326,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTe this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkExceptionTester super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkExceptionTester(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -1323,6 +1391,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkForTextPoli this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkForTextPolicy super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 15, attributes: 2 +Constant pool: +{ public int stub; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -1562,6 +1632,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas$Nes this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas$Nested super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 8, attributes: 6 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -1749,6 +1821,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkLambdas this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkLambdas super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 8, attributes: 6 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -1937,6 +2011,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallR this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkMethodCallReplace$ReplaceTo super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 3, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallReplace$ReplaceTo(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -2006,6 +2082,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallR this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkMethodCallReplace super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 4, attributes: 6 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkMethodCallReplace(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -2115,6 +2193,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 14, attributes: 3 +Constant pool: +{ int value; descriptor: I flags: (0x0000) @@ -2373,6 +2453,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNative_host super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 7, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkNative_host(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -2503,6 +2585,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$1 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$1 super_class: #x // java/lang/Object interfaces: 1, fields: 1, methods: 3, attributes: 6 +Constant pool: +{ final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses; flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC @@ -2583,6 +2667,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$2(); descriptor: ()V flags: (0x0000) @@ -2649,6 +2735,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$3 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$3 super_class: #x // java/lang/Object interfaces: 1, fields: 1, methods: 3, attributes: 6 +Constant pool: +{ final com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses this$0; descriptor: Lcom/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses; flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC @@ -2729,6 +2817,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4 ex this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$4 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$4(); descriptor: ()V flags: (0x0000) @@ -2795,6 +2885,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 1, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -2838,6 +2930,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$InnerClass super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 1, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -2894,6 +2988,8 @@ class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$Stat this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 3, attributes: 6 +Constant pool: +{ com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$StaticNestedClass$1(); descriptor: ()V flags: (0x0000) @@ -2961,6 +3057,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass$Double$NestedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 1, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3004,6 +3102,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$StaticNestedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 4 +Constant pool: +{ public int value; descriptor: I flags: (0x0001) ACC_PUBLIC @@ -3063,6 +3163,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$SubClass super_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses$BaseClass interfaces: 0, fields: 0, methods: 1, attributes: 4 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClasses$SubClass(int); descriptor: (I)V flags: (0x0001) ACC_PUBLIC @@ -3098,6 +3200,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkNestedClass this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkNestedClasses super_class: #x // java/lang/Object interfaces: 0, fields: 2, methods: 4, attributes: 5 +Constant pool: +{ public final java.util.function.Supplier<java.lang.Integer> mSupplier; descriptor: Ljava/util/function/Supplier; flags: (0x0011) ACC_PUBLIC, ACC_FINAL @@ -3223,6 +3327,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedi this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPackageRedirect super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkPackageRedirect(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -3265,6 +3371,49 @@ RuntimeVisibleAnnotations: RuntimeInvisibleAnnotations: x: #x() android.hosttest.annotation.HostSideTestWholeClassKeep +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 1, attributes: 5 +Constant pool: +{ + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=2, locals=1, args_size=1 + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 0 4 0 value I + RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted ## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller.class Compiled from "TinyFrameworkRenamedClassCaller.java" public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller @@ -3274,6 +3423,8 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClas this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller(); descriptor: ()V flags: (0x0001) ACC_PUBLIC @@ -3325,6 +3476,8 @@ public class com.android.hoststubgen.test.tinyframework.packagetest.A this_class: #x // com/android/hoststubgen/test/tinyframework/packagetest/A super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "A.java" RuntimeVisibleAnnotations: @@ -3339,6 +3492,8 @@ public class com.android.hoststubgen.test.tinyframework.packagetest.sub.A this_class: #x // com/android/hoststubgen/test/tinyframework/packagetest/sub/A super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "A.java" RuntimeVisibleAnnotations: @@ -3353,6 +3508,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C1 this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "C1.java" RuntimeVisibleAnnotations: @@ -3367,6 +3524,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C2 extends this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "C2.java" RuntimeVisibleAnnotations: @@ -3381,6 +3540,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.C3 extends this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C3 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "C3.java" RuntimeVisibleAnnotations: @@ -3395,6 +3556,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.CA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/CA super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "CA.java" RuntimeVisibleAnnotations: @@ -3409,6 +3572,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.CB this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/CB super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "CB.java" RuntimeVisibleAnnotations: @@ -3423,6 +3588,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C1 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C1 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C1 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_C1.java" RuntimeVisibleAnnotations: @@ -3437,6 +3604,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C2 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C2 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C2 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_C2.java" RuntimeVisibleAnnotations: @@ -3451,6 +3620,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_C3 ex this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_C3 super_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/C3 interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_C3.java" RuntimeVisibleAnnotations: @@ -3465,6 +3636,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I1 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I1 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I1.java" RuntimeVisibleAnnotations: @@ -3479,6 +3652,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I1_IA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I1_IA super_class: #x // java/lang/Object interfaces: 2, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I1_IA.java" RuntimeVisibleAnnotations: @@ -3493,6 +3668,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I2 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I2.java" RuntimeVisibleAnnotations: @@ -3507,6 +3684,8 @@ public class com.android.hoststubgen.test.tinyframework.subclasstest.Class_I3 im this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/Class_I3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "Class_I3.java" RuntimeVisibleAnnotations: @@ -3521,6 +3700,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I1 this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I1 super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "I1.java" RuntimeVisibleAnnotations: @@ -3535,6 +3716,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I2 exte this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I2 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "I2.java" RuntimeVisibleAnnotations: @@ -3549,6 +3732,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.I3 exte this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/I3 super_class: #x // java/lang/Object interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "I3.java" RuntimeVisibleAnnotations: @@ -3563,6 +3748,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.IA this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/IA super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "IA.java" RuntimeVisibleAnnotations: @@ -3577,6 +3764,8 @@ public interface com.android.hoststubgen.test.tinyframework.subclasstest.IB this_class: #x // com/android/hoststubgen/test/tinyframework/subclasstest/IB super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ } SourceFile: "IB.java" RuntimeVisibleAnnotations: @@ -3591,6 +3780,8 @@ public class com.supported.UnsupportedClass this_class: #x // com/supported/UnsupportedClass super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 3 +Constant pool: +{ private final int mValue; descriptor: I flags: (0x0012) ACC_PRIVATE, ACC_FINAL @@ -3650,6 +3841,8 @@ public class com.unsupported.UnsupportedClass this_class: #x // com/unsupported/UnsupportedClass super_class: #x // java/lang/Object interfaces: 0, fields: 0, methods: 2, attributes: 3 +Constant pool: +{ public com.unsupported.UnsupportedClass(int); descriptor: (I)V flags: (0x0001) ACC_PUBLIC @@ -3705,6 +3898,8 @@ public class rename_prefix.com.android.hoststubgen.test.tinyframework.TinyFramew this_class: #x // rename_prefix/com/android/hoststubgen/test/tinyframework/TinyFrameworkToBeRenamed super_class: #x // java/lang/Object interfaces: 0, fields: 1, methods: 2, attributes: 3 +Constant pool: +{ private final int mValue; descriptor: I flags: (0x0012) ACC_PRIVATE, ACC_FINAL diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt index e4b9db2ed6d8..51f79258d53a 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/golden-output/13-hoststubgen-test-tiny-framework-host-ext-dump.txt @@ -52,6 +52,30 @@ RuntimeVisibleAnnotations: java.lang.annotation.Retention( value=Ljava/lang/annotation/RetentionPolicy;.CLASS ) +## Class: android/hosttest/annotation/HostSideTestPartiallyAllowlisted.class + Compiled from "HostSideTestPartiallyAllowlisted.java" +public interface android.hosttest.annotation.HostSideTestPartiallyAllowlisted extends java.lang.annotation.Annotation + minor version: 0 + major version: 61 + flags: (0x2601) ACC_PUBLIC, ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION + this_class: #x // android/hosttest/annotation/HostSideTestPartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 1, fields: 0, methods: 0, attributes: 2 +Constant pool: +{ +} +SourceFile: "HostSideTestPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + x: #x(#x=[e#x.#x]) + java.lang.annotation.Target( + value=[Ljava/lang/annotation/ElementType;.TYPE] + ) + x: #x(#x=e#x.#x) + java.lang.annotation.Retention( + value=Ljava/lang/annotation/RetentionPolicy;.CLASS + ) ## Class: android/hosttest/annotation/HostSideTestRedirect.class Compiled from "HostSideTestRedirect.java" public interface android.hosttest.annotation.HostSideTestRedirect extends java.lang.annotation.Annotation @@ -4181,6 +4205,64 @@ RuntimeVisibleAnnotations: RuntimeInvisibleAnnotations: x: #x() android.hosttest.annotation.HostSideTestWholeClassKeep +## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted.class + Compiled from "TinyFrameworkPartiallyAllowlisted.java" +public class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + minor version: 0 + major version: 61 + flags: (0x0021) ACC_PUBLIC, ACC_SUPER + this_class: #x // com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + super_class: #x // java/lang/Object + interfaces: 0, fields: 0, methods: 2, attributes: 5 +Constant pool: +{ + private static {}; + descriptor: ()V + flags: (0x000a) ACC_PRIVATE, ACC_STATIC + Code: + stack=2, locals=0, args_size=0 + x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded + x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.onClassLoaded:(Ljava/lang/Class;Ljava/lang/String;)V + x: return + + public static int foo2(int); + descriptor: (I)I + flags: (0x0009) ACC_PUBLIC, ACC_STATIC + Code: + stack=4, locals=1, args_size=1 + x: ldc #x // class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted + x: ldc #x // String foo2 + x: ldc #x // String (I)I + x: ldc #x // String com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall + x: invokestatic #x // Method com/android/hoststubgen/hosthelper/HostTestUtils.callMethodCallHook:(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + x: iload_0 + x: iconst_2 + x: iadd + x: ireturn + LineNumberTable: + LocalVariableTable: + Start Length Slot Name Signature + 11 4 0 value I + RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep + RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestKeep +} +InnerClasses: + public static #x= #x of #x; // PartiallyAllowlisted=class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted of class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted +SourceFile: "TinyFrameworkPartiallyAllowlisted.java" +RuntimeVisibleAnnotations: + x: #x() + com.android.hoststubgen.hosthelper.HostStubGenProcessedAsKeep +RuntimeInvisibleAnnotations: + x: #x() + android.hosttest.annotation.HostSideTestPartiallyAllowlisted + x: #x() + android.hosttest.annotation.HostSideTestKeep +NestHost: class com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted ## Class: com/android/hoststubgen/test/tinyframework/TinyFrameworkRenamedClassCaller.class Compiled from "TinyFrameworkRenamedClassCaller.java" public class com.android.hoststubgen.test.tinyframework.TinyFrameworkRenamedClassCaller diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt b/ravenwood/tools/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt index 2f35d35d608d..1f64a3c78c53 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/policy-override-tiny-framework.txt @@ -73,3 +73,9 @@ class java.lang.Thread keep # The leading / in the prefix is not needed (it'll be stripped), but it's added to make # sure the stripping works. rename ^.*/TinyFrameworkToBeRenamed$ /rename_prefix/ + +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlisted allow-annotation + method foo2 allow-annotation + +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartialWithWholeClass_bad remove +class com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted$PartiallyAllowlistedWithoutAnnot_bad remove
\ No newline at end of file diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/run-test-manually.sh b/ravenwood/tools/hoststubgen/test-tiny-framework/run-test-manually.sh index 80ebf3adab3d..450da237d65d 100755 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/run-test-manually.sh +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/run-test-manually.sh @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. - -source "${0%/*}"/../../common.sh +set -e +source "${0%/*}"/../common.sh # This scripts run the "tiny-framework" test, but does most stuff from the command line, using # the native java and javac commands. @@ -49,7 +49,7 @@ tiny_test_classes=$out/tiny-test/classes/ tiny_test_jar=$out/tiny-test.jar framework_compile_classpaths=( - $SOONG_INT/frameworks/base/tools/hoststubgen/hoststubgen/hoststubgen-annotations/android_common/javac/hoststubgen-annotations.jar + $SOONG_INT/frameworks/base/ravenwood/tools/hoststubgen/hoststubgen-annotations/android_common/javac/hoststubgen-annotations.jar ) test_compile_classpaths=( @@ -58,7 +58,7 @@ test_compile_classpaths=( ) test_runtime_classpaths=( - $SOONG_INT/frameworks/base/tools/hoststubgen/hoststubgen/hoststubgen-helper-runtime/linux_glibc_common/javac/hoststubgen-helper-runtime.jar + $SOONG_INT/frameworks/base/ravenwood/tools/hoststubgen/hoststubgen-helper-runtime/linux_glibc_common/javac/hoststubgen-helper-runtime.jar ) # This suite runs all tests in the JAR. @@ -73,7 +73,7 @@ echo "# Building tiny-framework..." run $JAVAC \ -cp $( \ join : \ - ${framework_compile_classpaths[@]} \ + "${framework_compile_classpaths[@]}" \ ) \ -d $tiny_framework_classes \ tiny-framework/src/**/*.java @@ -83,7 +83,9 @@ run $JAR cvf $tiny_framework_jar \ # Build stub/impl jars echo "# Generating the stub and impl jars..." +# Run with HOSTSTUBGEN_OPTS="-Jagentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8700" to enable the debugger run $HOSTSTUBGEN \ + $HOSTSTUBGEN_OPTS \ @../hoststubgen-standard-options.txt \ --in-jar $tiny_framework_jar \ --out-jar $tiny_framework_host_jar \ @@ -91,8 +93,7 @@ run $HOSTSTUBGEN \ --gen-keep-all-file out/tiny-framework_keep_all.txt \ --gen-input-dump-file out/tiny-framework_dump.txt \ --package-redirect com.unsupported:com.supported \ - --annotation-allowed-classes-file annotation-allowed-classes-tiny-framework.txt \ - $HOSTSTUBGEN_OPTS + --annotation-allowed-classes-file annotation-allowed-classes-tiny-framework.txt # Extract the jar files, so we can look into them. extract $tiny_framework_host_jar @@ -127,4 +128,4 @@ run $JAVA \ "${test_runtime_classpaths[@]}" \ ) \ org.junit.runner.JUnitCore \ - ${test_classes[@]} + "${test_classes[@]}" diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted.java b/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted.java new file mode 100644 index 000000000000..dfc9de4915bc --- /dev/null +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkPartiallyAllowlisted.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.hoststubgen.test.tinyframework; + +import android.hosttest.annotation.HostSideTestKeep; +import android.hosttest.annotation.HostSideTestPartiallyAllowlisted; +import android.hosttest.annotation.HostSideTestWholeClassKeep; + +/** + * Contains subclasses for tests for "partially-allowlisted". + */ +public class TinyFrameworkPartiallyAllowlisted { + /** */ + @HostSideTestPartiallyAllowlisted + @HostSideTestKeep + public static class PartiallyAllowlisted { + /** */ + public static int foo1(int value) { + return value + 1; + } + + /** */ + @HostSideTestKeep + public static int foo2(int value) { + return value + 2; + } + } + + /** */ + @HostSideTestPartiallyAllowlisted + @HostSideTestWholeClassKeep // This should be disallowed. + public static class PartialWithWholeClass_bad { + } + + /** */ + // Missing @HostSideTestPartiallyAllowlisted + @HostSideTestKeep + public static class PartiallyAllowlistedWithoutAnnot_bad { + /** */ + public static int foo1(int value) { + return value + 1; + } + + /** */ + @HostSideTestKeep + public static int foo2(int value) { + return value + 2; + } + } + + /** */ + public static class NoAnnotations { + } +} diff --git a/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotationsTest.java b/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotationsTest.java index 1ae049371229..93387f5928a1 100644 --- a/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotationsTest.java +++ b/ravenwood/tools/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkAnnotationsTest.java @@ -19,6 +19,8 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; +import com.android.hoststubgen.test.tinyframework.TinyFrameworkPartiallyAllowlisted.PartiallyAllowlisted; + import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -61,4 +63,19 @@ public class TinyFrameworkAnnotationsTest { thrown.expectMessage("not yet supported"); tfc.unsupportedMethod(); } + + @Test + public void testPartiallyAllowed() { + assertThat(PartiallyAllowlisted.foo2(1)).isEqualTo(3); + assertThrows(NoSuchMethodError.class, () -> PartiallyAllowlisted.foo1(1)); + + // Just make sure the following classes don't exist. + assertThrows(ClassNotFoundException.class, + () -> Class.forName("com.android.hoststubgen.test.tinyframework" + + ".TinyFrameworkPartiallyAllowlisted.PartialWithWholeClass_bad")); + assertThrows(ClassNotFoundException.class, + () -> Class.forName("com.android.hoststubgen.test.tinyframework" + + ".TinyFrameworkPartiallyAllowlisted.PartiallyAllowlistedWithoutAnnot_bad" + )); + } } diff --git a/ravenwood/tools/hoststubgen/test/com/android/hoststubgen/utils/ClassPredicateTest.kt b/ravenwood/tools/hoststubgen/test/com/android/hoststubgen/utils/ClassPredicateTest.kt index 5a877e661484..3e6615ec7667 100644 --- a/ravenwood/tools/hoststubgen/test/com/android/hoststubgen/utils/ClassPredicateTest.kt +++ b/ravenwood/tools/hoststubgen/test/com/android/hoststubgen/utils/ClassPredicateTest.kt @@ -112,4 +112,4 @@ class ClassPredicateTest { assertThat(f.matches("a/XyzAbc")).isEqualTo(false) } -}
\ No newline at end of file +} diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt index ef1cb5dfca89..33fb015cc131 100644 --- a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt +++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt @@ -49,6 +49,7 @@ class Annotations { "@android.ravenwood.annotation.RavenwoodIgnore" FilterPolicy.Remove -> "@android.ravenwood.annotation.RavenwoodRemove" + FilterPolicy.AnnotationAllowed -> null // Can't convert to an annotation. } } |