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

Commit facfd9a4 authored by Yan Yan's avatar Yan Yan
Browse files

Add VcnLocation to reflect the VCN build system flag value

This patch defines VcnLocation.IS_VCN_IN_MAINLINE to reflect the
value of the build system flag RELEASE_MOVE_VCN_TO_MAINLINE.

Specifically two versions of VcnLocation file are defined. The build
system flag controls which VcnLocation file will be built in to the
platform. As results, the platform can read the value of
IS_VCN_IN_MAINLINE to know the value of the build system flag.

Bug: 375213246
Test: build-flag set RELEASE_MOVE_VCN_TO_MAINLINE and
      verified IS_VCN_IN_MAINLINE value
Flag: RELEASE_MOVE_VCN_TO_MAINLINE
Change-Id: I550fe1cc8a582b672281fd816804726a56531ca4
parent dc67a341
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -19,6 +19,19 @@ package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

filegroup {
    name: "vcn-location-sources",
    srcs: select(release_flag("RELEASE_MOVE_VCN_TO_MAINLINE"), {
        true: [
            "vcn-location-flag/module/com/android/server/vcn/VcnLocation.java",
        ],
        default: [
            "vcn-location-flag/platform/com/android/server/vcn/VcnLocation.java",
        ],
    }),
    visibility: ["//frameworks/base/services/core"],
}

java_library {
    name: "service-connectivity-b-pre-jarjar",
    sdk_version: "system_server_current",
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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 com.android.server.vcn;

/**
 * Class to represent that VCN is in a mainline module
 *
 * <p>This class is used to check whether VCN is in the non-updatable platform or in a mainline
 * module.
 */
// When VCN is in a mainline module, this class (module/com/android/server/vcn/VcnLocation.java)
// will be built in to the vcn-location-sources filegroup. When VCN is in the non-updatable
// platform, platform/com/android/server/vcn/VcnLocation.java will be built in to the filegroup
public class VcnLocation {
    /** Indicate that VCN is the platform */
    public static final boolean IS_VCN_IN_MAINLINE = true;
}
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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 com.android.server.vcn;

/**
 * Class to represent that VCN is in the platform
 *
 * <p>This class is used to check whether VCN is in the non-updatable platform or in a mainline
 * module.
 */
// When VCN is in a mainline module, module/com/android/server/vcn/VcnLocation.java
// will be built in to the vcn-location-sources filegroup. When VCN is in the non-updatable
// platform, this class (platform/com/android/server/vcn/VcnLocation.java) will be built in to the
// filegroup
public class VcnLocation {
    /** Indicate that VCN is the platform */
    public static final boolean IS_VCN_IN_MAINLINE = false;
}