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

Commit ed2255ab authored by John Wu's avatar John Wu
Browse files

[HostStubGen] Remove stub functionality from code

Bug: 292141694
Flag: EXEMPT host test change only
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Change-Id: I497ac49cff0cbd20e67c8a035aa258c8f23944ad
parent a80c3333
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ genrule_defaults {
framework_minus_apex_cmd = "$(location hoststubgen) " +
    "@$(location :ravenwood-standard-options) " +
    "--debug-log $(location hoststubgen_framework-minus-apex.log) " +
    "--out-impl-jar $(location ravenwood.jar) " +
    "--out-jar $(location ravenwood.jar) " +
    "--in-jar $(location :framework-minus-apex-for-hoststubgen) " +
    "--policy-override-file $(location :ravenwood-framework-policies) " +
    "--annotation-allowed-classes-file $(location :ravenwood-annotation-allowed-classes) "
@@ -183,7 +183,7 @@ java_genrule {
        "--stats-file $(location hoststubgen_services.core_stats.csv) " +
        "--supported-api-list-file $(location hoststubgen_services.core_apis.csv) " +

        "--out-impl-jar $(location ravenwood.jar) " +
        "--out-jar $(location ravenwood.jar) " +

        "--gen-keep-all-file $(location hoststubgen_services.core_keep_all.txt) " +
        "--gen-input-dump-file $(location hoststubgen_services.core_dump.txt) " +
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ hoststubgen_common_options = "$(location hoststubgen) " +
    // "--policy-override-file $(location framework-policy-override.txt) " +
    "@$(location :hoststubgen-standard-options) " +

    "--out-impl-jar $(location host.jar) " +
    "--out-jar $(location host.jar) " +

    // "--keep-all-classes " + // Used it for an experiment. See KeepAllClassesFilter.
    "--gen-keep-all-file $(location hoststubgen_keep_all.txt) " +
+0 −38
Original line number Diff line number Diff line
/*
 * 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 com.android.hoststubgen.hosthelper;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation injected to all classes/methods/fields that are kept in the "stub" jar.
 *
 * All items in the stub jar are automatically kept in the impl jar as well, so
 * the items with this annotation will all have {@link HostStubGenKeptInImpl} too.
 */
@Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface HostStubGenKeptInStub {
    String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenKeptInStub.class);
    String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
}
+0 −2
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@ import java.lang.annotation.Target;

/**
 * Annotation injected to all methods processed as "ignore".
 *
 * (This annotation is only added in the impl jar, but not the stub jar)
 */
@Target({METHOD})
@Retention(RetentionPolicy.RUNTIME)
+3 −3
Original line number Diff line number Diff line
@@ -25,11 +25,11 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation injected to all classes/methods/fields that are kept in the "impl" jar.
 * Annotation injected to all classes/methods/fields that are kept in the processes jar.
 */
@Target({TYPE, METHOD, CONSTRUCTOR, FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface HostStubGenKeptInImpl {
    String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenKeptInImpl.class);
public @interface HostStubGenProcessedAsKeep {
    String CLASS_INTERNAL_NAME = HostTestUtils.getInternalName(HostStubGenProcessedAsKeep.class);
    String CLASS_DESCRIPTOR = "L" + CLASS_INTERNAL_NAME + ";";
}
Loading