Merge "Add @UsesReflection to FeatureFactory reflection usage"
This commit is contained in:
committed by
Android (Google) Code Review
commit
916c168218
@@ -106,6 +106,7 @@ android_library {
|
|||||||
plugins: ["androidx.room_room-compiler-plugin"],
|
plugins: ["androidx.room_room-compiler-plugin"],
|
||||||
|
|
||||||
libs: [
|
libs: [
|
||||||
|
"keepanno-annotations",
|
||||||
"telephony-common",
|
"telephony-common",
|
||||||
"ims-common",
|
"ims-common",
|
||||||
],
|
],
|
||||||
|
@@ -51,6 +51,9 @@ import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
|
|||||||
import com.android.settings.wifi.WifiTrackerLibProvider;
|
import com.android.settings.wifi.WifiTrackerLibProvider;
|
||||||
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
import com.android.settings.wifi.factory.WifiFeatureProvider;
|
||||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
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
|
* 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
|
* already exist. Uses the value of {@link R.string#config_featureFactory} to instantiate
|
||||||
* a factory implementation.
|
* 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) {
|
public static FeatureFactory getFactory(Context context) {
|
||||||
if (sFactory != null) {
|
if (sFactory != null) {
|
||||||
return sFactory;
|
return sFactory;
|
||||||
|
Reference in New Issue
Block a user