Merge "Add enforcement parameter to RequiresFeature" am: dd438b73cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560535 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1dd3455a808aa2373270295ffbd9a01f1b4a1845
This commit is contained in:
@@ -30,7 +30,6 @@ import java.lang.annotation.Target;
|
|||||||
* Denotes that the annotated element requires one or more device features. This
|
* Denotes that the annotated element requires one or more device features. This
|
||||||
* is used to auto-generate documentation.
|
* is used to auto-generate documentation.
|
||||||
*
|
*
|
||||||
* @see PackageManager#hasSystemFeature(String)
|
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Retention(SOURCE)
|
@Retention(SOURCE)
|
||||||
@@ -38,8 +37,16 @@ import java.lang.annotation.Target;
|
|||||||
public @interface RequiresFeature {
|
public @interface RequiresFeature {
|
||||||
/**
|
/**
|
||||||
* The name of the device feature that is required.
|
* The name of the device feature that is required.
|
||||||
*
|
|
||||||
* @see PackageManager#hasSystemFeature(String)
|
|
||||||
*/
|
*/
|
||||||
String value();
|
String value();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the name of the method that should be called to check whether the feature is
|
||||||
|
* available, using the same signature format as javadoc. The feature checking method can have
|
||||||
|
* multiple parameters, but the feature name parameter must be of type String and must also be
|
||||||
|
* the first String-type parameter.
|
||||||
|
* <p>
|
||||||
|
* By default, the enforcement is {@link PackageManager#hasSystemFeature(String)}.
|
||||||
|
*/
|
||||||
|
String enforcement() default("android.content.pm.PackageManager#hasSystemFeature");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user