From fdd085a469cd71ac84924de4e1e6247fc6011f9f Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 27 Sep 2017 09:22:24 +0100 Subject: Update the template files provided for partners Update the template files provided for partners to use when integrating the time zone update feature. The manifests/ directory is no longer used: OEMs have to customize the AndroidManifest.xml because not everything can be handled via aapt. Bug: 65165603 Test: None, documentation only. None of the files are included in the build Change-Id: I742cb1eebcf2f2e2b6924447916442c83f62a52e (cherry picked from commit 9e06a0a119e710e043e5f1c376429afec52c01d3) --- manifests/install/AndroidManifest.xml | 34 ------------ manifests/uninstall/AndroidManifest.xml | 34 ------------ oem_template/data_app/AndroidManifest.xml | 62 ++++++++++++++++++++++ oem_template/data_app/README.oem | 20 +++++-- oem_template/data_app/build_oem_data_app.mk | 15 +++--- .../data_app/testing/build_oem_test_data_app.mk | 4 -- oem_template/data_app_prebuilt/Android.mk | 24 +++++++++ oem_template/data_app_prebuilt/README.oem | 21 ++++++++ .../data_app_prebuilt/include_app_prebuilt.mk | 40 ++++++++++++++ oem_template/data_app_prebuilt/testing/Android.mk | 26 +++++++++ .../testing/include_test_prebuilt.mk | 37 +++++++++++++ oem_template/xts/AndroidTest.xml | 6 +++ oem_template/xts/README.oem | 6 +-- 13 files changed, 242 insertions(+), 87 deletions(-) delete mode 100644 manifests/install/AndroidManifest.xml delete mode 100644 manifests/uninstall/AndroidManifest.xml create mode 100644 oem_template/data_app/AndroidManifest.xml create mode 100644 oem_template/data_app_prebuilt/Android.mk create mode 100644 oem_template/data_app_prebuilt/README.oem create mode 100644 oem_template/data_app_prebuilt/include_app_prebuilt.mk create mode 100644 oem_template/data_app_prebuilt/testing/Android.mk create mode 100644 oem_template/data_app_prebuilt/testing/include_test_prebuilt.mk diff --git a/manifests/install/AndroidManifest.xml b/manifests/install/AndroidManifest.xml deleted file mode 100644 index 45a8003..0000000 --- a/manifests/install/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/manifests/uninstall/AndroidManifest.xml b/manifests/uninstall/AndroidManifest.xml deleted file mode 100644 index 598a2be..0000000 --- a/manifests/uninstall/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/oem_template/data_app/AndroidManifest.xml b/oem_template/data_app/AndroidManifest.xml new file mode 100644 index 0000000..1f4046c --- /dev/null +++ b/oem_template/data_app/AndroidManifest.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + diff --git a/oem_template/data_app/README.oem b/oem_template/data_app/README.oem index e3dbe37..f288adf 100644 --- a/oem_template/data_app/README.oem +++ b/oem_template/data_app/README.oem @@ -5,10 +5,24 @@ OEM-INSTRUCTION See below for the purpose of this directory and changes OEMs mus This directory contains a suggested structure for building an OEM version of Time Zone Data app (real and test versions). -e.g. You can copy it +For example, you can copy it -cp -r data_app ${ANDROID_BUILD_TOP}/vendor/oemcorp/apps/TimeZoneDataOemCorp +cp -r data_app ${ANDROID_BUILD_TOP}/vendor/oemcorp/apps/TimeZoneData Where is your company name. -...then read / change all the things marked with OEM-INSTRUCTION. \ No newline at end of file +...then read / change all the things marked with OEM-INSTRUCTION. + +The intended use is for inclusion in a tapas build to generate .apks. The targets define the +real version of the app, and some test versions that can be used by the supplied xTS tests. + +The generated .apks are expected to be signed and checked in as "prebuilts" for the system +image and for xTS testing. + +The main, signed .apk can also be uploaded to an app store and used to update existing +devices. + +See oem_template/data_app_prebuilts for rules that can be used to include the prebuilts in +the system image and tests. + +See oem_template/xts for rules that can be used for xTS testing. diff --git a/oem_template/data_app/build_oem_data_app.mk b/oem_template/data_app/build_oem_data_app.mk index 7d9e611..f31e5d1 100644 --- a/oem_template/data_app/build_oem_data_app.mk +++ b/oem_template/data_app/build_oem_data_app.mk @@ -32,16 +32,15 @@ LOCAL_STATIC_JAVA_LIBRARIES := time_zone_distro_provider # All resources come from the vendor-specific dirs. LOCAL_RESOURCE_DIR := $(OEM_APP_PATH)/res -LOCAL_FULL_MANIFEST_FILE := packages/apps/TimeZoneData/manifests/install/AndroidManifest.xml +# Ensure the app can be unbundled by only depending on System APIs. +LOCAL_SDK_VERSION := system_current + +LOCAL_FULL_MANIFEST_FILE := $(OEM_APP_PATH)/AndroidManifest.xml LOCAL_PACKAGE_NAME := TimeZoneData$(TIME_ZONE_DATA_APP_SUFFIX) LOCAL_AAPT_FLAGS := --version-code $(TIME_ZONE_DATA_APP_VERSION_CODE) \ - --version-name $(TIME_ZONE_DATA_APP_VERSION_NAME) \ - --min-sdk-version $(PLATFORM_SDK_VERSION) - -# OEM-INSTRUCTION: Modify the name, s/oemcorp// -LOCAL_AAPT_FLAGS += --rename-manifest-package com.oemcorp.android.timezone.data + --version-name $(TIME_ZONE_DATA_APP_VERSION_NAME) # OEM-INSTRUCTION: Modify the name, s/oemcorp// LOCAL_MODULE_OWNER := oemcorp @@ -50,6 +49,4 @@ LOCAL_PRIVILEGED_MODULE := true # OEM-INSTRUCTION: Configure your own certificate. LOCAL_CERTIFICATE := -# If LOCAL_COMPATIBILITY_SUITE is unset this is the same as BUILD_PACKAGE so -# can be used for building test or production packages. -include $(BUILD_CTS_PACKAGE) +include $(BUILD_PACKAGE) diff --git a/oem_template/data_app/testing/build_oem_test_data_app.mk b/oem_template/data_app/testing/build_oem_test_data_app.mk index 4ed18ef..309c726 100644 --- a/oem_template/data_app/testing/build_oem_test_data_app.mk +++ b/oem_template/data_app/testing/build_oem_test_data_app.mk @@ -23,8 +23,4 @@ # OEM_APP_PATH := $(LOCAL_PATH)/.. - -# OEM-INSTRUCTION: Change this to the appropriate test suite(s). -LOCAL_COMPATIBILITY_SUITE := xts - include $(OEM_APP_PATH)/build_oem_data_app.mk diff --git a/oem_template/data_app_prebuilt/Android.mk b/oem_template/data_app_prebuilt/Android.mk new file mode 100644 index 0000000..ab09e4d --- /dev/null +++ b/oem_template/data_app_prebuilt/Android.mk @@ -0,0 +1,24 @@ +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Targets for including the real signed versions of the time zone data app. + +LOCAL_PATH := $(call my-dir) + +# Defines the TimeZoneDataPrebuilt prebuilt target. +include $(CLEAR_VARS) +TIME_ZONE_DATA_APP_SUFFIX := +include $(LOCAL_PATH)/include_app_prebuilt.mk + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/oem_template/data_app_prebuilt/README.oem b/oem_template/data_app_prebuilt/README.oem new file mode 100644 index 0000000..0ce548f --- /dev/null +++ b/oem_template/data_app_prebuilt/README.oem @@ -0,0 +1,21 @@ +This file originates from package/apps/TimeZoneData/oem_template/data_app_prebuilt. + +OEM-INSTRUCTION See below for the purpose of this directory and changes OEMs must make. + +This directory contains a suggested structure for including prebuilt .apks in the +system image and tests. + +For example, you can copy it + +cp -r data_app_prebuilt ${ANDROID_BUILD_TOP}/vendor/oemcorp/apps/TimeZoneDataPrebuilt + +Where is your company name. + +...then read / change all the things marked with OEM-INSTRUCTION. + +The intended use is to include .apk artifacts built using the oem_template/data_app. + +The targets define includes the real version of the app, and some test versions that can be +used by the supplied xTS tests. + +See oem_template/xts for rules that can be used for xTS testing. diff --git a/oem_template/data_app_prebuilt/include_app_prebuilt.mk b/oem_template/data_app_prebuilt/include_app_prebuilt.mk new file mode 100644 index 0000000..f4c6be9 --- /dev/null +++ b/oem_template/data_app_prebuilt/include_app_prebuilt.mk @@ -0,0 +1,40 @@ +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# An .mk include file that contains the boilerplate needed to include real and +# test, OEM-specific Time Zone Data app prebuilts. +# +# Users should set: +# TIME_ZONE_DATA_APP_SUFFIX - the suffix to apply to the package name. Can be +# empty, or contain things like _test1 for test .apk files. +# LOCAL_COMPATIBILITY_SUITE - if the package is to be included in xTS tests. +# + +LOCAL_MODULE := TimeZoneDataPrebuilt$(TIME_ZONE_DATA_APP_SUFFIX) +LOCAL_SRC_FILES := TimeZoneData$(TIME_ZONE_DATA_APP_SUFFIX).apk +LOCAL_OVERRIDES_PACKAGES := TimeZoneData$(TIME_ZONE_DATA_APP_SUFFIX) +LOCAL_MODULE_TAGS := optional + +# OEM-INSTRUCTION: Change this +LOCAL_MODULE_OWNER := oemcorp +LOCAL_PRIVILEGED_MODULE := true + +LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) +LOCAL_MODULE_CLASS := APPS +# OEM-INSTRUCTION: Change this to match your app-specific signing certificate. +LOCAL_CERTIFICATE := + +# If LOCAL_COMPATIBILITY_SUITE is set this also copies the APK to the appropriate xTS directory +# and so this .mk can be used for prod and test targets. +include $(BUILD_PREBUILT) diff --git a/oem_template/data_app_prebuilt/testing/Android.mk b/oem_template/data_app_prebuilt/testing/Android.mk new file mode 100644 index 0000000..9096088 --- /dev/null +++ b/oem_template/data_app_prebuilt/testing/Android.mk @@ -0,0 +1,26 @@ +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Targets for including testing versions of the time zone data app needed +# by xTS tests. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +TIME_ZONE_DATA_APP_SUFFIX := _test1 +include $(LOCAL_PATH)/include_test_prebuilt.mk + +include $(CLEAR_VARS) +TIME_ZONE_DATA_APP_SUFFIX := _test2 +include $(LOCAL_PATH)/include_test_prebuilt.mk diff --git a/oem_template/data_app_prebuilt/testing/include_test_prebuilt.mk b/oem_template/data_app_prebuilt/testing/include_test_prebuilt.mk new file mode 100644 index 0000000..b3b5b7c --- /dev/null +++ b/oem_template/data_app_prebuilt/testing/include_test_prebuilt.mk @@ -0,0 +1,37 @@ +# Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# An .mk include file that contains the boilerplate needed to include test, +# OEM-specific Time Zone Data app prebuilts. +# +# Users should set: +# TIME_ZONE_DATA_APP_SUFFIX - the suffix to apply to the package name. +# Should contain things like _test1 for test .apk files. +# + +PREBUILT_PATH := $(LOCAL_PATH)/.. + +# Turn off pre-opting. We want these to be installable. +LOCAL_DEX_PREOPT := false + +# OEM-INSTRUCTION: Change this to match your OEM-specific test suite. +# If a value is here the .apk will automatically be included in the associated +# test suite build, e.g. if there is an oem-specific tradefed suite called "OTS", +# then put ots here. +# Required for the xTS TimeZoneUpdateHostTest to pass because it needs correctly +# signed OEM-specific apks available to work. +LOCAL_COMPATIBILITY_SUITE := + +include $(PREBUILT_PATH)/include_app_prebuilt.mk + diff --git a/oem_template/xts/AndroidTest.xml b/oem_template/xts/AndroidTest.xml index 1ef5206..cd86156 100644 --- a/oem_template/xts/AndroidTest.xml +++ b/oem_template/xts/AndroidTest.xml @@ -20,6 +20,12 @@