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

Commit 916c1682 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add @UsesReflection to FeatureFactory reflection usage"

parents f6d48fd7 2278b3f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ android_library {
    plugins: ["androidx.room_room-compiler-plugin"],

    libs: [
        "keepanno-annotations",
        "telephony-common",
        "ims-common",
    ],
+11 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
import com.android.settings.wifi.WifiTrackerLibProvider;
import com.android.settings.wifi.factory.WifiFeatureProvider;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.tools.r8.keepanno.annotations.KeepItemKind;
import com.android.tools.r8.keepanno.annotations.KeepTarget;
import com.android.tools.r8.keepanno.annotations.UsesReflection;

/**
 * Abstract class for creating feature controllers. Allows OEM implementations to define their own
@@ -70,6 +73,14 @@ public abstract class FeatureFactory {
     * already exist. Uses the value of {@link R.string#config_featureFactory} to instantiate
     * a factory implementation.
     */
    @UsesReflection(
            description = "This method instantiates subclasses of FeatureFactory via reflection.",
            value = {
                @KeepTarget(
                    kind = KeepItemKind.CLASS_AND_MEMBERS,
                    extendsClassConstant = FeatureFactory.class,
                    methodName = "<init>")
            })
    public static FeatureFactory getFactory(Context context) {
        if (sFactory != null) {
            return sFactory;