• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2008 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
17android_app {
18    name: "framework-res",
19    sdk_version: "core_platform",
20    certificate: "platform",
21
22    // Soong special-cases framework-res to install this alongside
23    // the libraries at /system/framework/framework-res.apk.
24
25    // Generate private symbols into the com.android.internal.R class
26    // so they are not accessible to 3rd party apps.
27    aaptflags: [
28        "--private-symbols",
29        "com.android.internal",
30
31        // Framework doesn't need versioning since it IS the platform.
32        "--no-auto-version",
33
34        // Allow overlay to add resource
35        "--auto-add-overlay",
36    ],
37
38    // Create package-export.apk, which other packages can use to get
39    // PRODUCT-agnostic resource data like IDs and type definitions.
40    export_package_resources: true,
41
42    dist: {
43        targets: [
44            "simulated_device_launcher",
45        ],
46    },
47}
48
49java_genrule {
50    name: "framework-res-package-jar",
51    srcs: [":framework-res{.export-package.apk}"],
52    out: ["framework-res-package.jar"],
53    cmd: "cp $(in) $(out)",
54}
55
56// This logic can be removed once robolectric's transition to binary resources is complete
57filegroup {
58    name: "robolectric_framework_raw_res_files",
59    srcs: [
60        "assets/**/*",
61        "res/**/*",
62    ],
63}
64
65// Generate a text file containing a list of permissions that non-system apps
66// are allowed to obtain.
67genrule {
68  name: "permission-list-normal",
69  out: ["permission-list-normal.txt"],
70  srcs: ["AndroidManifest.xml"],
71  cmd: "cat $(in) " +
72       // xmllint has trouble accessing attributes under the android namespace.
73       // Strip these prefixes prior to processing with xmllint.
74       " | sed -r 's/android:(name|protectionLevel)/\\1/g' " +
75       " | $(location xmllint) /dev/stdin --xpath " +
76       " '//permission[not(contains(@protectionLevel, \"signature\"))]/@name'" +
77       // The result of xmllint is name="value" pairs. Format these to just the
78       // permission name, one per-line.
79       " | sed -r 's/\\s*name=\\s*//g' | tr -d '\"'" +
80       " > $(out)",
81  tools: ["xmllint"]
82}
83