问题描述
GtsNmgiarcTestCases
com.google.android.comms.MessagesTests#testMessagesInstalledCorrectly
Fail:java.lang.AssertionError: CS should be default IMS handle
com.google.android.comms.MessagesTests#testMessagesInstalledCorrectly
Fail:java.lang.AssertionError: CS should be default IMS handle
解决方案
测试时,需要读取carrierConfig中的 config_ims_package_override_string,读取不到,就会fail。
此字符串是在/vendor/mediatek/proprietary/packages/apps/CarrierConfig/res/xml/vendor.xml中设定。
正解应该在/vendor/mediatek/proprietary/packages/apps/CarrierConfig/res/xml/vendor.xml中添加:
此字符串是在/vendor/mediatek/proprietary/packages/apps/CarrierConfig/res/xml/vendor.xml中设定。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
public boolean testIsMessagesDefaultIms() throws Exception { initialize(); boolean bool2 = DeviceUtil.packageExists(getContext(), "com.google.android.ims", "C2:5D:5A:FA:CB:67:83:10:9D:61:36:D7:93:53:FA:D4:F6:54:1C:35:45:D2:52:28:A1:87:03:D0:43:CA:78:3F"); boolean bool1 = false; if (bool2) { if (!ApiLevelUtil.isAtLeast(26)) { return true; } CarrierConfigManager localCarrierConfigManager = (CarrierConfigManager)getContext().getSystemService("carrier_config"); if (localCarrierConfigManager != null) { bool1 = true; } Assert.assertTrue("Could not get the carrier config manager.", bool1); return "com.google.android.ims".equals(localCarrierConfigManager.getConfig().getString("config_ims_package_override_string")); } return false; } @Test public void testMessagesInstalledCorrectly() throws Exception { initialize(); if (testIsMessagesPresent()) { Assert.assertTrue("AM is not a system app", testIsMessagesSystemApp()); Assert.assertTrue("CS is not present", testIsMessagesCSPresent()); Assert.assertTrue("CS is not a system app", testIsMessagesCSSystemApp()); Assert.assertTrue("Missing required permission for CS", testIsMessagesCSRequiredPermission()); Assert.assertTrue("CS is not doze mode exempt!", testIsMessagesCSDozeExempted()); if (testIsMessagesDefaultSms()) { Assert.assertTrue("CS should be default IMS handler", testIsMessagesDefaultIms()); } } } |
正解应该在/vendor/mediatek/proprietary/packages/apps/CarrierConfig/res/xml/vendor.xml中添加:
<carrier_config>
<string name="config_ims_package_override_string">com.google.android.ims</string>
</carrier_config>
<string name="config_ims_package_override_string">com.google.android.ims</string>
</carrier_config>