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

Commit 25a2c6dc authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Ravenwood] Define concrete exception when Ravenwood API is unsupported" into main

parents 6e602138 69fb024e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -44,9 +44,9 @@ filegroup {
}

filegroup {
    name: "ravenwood-standard-annotations",
    name: "ravenwood-common-options",
    srcs: [
        "texts/ravenwood-standard-annotations.txt",
        "texts/ravenwood-common-options.txt",
    ],
    visibility: [":__subpackages__"],
}
+12 −12
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ genrule_defaults {
        ":ravenwood-common-policies",
        ":ravenwood-framework-policies",
        ":ravenwood-standard-options",
        ":ravenwood-standard-annotations",
        ":ravenwood-common-options",
        ":ravenwood-annotation-allowed-classes",
    ],
    out: [
@@ -45,7 +45,7 @@ genrule_defaults {

framework_minus_apex_cmd = "$(location hoststubgen) " +
    "@$(location :ravenwood-standard-options) " +
    "@$(location :ravenwood-standard-annotations) " +
    "@$(location :ravenwood-common-options) " +
    "--debug-log $(location hoststubgen_framework-minus-apex.log) " +
    "--out-jar $(location ravenwood.jar) " +
    "--in-jar $(location :framework-minus-apex-for-host) " +
@@ -180,7 +180,7 @@ java_genrule {
    tools: ["hoststubgen"],
    cmd: "$(location hoststubgen) " +
        "@$(location :ravenwood-standard-options) " +
        "@$(location :ravenwood-standard-annotations) " +
        "@$(location :ravenwood-common-options) " +

        "--debug-log $(location hoststubgen_services.core.log) " +
        "--stats-file $(location hoststubgen_services.core_stats.csv) " +
@@ -199,7 +199,7 @@ java_genrule {
        ":ravenwood-common-policies",
        ":ravenwood-services-policies",
        ":ravenwood-standard-options",
        ":ravenwood-standard-annotations",
        ":ravenwood-common-options",
        ":ravenwood-annotation-allowed-classes",
    ],
    out: [
@@ -251,7 +251,7 @@ java_genrule {
    tools: ["hoststubgen"],
    cmd: "$(location hoststubgen) " +
        "@$(location :ravenwood-standard-options) " +
        "@$(location :ravenwood-standard-annotations) " +
        "@$(location :ravenwood-common-options) " +

        "--debug-log $(location hoststubgen_core-icu4j-for-host.log) " +
        "--stats-file $(location hoststubgen_core-icu4j-for-host_stats.csv) " +
@@ -270,7 +270,7 @@ java_genrule {
        ":ravenwood-common-policies",
        ":icu-ravenwood-policies",
        ":ravenwood-standard-options",
        ":ravenwood-standard-annotations",
        ":ravenwood-common-options",
    ],
    out: [
        "ravenwood.jar",
@@ -307,7 +307,7 @@ java_genrule {
    tools: ["hoststubgen"],
    cmd: "$(location hoststubgen) " +
        "@$(location :ravenwood-standard-options) " +
        "@$(location :ravenwood-standard-annotations) " +
        "@$(location :ravenwood-common-options) " +

        "--debug-log $(location framework-configinfrastructure.log) " +
        "--stats-file $(location framework-configinfrastructure_stats.csv) " +
@@ -326,7 +326,7 @@ java_genrule {
        ":ravenwood-common-policies",
        ":framework-configinfrastructure-ravenwood-policies",
        ":ravenwood-standard-options",
        ":ravenwood-standard-annotations",
        ":ravenwood-common-options",
    ],
    out: [
        "ravenwood.jar",
@@ -363,7 +363,7 @@ java_genrule {
    tools: ["hoststubgen"],
    cmd: "$(location hoststubgen) " +
        "@$(location :ravenwood-standard-options) " +
        "@$(location :ravenwood-standard-annotations) " +
        "@$(location :ravenwood-common-options) " +

        "--debug-log $(location framework-statsd.log) " +
        "--stats-file $(location framework-statsd_stats.csv) " +
@@ -382,7 +382,7 @@ java_genrule {
        ":ravenwood-common-policies",
        ":framework-statsd-ravenwood-policies",
        ":ravenwood-standard-options",
        ":ravenwood-standard-annotations",
        ":ravenwood-common-options",
    ],
    out: [
        "ravenwood.jar",
@@ -419,7 +419,7 @@ java_genrule {
    tools: ["hoststubgen"],
    cmd: "$(location hoststubgen) " +
        "@$(location :ravenwood-standard-options) " +
        "@$(location :ravenwood-standard-annotations) " +
        "@$(location :ravenwood-common-options) " +

        "--debug-log $(location framework-graphics.log) " +
        "--stats-file $(location framework-graphics_stats.csv) " +
@@ -438,7 +438,7 @@ java_genrule {
        ":ravenwood-common-policies",
        ":framework-graphics-ravenwood-policies",
        ":ravenwood-standard-options",
        ":ravenwood-standard-annotations",
        ":ravenwood-common-options",
    ],
    out: [
        "ravenwood.jar",
+1 −4
Original line number Diff line number Diff line
@@ -712,10 +712,7 @@ public class RavenwoodRuntimeEnvironmentController {
    }

    static <T> T makeDefaultThrowMock(Class<T> clazz) {
        return mock(clazz, inv -> {
            HostTestUtils.onThrowMethodCalled();
            return null;
        });
        return mock(clazz, inv -> { throw new RavenwoodUnsupportedApiException(); });
    }

    // TODO: use the real UiAutomation class instead of a mock
+24 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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 android.platform.test.ravenwood;

public class RavenwoodUnsupportedApiException extends UnsupportedOperationException {
    public RavenwoodUnsupportedApiException() {
        super("This method is not yet supported under the Ravenwood deviceless testing "
                + "environment; consider requesting support from the API owner or "
                + "consider using Mockito; more details at go/ravenwood-docs");
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
--delete-finals

# Include standard annotations
@jar:texts/ravenwood-standard-annotations.txt
@jar:texts/ravenwood-common-options.txt

# Apply common policies
--policy-override-file
Loading