From 591e121df6106197f8cba37696c28f4a90634f84 Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Thu, 21 Jan 2021 12:48:43 -0800 Subject: [PATCH] Add framework-permission-s java_sdk_library. This will host the moved framework classes for role. The class RoleFrameworkPlaceholder is added because the build won't pass if there isn't any java source. Bug: 158736025 Test: build Change-Id: Icabab2cc956d6c7c07a6217256d23a8402960307 --- Android.bp | 3 ++ StubLibraries.bp | 3 ++ apex/permission/Android.bp | 1 + apex/permission/framework-s/Android.bp | 44 +++++++++++++++++++ apex/permission/framework-s/api/current.txt | 1 + .../framework-s/api/module-lib-current.txt | 1 + .../framework-s/api/module-lib-removed.txt | 1 + apex/permission/framework-s/api/removed.txt | 1 + .../framework-s/api/system-current.txt | 1 + .../framework-s/api/system-removed.txt | 1 + .../app/role/RoleFrameworkPlaceholder.java | 26 +++++++++++ apex/permission/framework/Android.bp | 1 + api/Android.bp | 7 +++ 13 files changed, 91 insertions(+) create mode 100644 apex/permission/framework-s/Android.bp create mode 100644 apex/permission/framework-s/api/current.txt create mode 100644 apex/permission/framework-s/api/module-lib-current.txt create mode 100644 apex/permission/framework-s/api/module-lib-removed.txt create mode 100644 apex/permission/framework-s/api/removed.txt create mode 100644 apex/permission/framework-s/api/system-current.txt create mode 100644 apex/permission/framework-s/api/system-removed.txt create mode 100644 apex/permission/framework-s/java/android/app/role/RoleFrameworkPlaceholder.java diff --git a/Android.bp b/Android.bp index 5c0dd63ac0f7..c957aed4a8b9 100644 --- a/Android.bp +++ b/Android.bp @@ -400,6 +400,7 @@ filegroup { ":framework-graphics-srcs", ":framework-mediaprovider-sources", ":framework-permission-sources", + ":framework-permission-s-sources", ":framework-sdkextensions-sources", ":framework-statsd-sources", ":framework-tethering-srcs", @@ -417,6 +418,7 @@ java_library { "framework-media.stubs.module_lib", "framework-mediaprovider.stubs.module_lib", "framework-permission.stubs.module_lib", + "framework-permission-s.stubs.module_lib", "framework-sdkextensions.stubs.module_lib", "framework-statsd.stubs.module_lib", "framework-tethering.stubs.module_lib", @@ -435,6 +437,7 @@ java_library { "framework-graphics.impl", "framework-mediaprovider.impl", "framework-permission.impl", + "framework-permission-s.impl", "framework-sdkextensions.impl", "framework-statsd.impl", "framework-tethering.impl", diff --git a/StubLibraries.bp b/StubLibraries.bp index 665deda8aed1..d1ad189c3cdf 100644 --- a/StubLibraries.bp +++ b/StubLibraries.bp @@ -312,6 +312,7 @@ java_library_static { "framework-media.stubs", "framework-mediaprovider.stubs", "framework-permission.stubs", + "framework-permission-s.stubs", "framework-sdkextensions.stubs", "framework-statsd.stubs", "framework-tethering.stubs", @@ -333,6 +334,7 @@ java_library_static { "framework-media.stubs.system", "framework-mediaprovider.stubs.system", "framework-permission.stubs.system", + "framework-permission-s.stubs.system", "framework-sdkextensions.stubs.system", "framework-statsd.stubs.system", "framework-tethering.stubs.system", @@ -370,6 +372,7 @@ java_library_static { "framework-media.stubs.system", "framework-mediaprovider.stubs.system", "framework-permission.stubs.system", + "framework-permission-s.stubs.system", "framework-sdkextensions.stubs.system", "framework-statsd.stubs.system", "framework-tethering.stubs.system", diff --git a/apex/permission/Android.bp b/apex/permission/Android.bp index e30df05b2340..d839df3708da 100644 --- a/apex/permission/Android.bp +++ b/apex/permission/Android.bp @@ -26,6 +26,7 @@ apex_defaults { certificate: ":com.android.permission.certificate", java_libs: [ "framework-permission", + "framework-permission-s", "service-permission", ], apps: ["PermissionController"], diff --git a/apex/permission/framework-s/Android.bp b/apex/permission/framework-s/Android.bp new file mode 100644 index 000000000000..c621a04cad49 --- /dev/null +++ b/apex/permission/framework-s/Android.bp @@ -0,0 +1,44 @@ +// Copyright (C) 2021 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. + +filegroup { + name: "framework-permission-s-sources", + srcs: [ + "java/**/*.java", + "java/**/*.aidl", + ], + path: "java", + visibility: ["//frameworks/base"], +} + +java_sdk_library { + name: "framework-permission-s", + defaults: ["framework-module-defaults"], + srcs: [ + ":framework-permission-s-sources", + ], + apex_available: [ + "com.android.permission", + "test_com.android.permission", + ], + hostdex: true, + // Restrict access to implementation library. + impl_library_visibility: ["//frameworks/base/apex/permission:__subpackages__"], + installable: true, + min_sdk_version: "30", + permitted_packages: [ + "android.permission", + "android.app.role", + ], +} diff --git a/apex/permission/framework-s/api/current.txt b/apex/permission/framework-s/api/current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/apex/permission/framework-s/api/current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/permission/framework-s/api/module-lib-current.txt b/apex/permission/framework-s/api/module-lib-current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/apex/permission/framework-s/api/module-lib-current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/permission/framework-s/api/module-lib-removed.txt b/apex/permission/framework-s/api/module-lib-removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/apex/permission/framework-s/api/module-lib-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/permission/framework-s/api/removed.txt b/apex/permission/framework-s/api/removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/apex/permission/framework-s/api/removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/permission/framework-s/api/system-current.txt b/apex/permission/framework-s/api/system-current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/apex/permission/framework-s/api/system-current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/permission/framework-s/api/system-removed.txt b/apex/permission/framework-s/api/system-removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/apex/permission/framework-s/api/system-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/permission/framework-s/java/android/app/role/RoleFrameworkPlaceholder.java b/apex/permission/framework-s/java/android/app/role/RoleFrameworkPlaceholder.java new file mode 100644 index 000000000000..fb7ba3eee2b4 --- /dev/null +++ b/apex/permission/framework-s/java/android/app/role/RoleFrameworkPlaceholder.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 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.app.role; + +/** + * Temporary placeholder class inside framework-permission-s for compilation to pass. + * + * @hide + */ +public class RoleFrameworkPlaceholder { + private RoleFrameworkPlaceholder() {} +} diff --git a/apex/permission/framework/Android.bp b/apex/permission/framework/Android.bp index 36b5decbcaca..2150cb41ff5b 100644 --- a/apex/permission/framework/Android.bp +++ b/apex/permission/framework/Android.bp @@ -37,6 +37,7 @@ java_sdk_library { "com.android.permission", "test_com.android.permission", ], + min_sdk_version: "30", permitted_packages: [ "android.permission", "android.app.role", diff --git a/api/Android.bp b/api/Android.bp index 1a58a16f3dc7..69dce979748e 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -35,6 +35,7 @@ genrule { ":framework-media{.public.api.txt}", ":framework-mediaprovider{.public.api.txt}", ":framework-permission{.public.api.txt}", + ":framework-permission-s{.public.api.txt}", ":framework-sdkextensions{.public.api.txt}", ":framework-statsd{.public.api.txt}", ":framework-tethering{.public.api.txt}", @@ -71,6 +72,7 @@ genrule { ":framework-media{.public.stubs.source}", ":framework-mediaprovider{.public.stubs.source}", ":framework-permission{.public.stubs.source}", + ":framework-permission-s{.public.stubs.source}", ":framework-sdkextensions{.public.stubs.source}", ":framework-statsd{.public.stubs.source}", ":framework-tethering{.public.stubs.source}", @@ -93,6 +95,7 @@ genrule { ":framework-media{.public.removed-api.txt}", ":framework-mediaprovider{.public.removed-api.txt}", ":framework-permission{.public.removed-api.txt}", + ":framework-permission-s{.public.removed-api.txt}", ":framework-sdkextensions{.public.removed-api.txt}", ":framework-statsd{.public.removed-api.txt}", ":framework-tethering{.public.removed-api.txt}", @@ -125,6 +128,7 @@ genrule { ":framework-media{.system.api.txt}", ":framework-mediaprovider{.system.api.txt}", ":framework-permission{.system.api.txt}", + ":framework-permission-s{.system.api.txt}", ":framework-sdkextensions{.system.api.txt}", ":framework-statsd{.system.api.txt}", ":framework-tethering{.system.api.txt}", @@ -157,6 +161,7 @@ genrule { ":framework-media{.system.removed-api.txt}", ":framework-mediaprovider{.system.removed-api.txt}", ":framework-permission{.system.removed-api.txt}", + ":framework-permission-s{.system.removed-api.txt}", ":framework-sdkextensions{.system.removed-api.txt}", ":framework-statsd{.system.removed-api.txt}", ":framework-tethering{.system.removed-api.txt}", @@ -189,6 +194,7 @@ genrule { ":framework-media{.module-lib.api.txt}", ":framework-mediaprovider{.module-lib.api.txt}", ":framework-permission{.module-lib.api.txt}", + ":framework-permission-s{.module-lib.api.txt}", ":framework-sdkextensions{.module-lib.api.txt}", ":framework-statsd{.module-lib.api.txt}", ":framework-tethering{.module-lib.api.txt}", @@ -220,6 +226,7 @@ genrule { ":framework-media{.module-lib.removed-api.txt}", ":framework-mediaprovider{.module-lib.removed-api.txt}", ":framework-permission{.module-lib.removed-api.txt}", + ":framework-permission-s{.module-lib.removed-api.txt}", ":framework-sdkextensions{.module-lib.removed-api.txt}", ":framework-statsd{.module-lib.removed-api.txt}", ":framework-tethering{.module-lib.removed-api.txt}",