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 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "frameworks_base_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["frameworks_base_license"], 22} 23 24java_test_host { 25 name: "PackageManagerServiceHostTests", 26 srcs: ["src/**/*.kt"], 27 libs: [ 28 "tradefed", 29 "junit", 30 "truth-prebuilt", 31 ], 32 static_libs: [ 33 "cts-host-utils", 34 "frameworks-base-hostutils", 35 "PackageManagerServiceHostTestsIntentVerifyUtils", 36 ], 37 test_suites: ["general-tests"], 38 java_resources: [ 39 ":PackageManagerTestOverlayActor", 40 ":PackageManagerTestOverlay", 41 ":PackageManagerTestOverlayTarget", 42 ":PackageManagerTestOverlayTargetNoOverlayable", 43 ":PackageManagerTestAppDeclaresStaticLibrary", 44 ":PackageManagerTestAppStub", 45 ":PackageManagerTestAppUsesStaticLibrary", 46 ":PackageManagerTestAppVersion1", 47 ":PackageManagerTestAppVersion2", 48 ":PackageManagerTestAppVersion3", 49 ":PackageManagerTestAppVersion3Invalid", 50 ":PackageManagerTestAppVersion4", 51 ":PackageManagerTestAppOriginalOverride", 52 ":PackageManagerServiceDeviceSideTests", 53 ], 54} 55 56genrule { 57 name: "PackageManagerTestAppVersion3Invalid", 58 tools: [ 59 "soong_zip", 60 "zipalign", 61 ], 62 srcs: [ 63 ":PackageManagerTestAppVersion3", 64 ], 65 out: ["PackageManagerTestAppVersion3Invalid.apk"], 66 cmd: "mkdir -p $(genDir)/apk && unzip $(in) -d $(genDir)/apk" + 67 " && truncate -s 800 $(genDir)/apk/META-INF/CERT.RSA" + 68 " && $(location soong_zip) -o $(genDir)/temp.apk -L 0 -C $(genDir)/apk -D $(genDir)/apk" + 69 " && $(location zipalign) -f 4 $(genDir)/temp.apk $(out)", 70} 71