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

Commit bf909f9b authored by Amos Bianchi's avatar Amos Bianchi Committed by Android (Google) Code Review
Browse files

Merge "Add anomaly detector service." into main

parents 42c96b55 41eb6e31
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ aconfig_declarations_group {
        "aconfig_settingslib_flags_java_lib",
        "aconfig_trade_in_mode_flags_java_lib",
        "adpf_flags_java_lib",
        "anomaly-detector-exported-aconfig-flags-lib",
        "android.app.appfunctions.flags-aconfig-java",
        "android.app.assist.flags-aconfig-java",
        "android.app.contextualsearch.flags-aconfig-java",
+10 −0
Original line number Diff line number Diff line
@@ -129,6 +129,11 @@ combined_apis {
        default: [
            "framework-platformtelephony",
        ],
    }) + select(release_flag("RELEASE_ANOMALY_DETECTOR"), {
        true: [
            "framework-anomaly-detector",
        ],
        default: [],
    }),
    system_server_classpath: [
        "service-art",
@@ -148,6 +153,11 @@ combined_apis {
            "service-crashrecovery",
        ],
        default: [],
    }) + select(release_flag("RELEASE_ANOMALY_DETECTOR"), {
        true: [
            "service-anomaly-detector",
        ],
        default: [],
    }),
}

+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ stubs_defaults {
        ":framework-permission-s-sources",
        ":framework-permission-sources",
        ":framework-profiling-sources",
        ":framework-anomaly-detector-sources",
        ":framework-scheduling-sources",
        ":framework-sdkextensions-sources",
        ":framework-sdksandbox-sources",
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ package android.content {
    method @NonNull public android.content.Context createContextForSdkInSandbox(@NonNull android.content.pm.ApplicationInfo, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @NonNull public android.os.IBinder getProcessToken();
    method @NonNull public android.os.UserHandle getUser();
    field @FlaggedApi("android.os.profiling.anomaly.flags.anomaly_detector_core") public static final String ANOMALY_DETECTOR_SERVICE = "anomaly_detector";
    field @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence_module") public static final int BIND_FOREGROUND_SERVICE = 67108864; // 0x4000000
    field public static final String PAC_PROXY_SERVICE = "pac_proxy";
    field public static final String TEST_NETWORK_SERVICE = "test_network";
+39 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ filegroup {
        ":framework-nfc-non-updatable-sources",
        ":messagequeue-gen",
        ":ranging_stack_mock_initializer",
        ":anomaly_detector_mock_initializer",
        ":systemfeatures-gen-srcs",
        ":framework-network-security-config-sources",
    ],
@@ -33,6 +34,7 @@ filegroup {
        "android/os/*MessageQueue/**/*.java",
        "android/os/DeliQueue/**/*.java",
        "android/ranging/**/*.java",
        "android/os/mock/*.java",
    ],
    visibility: ["//frameworks/base"],
}
@@ -81,6 +83,43 @@ ranging_stack_framework_mock_init {
    },
}

// Mock to allow service registry for anomaly detector.
// TODO(b/437406213): Remove this after RELEASE_ANOMALY_DETECTOR is ramped up to next.
soong_config_module_type {
    name: "anomaly_detector_framework_mock_init",
    module_type: "genrule",
    config_namespace: "bootclasspath",
    bool_variables: [
        "release_anomaly_detector",
    ],
    properties: [
        "cmd",
        "out",
        "srcs",
    ],
}

// The actual AnomalyDetectorFrameworkInitializer is present in
// packages/modules/Profiling/anomaly-detector/framework.
// Mock AnomalyDetectorFrameworkInitializer does nothing and allows to successfully build
// SystemServiceRegistry after registering for system service in SystemServiceRegistry both with
// and without build flag RELEASE_ANOMALY_DETECTOR enabled.
anomaly_detector_framework_mock_init {
    name: "anomaly_detector_mock_initializer",
    soong_config_variables: {
        release_anomaly_detector: {
            cmd: "touch $(out)",
            // Adding an empty file as out is mandatory.
            out: ["android/os/empty_anomaly_detector.txt"],
            conditions_default: {
                srcs: ["android/os/mock/AnomalyDetectorFrameworkInitializer.java"],
                cmd: "mkdir -p android/os/; cp $(in) $(out);",
                out: ["android/os/AnomalyDetectorFrameworkInitializer.java"],
            },
        },
    },
}

// Add selected MessageQueue.java implementation to srcs
soong_config_module_type {
    name: "release_package_messagequeue_implementation_srcs",
Loading