markchien | 932da86 | 2019-08-27 10:19:38 +0800 | [diff] [blame^] | 1 | // |
| 2 | // Copyright (C) 2019 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | java_defaults { |
| 18 | name: "TetheringAndroidLibraryDefaults", |
| 19 | platform_apis: true, |
| 20 | srcs: [ |
| 21 | "src/**/*.java", |
| 22 | ], |
| 23 | static_libs: [ |
| 24 | "androidx.annotation_annotation", |
| 25 | "tethering-client", |
| 26 | ], |
| 27 | manifest: "AndroidManifestBase.xml", |
| 28 | } |
| 29 | |
| 30 | // Build tethering static library, used to compile both variants of the tethering. |
| 31 | android_library { |
| 32 | name: "TetheringApiCurrentLib", |
| 33 | defaults: ["TetheringAndroidLibraryDefaults"], |
| 34 | } |
| 35 | |
| 36 | // Common defaults for compiling the actual APK. |
| 37 | java_defaults { |
| 38 | name: "TetheringAppDefaults", |
| 39 | platform_apis: true, |
| 40 | privileged: true, |
| 41 | resource_dirs: [ |
| 42 | "res", |
| 43 | ], |
| 44 | optimize: { |
| 45 | proguard_flags_files: ["proguard.flags"], |
| 46 | }, |
| 47 | } |
| 48 | |
| 49 | // Non-updatable tethering running in the system server process for devices not using the module |
| 50 | // TODO: build in-process tethering APK here. |
| 51 | |
| 52 | // Updatable tethering packaged as an application |
| 53 | android_app { |
| 54 | name: "Tethering", |
| 55 | defaults: ["TetheringAppDefaults"], |
| 56 | static_libs: ["TetheringApiCurrentLib"], |
| 57 | certificate: "networkstack", |
| 58 | manifest: "AndroidManifest.xml", |
| 59 | use_embedded_native_libs: true, |
| 60 | // The permission configuration *must* be included to ensure security of the device |
| 61 | required: ["NetworkPermissionConfig"], |
| 62 | } |