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

Commit 35eb10d9 authored by Mårten Kongstad's avatar Mårten Kongstad
Browse files

Expand @FlaggedApi(FLAG) constants in API signature files

The auto-generated Flags.FLAG_NAME constants are difficult to review in
API tracking files. metalava will expand annotation arguments if

  (1) the field declaration is known to metalava, and
  (2) the constant is not part of the API surface.

The auto-generated constants are hidden, so not part of any API surface.
This satisfies (1).

This CL adds the auto-generated sources to metalava's input. This
satisfies (2).

Example how how this CL modifies the API signature files:

-    method @FlaggedApi(Flags.FLAG_SCROLL_FEEDBACK_API) public boolean isHapticScrollFeedbackEnabled(int, int, int);
+    method @FlaggedApi("android.view.flags.scroll_feedback_api") public boolean isHapticScrollFeedbackEnabled(int, int, int);

Bug: 297881670
Test: m checkapi
Change-Id: I3259a2f4a114eb8c6eaff0bdbe151f6caef414aa
parent 22b818af
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -12,11 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Aconfig declarations and libraries for the core framework
java_defaults {
    name: "framework-minus-apex-aconfig-libraries",

    // Add java_aconfig_libraries to here to add them to the core framework
filegroup {
    name: "framework-minus-apex-aconfig-srcjars",
    srcs: [
        ":android.app.usage.flags-aconfig-java{.generated_srcjars}",
        ":android.content.pm.flags-aconfig-java{.generated_srcjars}",
@@ -36,6 +33,16 @@ java_defaults {
        ":com.android.media.flags.bettertogether-aconfig-java{.generated_srcjars}",
        ":sdk_sandbox_flags_lib{.generated_srcjars}",
    ],
}

// Aconfig declarations and libraries for the core framework
java_defaults {
    name: "framework-minus-apex-aconfig-libraries",

    // Add java_aconfig_libraries to here to add them to the core framework
    srcs: [
        ":framework-minus-apex-aconfig-srcjars",
    ],
    // Add aconfig-annotations-lib as a dependency for the optimization
    libs: ["aconfig-annotations-lib"],
}
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ droidstubs {
        "android-non-updatable-stubs-defaults",
        "module-classpath-stubs-defaults",
    ],
    srcs: [
        ":framework-minus-apex-aconfig-srcjars",
    ],
    args: metalava_framework_docs_args + "--error UnflaggedApi ",
    check_api: {
        current: {
+47 −47

File changed.

Preview size limit exceeded, changes collapsed.