Agatha Man | 36fc50c | 2015-07-27 10:34:24 -0700 | [diff] [blame] | 1 | # Copyright (C) 2015 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 | |
| 15 | # |
| 16 | # Builds a package which can be instrumented to retrieve information about the device under test. |
| 17 | # |
| 18 | |
| 19 | DEVICE_INFO_PACKAGE := com.android.compatibility.common.deviceinfo |
| 20 | DEVICE_INFO_INSTRUMENT := com.android.compatibility.common.deviceinfo.DeviceInfoInstrument |
Agatha Man | 62a97bf | 2015-07-14 13:47:47 -0700 | [diff] [blame] | 21 | DEVICE_INFO_PERMISSIONS += android.permission.WRITE_EXTERNAL_STORAGE |
Yin-Chia Yeh | cab7ded | 2016-02-23 14:57:21 -0800 | [diff] [blame] | 22 | DEVICE_INFO_ACTIVITIES += \ |
| 23 | $(DEVICE_INFO_PACKAGE).CameraDeviceInfo \ |
| 24 | $(DEVICE_INFO_PACKAGE).GenericDeviceInfo \ |
| 25 | $(DEVICE_INFO_PACKAGE).PackageDeviceInfo |
Agatha Man | 36fc50c | 2015-07-27 10:34:24 -0700 | [diff] [blame] | 26 | |
| 27 | # Add the base device info |
| 28 | LOCAL_STATIC_JAVA_LIBRARIES += compatibility-device-info |
| 29 | |
Agatha Man | 36fc50c | 2015-07-27 10:34:24 -0700 | [diff] [blame] | 30 | # Generator of APK manifests. |
| 31 | MANIFEST_GENERATOR_JAR := $(HOST_OUT_JAVA_LIBRARIES)/compatibility-manifest-generator.jar |
| 32 | MANIFEST_GENERATOR := java -jar $(MANIFEST_GENERATOR_JAR) |
| 33 | |
| 34 | # Generate the manifest |
| 35 | manifest_xml := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/AndroidManifest.xml |
| 36 | $(manifest_xml): PRIVATE_INFO_PERMISSIONS := $(foreach permission, $(DEVICE_INFO_PERMISSIONS),-r $(permission)) |
| 37 | $(manifest_xml): PRIVATE_INFO_ACTIVITIES := $(foreach activity,$(DEVICE_INFO_ACTIVITIES),-a $(activity)) |
| 38 | $(manifest_xml): PRIVATE_PACKAGE := $(DEVICE_INFO_PACKAGE) |
| 39 | $(manifest_xml): PRIVATE_INSTRUMENT := $(DEVICE_INFO_INSTRUMENT) |
Agatha Man | 62a97bf | 2015-07-14 13:47:47 -0700 | [diff] [blame] | 40 | |
| 41 | # Regenerate manifest.xml if the generator jar, */cts-device-info/Android.mk, or this file is changed. |
| 42 | $(manifest_xml): $(MANIFEST_GENERATOR_JAR) $(LOCAL_PATH)/Android.mk cts/build/device_info_package.mk |
Agatha Man | 36fc50c | 2015-07-27 10:34:24 -0700 | [diff] [blame] | 43 | $(hide) echo Generating manifest for $(PRIVATE_NAME) |
| 44 | $(hide) mkdir -p $(dir $@) |
| 45 | $(hide) $(MANIFEST_GENERATOR) \ |
| 46 | $(PRIVATE_INFO_PERMISSIONS) \ |
| 47 | $(PRIVATE_INFO_ACTIVITIES) \ |
| 48 | -p $(PRIVATE_PACKAGE) \ |
| 49 | -i $(PRIVATE_INSTRUMENT) \ |
| 50 | -o $@ |
| 51 | |
| 52 | # Reset variables |
| 53 | DEVICE_INFO_PACKAGE := |
| 54 | DEVICE_INFO_INSTRUMENT := |
| 55 | DEVICE_INFO_PERMISSIONS := |
| 56 | DEVICE_INFO_ACTIVITIES := |
| 57 | |
| 58 | LOCAL_FULL_MANIFEST_FILE := $(manifest_xml) |
| 59 | # Disable by default |
| 60 | LOCAL_DEX_PREOPT := false |
| 61 | LOCAL_PROGUARD_ENABLED := disabled |
| 62 | |
| 63 | # Don't include this package in any target |
| 64 | LOCAL_MODULE_TAGS := optional |
| 65 | # And when built explicitly put it in the data partition |
| 66 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) |
| 67 | |
| 68 | LOCAL_SDK_VERSION := current |
| 69 | |
Agatha Man | 2285129 | 2015-06-29 16:54:32 -0700 | [diff] [blame] | 70 | include $(BUILD_CTS_SUPPORT_PACKAGE) |