Fingerprint CtsOsTestCases fail

生成 build_fingerprint.txt

build/core/Makefile


134# The string used to uniquely identify the combined build and product; used by the OTA server.
135ifeq (,$(strip $(BUILD_FINGERPRINT)))
136  ifneq ($(filter eng.%,$(BUILD_NUMBER)),)
137    # Trim down BUILD_FINGERPRINT: the default BUILD_NUMBER makes it easily exceed
138    # the Android system property length limit (PROPERTY_VALUE_MAX=92).
139    BF_BUILD_NUMBER := $(shell echo $${USER:0:6})$(shell $(DATE) +%m%d%H%M)
140  else
141    BF_BUILD_NUMBER := $(BUILD_NUMBER)
142  endif
143  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
144endif
145ifneq ($(words $(BUILD_FINGERPRINT)),1)
146  $(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
147endif
148
149$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) > $(PRODUCT_OUT)/build_fingerprint.txt)
150BUILD_FINGERPRINT_FROM_FILE := $$(cat $(PRODUCT_OUT)/build_fingerprint.txt)

build/tools/buildinfo.sh
59echo "ro.build.fingerprint=$BUILD_FINGERPRINT"

frameworks/base/core/java/android/os/Build.java
863    private static String deriveFingerprint() {
864        String finger = SystemProperties.get("ro.build.fingerprint");
865        if (TextUtils.isEmpty(finger)) {
866            finger = getString("ro.product.brand") + '/' +
867                    getString("ro.product.name") + '/' +
868                    getString("ro.product.device") + ':' +
869                    getString("ro.build.version.release") + '/' +
870                    getString("ro.build.id") + '/' +
871                    getString("ro.build.version.incremental") + ':' +
872                    getString("ro.build.type") + '/' +
873                    getString("ro.build.tags");
874        }
875        return finger;
876    }
885    public static void ensureFingerprintProperty() {
886        if (TextUtils.isEmpty(SystemProperties.get("ro.build.fingerprint"))) {
887            try {
888                SystemProperties.set("ro.build.fingerprint", FINGERPRINT);
889            } catch (IllegalArgumentException e) {
890                Slog.e(TAG, "Failed to set fingerprint property", e);
891            }
892        }
893    }

 
最后在
cts/tests/tests/os/src/android/os/cts/BuildVersionTest.java 中,由于字串匹配失败,所以报错。
 
 

134# The string used to uniquely identify the combined build and product; used by the OTA server.
135ifeq (,$(strip $(BUILD_FINGERPRINT)))
136  ifneq ($(filter eng.%,$(BUILD_NUMBER)),)
137    # Trim down BUILD_FINGERPRINT: the default BUILD_NUMBER makes it easily exceed
138    # the Android system property length limit (PROPERTY_VALUE_MAX=92).
139    BF_BUILD_NUMBER := $(shell echo $${USER:0:6})$(shell $(DATE) +%m%d%H%M)
140  else
141    BF_BUILD_NUMBER := $(BUILD_NUMBER)
142  endif
143  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
144endif
145ifneq ($(words $(BUILD_FINGERPRINT)),1)
146  $(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
147endif
148
149$(shell mkdir -p $(PRODUCT_OUT) && echo $(BUILD_FINGERPRINT) > $(PRODUCT_OUT)/build_fingerprint.txt)
150BUILD_FINGERPRINT_FROM_FILE := $$(cat $(PRODUCT_OUT)/build_fingerprint.txt)
151
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值