1// Copyright (C) 2020 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19filegroup { 20 name: "rotary-service-proto-source", 21 srcs: [ 22 "proto/car_rotary_controller.proto", 23 ], 24} 25gensrcs { 26 name: "rotary-service-javastream-protos", 27 depfile: true, 28 29 tools: [ 30 "aprotoc", 31 "protoc-gen-javastream", 32 "soong_zip", 33 ], 34 35 cmd: "mkdir -p $(genDir)/$(in) " + 36 "&& $(location aprotoc) " + 37 " --plugin=$(location protoc-gen-javastream) " + 38 " --dependency_out=$(depfile) " + 39 " --javastream_out=$(genDir)/$(in) " + 40 " -Iexternal/protobuf/src " + 41 " -I . " + 42 " $(in) " + 43 "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/$(in) -D $(genDir)/$(in)", 44 45 srcs: [ 46 ":rotary-service-proto-source", 47 ], 48 output_extension: "srcjar", 49} 50 51android_app { 52 name: "CarRotaryController", 53 srcs: [ 54 "src/**/*.java", 55 ":rotary-service-javastream-protos", 56 ], 57 resource_dirs: ["res"], 58 59 // This app uses allowlisted privileged permissions. 60 required: ["allowed_privapp_com.android.car.rotary"], 61 62 // Because it uses a platform API (CarInputManager). 63 platform_apis: true, 64 65 // This app should be platform signed because it requires 66 // android.car.permission.CAR_MONITOR_INPUT permission, which is of type "signature". 67 certificate: "platform", 68 69 // This app uses allowlisted privileged permissions. 70 privileged: true, 71 72 optimize: { 73 enabled: false, 74 }, 75 dex_preopt: { 76 enabled: false, 77 }, 78 libs: [ 79 "android.car", 80 ], 81 static_libs: [ 82 "car-ui-lib", 83 ], 84 product_variables: { 85 pdk: { 86 enabled: false, 87 }, 88 }, 89} 90 91android_library { 92 name: "CarRotaryControllerForUnitTesting", 93 94 manifest: "tests/unit/AndroidManifest.xml", 95 96 srcs: [ 97 "src/**/*.java", 98 ":rotary-service-javastream-protos", 99 ], 100 101 resource_dirs: [ 102 "tests/unit/res", 103 "res", 104 ], 105 106 platform_apis: true, 107 108 optimize: { 109 enabled: false, 110 }, 111 dex_preopt: { 112 enabled: false, 113 }, 114 libs: [ 115 "android.car", 116 ], 117 static_libs: [ 118 "car-ui-lib", 119 ], 120 product_variables: { 121 pdk: { 122 enabled: false, 123 }, 124 }, 125 126 aaptflags: ["--extra-packages com.android.car.rotary"], 127} 128