diff --git a/framework-t/Android.bp b/framework-t/Android.bp index 5ae1ef9836fd2030055f19fd3c44860228844d64..21bb7d58f011b99ce98797c96b308021e49af7fd 100644 --- a/framework-t/Android.bp +++ b/framework-t/Android.bp @@ -19,12 +19,12 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -framework_remoteauth_srcs = [":framework-remoteauth-java-sources"] -framework_remoteauth_api_srcs = [] +framework_remoteauth_srcs = [":framework-remoteauth-java-sources-udc-compat"] +framework_remoteauth_api_srcs = [":framework-remoteauth-java-sources"] java_defaults { name: "enable-remoteauth-targets", - enabled: true, + enabled: false, } // Include build rules from Sources.bp diff --git a/remoteauth/framework-udc-compat/Android.bp b/remoteauth/framework-udc-compat/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..799ffd06df7d6a1c3df14077089404d390d4fdf9 --- /dev/null +++ b/remoteauth/framework-udc-compat/Android.bp @@ -0,0 +1,32 @@ +// Copyright (C) 2023 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 { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +// Sources included in the framework-connectivity jar for compatibility +// builds in udc branches. They are only compatibility stubs to make +// the module build, since remoteauth is not available on U. +filegroup { + name: "framework-remoteauth-java-sources-udc-compat", + srcs: [ + "java/**/*.java", + ], + path: "java", + visibility: [ + "//packages/modules/Connectivity/framework-t:__subpackages__", + ], +} + diff --git a/remoteauth/framework-udc-compat/java/README.md b/remoteauth/framework-udc-compat/java/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7a0130836da407ce5a2d175e3cc33f1472714b3c --- /dev/null +++ b/remoteauth/framework-udc-compat/java/README.md @@ -0,0 +1,4 @@ +# RemoteAuth udc compatibility framework files + +This directory is created to contain compatibility implementations of RemoteAuth classes for builds +in udc branches. diff --git a/remoteauth/service-udc-compat/Android.bp b/remoteauth/service-udc-compat/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..69c667d8f594af69fb155d6e4dd6e5874d70986a --- /dev/null +++ b/remoteauth/service-udc-compat/Android.bp @@ -0,0 +1,51 @@ +// Copyright (C) 2023 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 { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +// Compatibility library included in the service-connectivity jar for +// builds in udc branches. It only contains compatibility stubs to make +// the module build, since remoteauth is not available on U. + +// Main lib for remoteauth services. +java_library { + name: "service-remoteauth-pre-jarjar-udc-compat", + srcs: ["java/**/*.java"], + + defaults: [ + "framework-system-server-module-defaults" + ], + libs: [ + "androidx.annotation_annotation", + "error_prone_annotations", + ], + sdk_version: "system_server_current", + // This is included in service-connectivity which is 30+ + min_sdk_version: "30", + + dex_preopt: { + enabled: false, + app_image: false, + }, + visibility: [ + "//packages/modules/Connectivity/service", + "//packages/modules/Connectivity/service-t", + ], + apex_available: [ + "com.android.tethering", + ], +} + diff --git a/remoteauth/service-udc-compat/java/com/android/server/remoteauth/RemoteAuthService.java b/remoteauth/service-udc-compat/java/com/android/server/remoteauth/RemoteAuthService.java new file mode 100644 index 0000000000000000000000000000000000000000..ac4fde13bffac758b13b19525918f3c6e2cae6bb --- /dev/null +++ b/remoteauth/service-udc-compat/java/com/android/server/remoteauth/RemoteAuthService.java @@ -0,0 +1,28 @@ +/* + * Copyright 2023 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.remoteauth; + +import android.os.Binder; +import android.content.Context; + +/** Compatibility stub for RemoteAuthService in udc branch builds. */ +public class RemoteAuthService extends Binder { + public static final String SERVICE_NAME = "remote_auth"; + public RemoteAuthService(Context context) { + throw new UnsupportedOperationException("RemoteAuthService is not supported in this build"); + } +} diff --git a/service-t/Android.bp b/service-t/Android.bp index 08527a35d2617ce10ae18d5191cf6788ad9d8d74..0f149568744fd85dd5eb9ad4921f73f5cdaa163f 100644 --- a/service-t/Android.bp +++ b/service-t/Android.bp @@ -19,7 +19,7 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -service_remoteauth_pre_jarjar_lib = "service-remoteauth-pre-jarjar" +service_remoteauth_pre_jarjar_lib = "service-remoteauth-pre-jarjar-udc-compat" // Include build rules from Sources.bp build = ["Sources.bp"] diff --git a/service/Android.bp b/service/Android.bp index 8e59e8615e6e1f60b7bf216f27a83f402efe79ad..134517f4a657a615c9ae456a5994cf03013065c2 100644 --- a/service/Android.bp +++ b/service/Android.bp @@ -19,7 +19,7 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -service_remoteauth_pre_jarjar_lib = "service-remoteauth-pre-jarjar" +service_remoteauth_pre_jarjar_lib = "service-remoteauth-pre-jarjar-udc-compat" // The above variables may have different values // depending on the branch, and this comment helps