Rockchip_User_Guide_Android_GMS_Configuration_EN
Rockchip_User_Guide_Android_GMS_Configuration_EN
Rockchip_Android_GMS_Configuration_G
uide
[ √ ] Released
Finish Date: 2021-03-29
[ ] Modifying
Auditor: Chen Haiyan
Version Revision
Author Revision Description Remark
no. Date
Bian 2020-02-
V1.0 Initial version release
Jinchen 10
Bian 2020-06-
V1.1 Add some description for user build
Jinchen 30
Bian 2021-02-
V1.2 Add support for Android 11
Jinchen 22
If there is any question about the document, please send email to: [email protected]
Terminology
GMS (Google Mobile Service)
Google Mobile Service, including Google service framework, Play Store, Chrome browser and
other applications.
3PL
The third party lab, it will assist Google to do the product certification in different regions of
the world according to Google CDD requirements and GMS Requirments. There are some
famous labs such as Foxconn/Haman/Windriver/Pegatron and so on. Customers can contact
the lab by themselves, or ask sales to introduce.
Google Partner/MADA (Mobile Application Distribution Agreement)
After signing MADA with Google, customers can access Google Partner document and
contact with 3PL to do GMS test and certification.
EEA (European Economic Area)
Device sold to EU countries needs to pass the GMS certification of the EEA, and the EEA type
configured in the code needs to be configured for different situations and signed
agreements. For instructions on EEA, please refer to the Google Partner documentation:
https://support.google.com/androidpartners_gms/answer/9071728?hl=en
xTS
After executing the binary in the corresponding directory, you will enter the xTS-tradefed
command line, and then execute the following test command or retry command.
:
Please refer to https://source.android.com/compatibility/cts/run
retry
It means to continue the test based on the existing results. After entering the tradefed,
execute l r to view the previous test results. The first column is session id , and the
parameter --retry when executing retry session_id to continue testing the specified
result.
Single test
Refer to test certain test items separately for debugging. After the test, test results and logs
are generated, which are located in the results and logs directories respectively.
lunch rk3326_rgo-user
device/rockchip/rk3326/BoardConfig.mk
PRODUCT_UBOOT_CONFIG := px30
Please download the regular GMS bundle directly from the following website, unzip it and
put it as vendor/partner_gms :
https://docs.partner.android.com/gms/building/integrating/gms-download
Please download the mainline package from the Google Drive. Android 11 does not have a
packaged compressed package, only the documentation, you need to use the repo to
synchronize:
https://drive.google.com/drive/folders/1gxxMalTC99Y2SvyRDUfiDFvY_k4OzjO5
For example:
Download a specified version (GTS requires the latest approved version), open and find the
Release Summary from latest approved document, for example: Git tag
mainline_m_2020_dec_preload_5 . Make changes on the manifest:
diff --git a/default.xml b/default.xml
index 7be1f37..01ccba9 100644
--- a/default.xml
+++ b/default.xml
@@ -4,7 +4,7 @@
<remote name="ohd"
fetch=".."
review="https://partner-android-review.googlesource.com/" />
- <default revision="r-aml-prebuilt-release"
+ <default revision="refs/tags/mainline_m_2020_dec_preload_5"
remote="ohd" />
1. Widevine
Note that only RK3288 and RK3399 already support Widevine L1. For tablet devices without
a radio, generally Widevine L3 can meet the requirements.
BOARD_WIDEVINE_OEMCRYPTO_LEVEL := 3
2. EEA, Change these macros only if the device is equipped with EEA
BUILD_WITH_EEA := true
BUILD_WITH_EEA_TYPE := type1 (Please config according to your EEA type)
PRODUCT_HAVE_OPTEE := true
5. Hardware Features
Please double check with your hardware and kernel driver colleagues the hardware
supported by the device. If it is not supported (such as gyroscope, BLE, etc.), you must
remove it from the software. It can be controlled by the following macros. If there is no
macro, please go to frameworks/native/data/etc/ and delete the corresponding feature.xml:
BOARD_GRAVITY_SENSOR_SUPPORT := true
BOARD_COMPASS_SENSOR_SUPPORT := true
BOARD_BLUETOOTH_LE_SUPPORT := false
BUILD_WITH_GOOGLE_FRP := true
BOARD_AVB_ENABLE := true
To facilitate development and debugging, the SDK will not open AVB by default, nor will it lock the
bootloader. This will result in the failure to show that the certification has been made after
passing the GMS certification. Before mass production, please ensure that the following patches
are incorporated in uboot to ensure that the bootloader can be locked at the same time when
the certification key is written and the certification is displayed normally.
RKDocs/android/patches/gms/0001-libavb-Lock-the-device-when-the-device-init-
or-write.patch
BOARD_USES_AB_IMAGE := true
BOARD_ROCKCHIP_VIRTUAL_AB_ENABLE := true
Uboot also needs to enable A/B when enabling Virtual A/B, for example on RK3566/RK3568:
device/rockchip/common/BoardConfig.mk:
BOARD_SELINUX_ENFORCING ?= true
build/make:
core/version_defaults.mk
PLATFORM_SECURITY_PATCH := 2020-03-05
If you want to apply for a keybox, please provide the following material (for the specific
requirements, consult with 3pl):
Safety mode
Press and hold Volume- during the boot animation or Hold the restart icon when
restarting , then it will enter safety mode.
Lockdown mode
Host configuration
You need to use Ubuntu and configure java, Python, adb, fastboot, aapt environment yourself.
It is recommended to use Android_O_cts_env.tar.gz in RK-FTP, and configure environment
variables after decompression:
In Ubuntu, you can add the following content to ~/.bashrc or edit the
following into a file such as env, then source env before testing:
export JAVA_HOME=/home/Your_Name/Software/jdk1.8.0_77
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
export PATH=/home/Your_Name/Software/android-sdk-linux/tools:$PATH
export PATH=/home/Your_Name/Software/android-sdk-linux/platform-tools:$PATH
export PATH=/home/Your_Name/Software/android-sdk-linux/build-
tools/19.0.0:$PATH
After configuration, please follow the method in the Q&A below to upgrade adb and
fastboot tools
If aapt is not available, please install the C ++ compatible library:
4. If you are using python3, you may need to install the following separately:
Q&A
1. Fail to create virtual environment
If the virtual environment cannot be created when the VTS test fails, you can try to force pip
to pip2 and install virtualenv through pip:
Run VTS/CTS-on-GSI
According to Google Docs, you should lock/unlock the device when:
https://docs.partner.android.com/gms/testing/vts/treble-compliance?hl=en#sample-test-flor-with
out-dsu
CTS: Lock the device and run CTS on the original system image.
CTS-on-GSI: Unlock the device, flash the GSI, lock the device and run CTS-on-GSI.
VTS: Unlock the device, flash boot-debug and GSI, run VTS on the GSI.
Note:
In the case of CTS-on-GSI, you MUST ensure that the GSI is the -signed version, and the
security patch level of the GSI must be equal to or higher than the security patch level of the
SDK(vendor), otherwise the system will be unable to startup after the device is locked!
Note:
When Android 11 tests CTS or CTS-on-GSI, MUST be sure to lock the device as described
above. Otherwise, the following fail cases will be generated:
CtsKeystoreTestCases
android.keystore.cts.KeyAttestationTest#testEcAttestation
android.keystore.cts.KeyAttestationTest#testRsaAttestation
android.keystore.cts.KeyAttestationTest#testEcAttestation_DeviceLocked
android.keystore.cts.KeyAttestationTest#testRsaAttestation_DeviceLocked
VTS
Requires additional programming of GSI (i.e. system-xxx-signed.img of AOSP, available from
Google official website/3PL or Rockchip security patch FTP, using signed image) and boot-
debug.img (packaged firmware will be packaged after AVB is enabled in rockdev/Image-xxx).
Please refer to the fastboot section of the SDK documentation for the programming method:
Rockchip_Developer_Guide_Android11_SDK_V1.0.0_EN.pdf
Or refer to the Google Partner documentation:
https://support.google.com/androidpartners_gms/answer/9380762?hl=en
Test Retry
Test Suite Single Test Command
Command Command
android-vts-xxx- run vts -- run vts -m module_name -t
Test
run vts Retry
arm_64.zip
Test Suite retry 0 Single Test Command
case_name
Command Command
CTS-ON-GSI
Need to flash GSI (ie AOSP's system-xxx-signed.img, which can be obtained from Google's official
website/3PL or Rockchip security patch FTP, using a signed image). The flashing method is the
same as above.
Test Retry
Test Suite Single Test Command
Command Command
CTS
Use the fully compiled user firmware for testing. Please check and configure the firmware
configuration as described in the document.
Test Retry
Test Suite Single Test Command
Command Command
CTS-Verifier
Use the fully compiled user firmware for testing. Please check and configure the firmware
configuration as described in the document.
android-cts-verifier-10_xx-
manual manual manual
linux_x86-arm.zip
Run the following command prior to installing the CTS Verifier to allow access to non-SDK
interfaces.
Download the CTS Verifier APK for the version of Android to test. Connect the DUT to the
Linux computer. From a terminal of the Linux computer, install CtsVerifier.apk on the DUT.
For Android 11 and higher, run the following command to allow reports to be saved in a self-
defined directory under the device's external top-level directory.
Ensure that the system data and time of the DUT are set correctly.
GTS
Use the fully compiled user firmware for testing. Please check and configure the firmware
configuration as described in the document. Before testing, be sure to confirm the host
environment and whether the gts key is configured or not. You can check it through echo $
APE_API_KEY .
$ vi .bashrc
export APE_API_KEY=/path/to/key.json
Test
Test Suite Retry Command Single Test Command
Command
STS
Use the fully compiled userdebug firmware for testing. Please check and configure the firmware
configuration as described in the document. For the details about dealing with the fail items,
please refer to the SDK documentation Rockchip_Introduction_Android_Security_Patch.pdf
Test
Test Suite Retry Command Single Test Command
Command
config ROCKCHIP_RGA2
BTS
Since April 1, 2018, all devices that have been GMS certified must undergo Android BTS (Build
Test Suite) testing. For details, see:
Google Partner documentation :
https://support.google.com/androidpartners_gms/answer/9027630?hl=en
When uploading firmware to Google, Do not upload the packaged update.img , otherwise
Google will not be able to parse the image. For details, please check the documentation and ask
3pl. The BTS packaging method suggested by RK is: put the following images into the folder
named fingerprint (all ":", "/" are changed to "~"), and then compress it to zip format.
rockchip~rk3326_qgo~rk3326_qgo~10~QD1A.190821.014.C2~201911~user~release-keys$
ls
boot-debug.img boot.img dtbo.img misc.img recovery.img super.img
vbmeta.img
About PHA: Some customers have once passed all GMS tests, but finally were rejected because
PHA (potential harmful applications) was detected in the BTS. According to the security meeting
at the Google Hong Kong Summit, you can first upload the app that needs to be preset to Google
Play to perform the test, and specifically consults with 3PL or TAM to avoid similar situations in
BTS.
GMS Express
In order to establish a good Android ecosystem, so that all Andrid devices in the market can
timely apply the security update released by Google monthly, Google launched the GMS Express
Program.
Rockchip full range of Android 11.0 tablet platforms will support GMS Express. As shown in the
following table, this document introduces Rockchip GMS Express technology related contents.
Soc Platforms Go GMS Express Regular Express
1. Precautions
1. Customers using Rockchip GMS Express Basline must ensure that they have signed a MADA
agreement with Google. If they integrate Android Go, they must ensure that they have Go's
supplementary MADA, otherwise all legal risks will be taken by themselves.
2. The Rockchip GMS Express baseline will be continuously updated every month (including
security updates, GMS bundle updates, and AOSP important patches provided by Google,
etc.) as required by Google. It will be officially released after the monthly baseline is
available, so make sure to catch up with the update and push the update to the end user by
OTA. If it is not updated in time, our company will not provide GMS related technical
support.
# For Android 11
repo init -m Android11_Express.xml
# Android 11
repo init --repo-url=ssh://[email protected]:2222/repo-
release/tools/repo.git -u
ssh://[email protected]:2222/Android_R/manifests.git -m
Android11_Express.xml
2. Please ensure the following configuration is enabled in the Makefile of the product directory:
BUILD_WITH_GOOGLE_GMS_EXPRESS := true
After this macro configuration is opened, we do not preset any RK applications, you need to
add it by yourself. After compilation, the com.google.android.feature.GMSEXPRESS_BUILD flag
will be configured by default. Our baseline meets Express Plus Claim.
Google encourages Express Plus products to receive relevant subsidy support after passing GMS
certification. Please consult with 3PL for more details. After the secondary development of a
specific project, please refer to the following document to confirm whether it meets the
requirements of Express Plus or not. If yes, modify the following files:
vendor/rockchip/common/gms-express.xml
patch/frameworks/base/increase_waiting_time_for_setup_wizard.diff
patches/gms/0001-libavb-Lock-the-device-when-the-device-init-or-write.patch