Merge "Allow adding framework and service java code into permission APEX."

This commit is contained in:
TreeHugger Robot
2020-01-16 11:15:45 +00:00
committed by Android (Google) Code Review
9 changed files with 144 additions and 0 deletions

View File

@@ -268,6 +268,7 @@ filegroup {
":framework-tethering-srcs",
":updatable-media-srcs",
":framework-mediaprovider-sources",
":framework-permission-sources",
":framework-wifi-updatable-sources",
":ike-srcs",
]
@@ -440,6 +441,7 @@ java_library {
"framework-appsearch-stubs",
// TODO(b/146167933): Use framework-statsd-stubs
"framework-statsd",
"framework-permission-stubs",
"framework-wifi-stubs",
"ike-stubs",
],
@@ -465,6 +467,7 @@ java_library {
"//frameworks/base/apex/appsearch/framework",
"//frameworks/base/apex/blobstore/framework",
"//frameworks/base/apex/jobscheduler/framework",
"//frameworks/base/apex/permission/framework",
"//frameworks/base/apex/statsd/service",
"//frameworks/base/wifi",
"//frameworks/opt/net/wifi/service",
@@ -489,6 +492,7 @@ java_library {
"updatable_media_stubs",
"framework_mediaprovider_stubs",
"framework-appsearch", // TODO(b/146218515): should be framework-appsearch-stubs
"framework-permission-stubs",
"framework-sdkextensions-stubs-systemapi",
// TODO(b/146167933): Use framework-statsd-stubs instead.
"framework-statsd",

View File

@@ -22,6 +22,10 @@ apex_defaults {
name: "com.android.permission-defaults",
key: "com.android.permission.key",
certificate: ":com.android.permission.certificate",
java_libs: [
"framework-permission",
"service-permission",
],
apps: ["PermissionController"],
}

View File

@@ -0,0 +1,60 @@
// Copyright (C) 2020 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-sources",
srcs: [
"java/**/*.java",
"java/**/*.aidl",
],
path: "java",
}
java_library {
name: "framework-permission",
srcs: [
":framework-permission-sources",
],
sdk_version: "system_current",
apex_available: [
"com.android.permission",
"test_com.android.permission",
],
hostdex: true,
installable: true,
visibility: [
"//frameworks/base/apex/permission:__subpackages__",
],
}
droidstubs {
name: "framework-permission-stubs-sources",
srcs: [
":framework-annotations",
":framework-permission-sources",
],
sdk_version: "system_current",
defaults: [
"framework-module-stubs-defaults-systemapi",
],
}
java_library {
name: "framework-permission-stubs",
srcs: [
":framework-permission-stubs-sources",
],
sdk_version: "system_current",
installable: false,
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2020 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.permission;
/**
* @hide
*/
public class PermissionState {}

View File

@@ -0,0 +1,29 @@
// Copyright (C) 2020 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.
java_library {
name: "service-permission",
srcs: [
"java/**/*.java",
],
sdk_version: "system_current",
libs: [
"framework-permission",
],
apex_available: [
"com.android.permission",
"test_com.android.permission",
],
installable: true,
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2020 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.permission;
/**
* Persistence for runtime permissions.
*/
public class RuntimePermissionPersistence {}

View File

@@ -39,6 +39,7 @@ static const char* kPathWhitelist[] = {
"/apex/com.android.media/javalib/updatable-media.jar",
"/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar",
"/apex/com.android.os.statsd/javalib/framework-statsd.jar",
"/apex/com.android.permission/javalib/framework-permission.jar",
"/apex/com.android.sdkext/javalib/framework-sdkextensions.jar",
"/apex/com.android.wifi/javalib/framework-wifi.jar",
"/apex/com.android.tethering/javalib/framework-tethering.jar",

View File

@@ -21,6 +21,7 @@ android_test {
"services.core",
"services.net",
"service-jobscheduler",
"service-permission",
"androidx.test.runner",
"mockito-target-extended-minus-junit4",
"platform-test-annotations",

View File

@@ -44,6 +44,7 @@ android_test {
"servicestests-utils",
"service-appsearch",
"service-jobscheduler",
"service-permission",
// TODO: remove once Android migrates to JUnit 4.12,
// which provides assertThrows
"testng",