Loading core/java/Android.bp +38 −0 Original line number Diff line number Diff line Loading @@ -21,14 +21,52 @@ filegroup { "**/*.aidl", ":framework-nfc-non-updatable-sources", ":messagequeue-gen", ":ranging_stack_mock_initializer", ], // Exactly one MessageQueue.java will be added to srcs by messagequeue-gen exclude_srcs: [ "android/os/*MessageQueue/**/*.java", "android/ranging/**/*.java", ], visibility: ["//frameworks/base"], } //Mock to allow service registry for ranging stack. //TODO(b/331206299): Remove this after RELEASE_RANGING_STACK is ramped up to next. soong_config_module_type { name: "ranging_stack_framework_mock_init", module_type: "genrule", config_namespace: "bootclasspath", bool_variables: [ "release_ranging_stack", ], properties: [ "srcs", "cmd", "out", ], } // The actual RangingFrameworkInitializer is present in packages/modules/Uwb/ranging/framework. // Mock RangingFrameworkInitializer does nothing and allows to successfully build // SystemServiceRegistry after registering for system service in SystemServiceRegistry both with // and without build flag RELEASE_RANGING_STACK enabled. ranging_stack_framework_mock_init { name: "ranging_stack_mock_initializer", soong_config_variables: { release_ranging_stack: { cmd: "touch $(out)", // Adding an empty file as out is mandatory. out: ["android/ranging/empty_ranging_fw.txt"], conditions_default: { srcs: ["android/ranging/mock/RangingFrameworkInitializer.java"], cmd: "mkdir -p android/ranging/; cp $(in) $(out);", out: ["android/ranging/RangingFrameworkInitializer.java"], }, }, }, } // Add selected MessageQueue.java implementation to srcs soong_config_module_type { name: "release_package_messagequeue_implementation_srcs", Loading core/java/android/app/SystemServiceRegistry.java +7 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,7 @@ import android.print.IPrintManager; import android.print.PrintManager; import android.provider.E2eeContactKeysManager; import android.provider.ProviderFrameworkInitializer; import android.ranging.RangingFrameworkInitializer; import android.safetycenter.SafetyCenterFrameworkInitializer; import android.scheduling.SchedulingFrameworkInitializer; import android.security.FileIntegrityManager; Loading Loading @@ -1825,6 +1826,12 @@ public final class SystemServiceRegistry { if (android.webkit.Flags.updateServiceIpcWrapper()) { WebViewBootstrapFrameworkInitializer.registerServiceWrappers(); } // This is guarded by aconfig flag "com.android.ranging.flags.ranging_stack_enabled" // when the build flag RELEASE_RANGING_STACK is enabled. When disabled, this calls the // mock RangingFrameworkInitializer#registerServiceWrappers which is no-op. As the // aconfig lib for ranging module is built only if RELEASE_RANGING_STACK is enabled, // flagcannot be added here. RangingFrameworkInitializer.registerServiceWrappers(); } finally { // If any of the above code throws, we're in a pretty bad shape and the process // will likely crash, but we'll reset it just in case there's an exception handler... Loading core/java/android/ranging/mock/RangingFrameworkInitializer.java 0 → 100644 +34 −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 android.ranging; /** * Mock RangingFrameworkInitializer. * * @hide */ // TODO(b/331206299): Remove this after RANGING_STACK_ENABLED is ramped up to next. public final class RangingFrameworkInitializer { private RangingFrameworkInitializer() {} /** * @hide */ public static void registerServiceWrappers() { // No-op. } } Loading
core/java/Android.bp +38 −0 Original line number Diff line number Diff line Loading @@ -21,14 +21,52 @@ filegroup { "**/*.aidl", ":framework-nfc-non-updatable-sources", ":messagequeue-gen", ":ranging_stack_mock_initializer", ], // Exactly one MessageQueue.java will be added to srcs by messagequeue-gen exclude_srcs: [ "android/os/*MessageQueue/**/*.java", "android/ranging/**/*.java", ], visibility: ["//frameworks/base"], } //Mock to allow service registry for ranging stack. //TODO(b/331206299): Remove this after RELEASE_RANGING_STACK is ramped up to next. soong_config_module_type { name: "ranging_stack_framework_mock_init", module_type: "genrule", config_namespace: "bootclasspath", bool_variables: [ "release_ranging_stack", ], properties: [ "srcs", "cmd", "out", ], } // The actual RangingFrameworkInitializer is present in packages/modules/Uwb/ranging/framework. // Mock RangingFrameworkInitializer does nothing and allows to successfully build // SystemServiceRegistry after registering for system service in SystemServiceRegistry both with // and without build flag RELEASE_RANGING_STACK enabled. ranging_stack_framework_mock_init { name: "ranging_stack_mock_initializer", soong_config_variables: { release_ranging_stack: { cmd: "touch $(out)", // Adding an empty file as out is mandatory. out: ["android/ranging/empty_ranging_fw.txt"], conditions_default: { srcs: ["android/ranging/mock/RangingFrameworkInitializer.java"], cmd: "mkdir -p android/ranging/; cp $(in) $(out);", out: ["android/ranging/RangingFrameworkInitializer.java"], }, }, }, } // Add selected MessageQueue.java implementation to srcs soong_config_module_type { name: "release_package_messagequeue_implementation_srcs", Loading
core/java/android/app/SystemServiceRegistry.java +7 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,7 @@ import android.print.IPrintManager; import android.print.PrintManager; import android.provider.E2eeContactKeysManager; import android.provider.ProviderFrameworkInitializer; import android.ranging.RangingFrameworkInitializer; import android.safetycenter.SafetyCenterFrameworkInitializer; import android.scheduling.SchedulingFrameworkInitializer; import android.security.FileIntegrityManager; Loading Loading @@ -1825,6 +1826,12 @@ public final class SystemServiceRegistry { if (android.webkit.Flags.updateServiceIpcWrapper()) { WebViewBootstrapFrameworkInitializer.registerServiceWrappers(); } // This is guarded by aconfig flag "com.android.ranging.flags.ranging_stack_enabled" // when the build flag RELEASE_RANGING_STACK is enabled. When disabled, this calls the // mock RangingFrameworkInitializer#registerServiceWrappers which is no-op. As the // aconfig lib for ranging module is built only if RELEASE_RANGING_STACK is enabled, // flagcannot be added here. RangingFrameworkInitializer.registerServiceWrappers(); } finally { // If any of the above code throws, we're in a pretty bad shape and the process // will likely crash, but we'll reset it just in case there's an exception handler... Loading
core/java/android/ranging/mock/RangingFrameworkInitializer.java 0 → 100644 +34 −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 android.ranging; /** * Mock RangingFrameworkInitializer. * * @hide */ // TODO(b/331206299): Remove this after RANGING_STACK_ENABLED is ramped up to next. public final class RangingFrameworkInitializer { private RangingFrameworkInitializer() {} /** * @hide */ public static void registerServiceWrappers() { // No-op. } }