CTS: testsensorfeatures fail Solution

Source: Internet
Author: User

The error is as follows:

-- Testsensorfeatures Fail JUnit. framework. assertionfailederror: packagemanager # hassystemfeature (Android. hardware. sensor. gyroscope) returns false but sensormanager # getsensorlist (4) shows sensors [MPL gyroscope, MPL raw gyroscope, corrected gyroscope sensor] expected: <false>
But was: <true> at Android. App. CTS. systemfeaturestest. assertfeatureforsensor (systemfeaturestest. Java: 300)

Analysis: This sensor (Gyroscope) is actually supported in hardware and software ). Only CTS reports an error. It seems that there should be a matching problem somewhere.

After a while, you will understand.

The/system/etc/permissions/directory must contain XML files corresponding to these hardware. The CTS test checks whether the sensor list matches this file based on these files.

The above error is because the gyroscope file is not found in the/system/etc/permissions/directory, but this sensor exists in the sensor list. So an error is reported!

Solution: Since this sensor exists, add the XML file corresponding to this sensor to/system/etc/permissions.

These files are in frameworks/native/data/etc. You only need to add this copy action to the base. mk file.

Diff -- git a/aaxxxxbb/base. mk B/aaxxxxbb/base. mk
Index 77cc195 .. 0157f0e 100755
--- A/aaxxxxbb/base. mk
++ B/aaxxxxbb/base. mk
@-117,6 + 117,7 @ product_copy_files: = \
Frameworks/native/data/etc/Android. Hardware. sensor. Proximity. xml: System/etc/permissions/Android. Hardware. sensor. Proximity. xml \
Frameworks/native/data/etc/Android. Hardware. sensor. Accelerometer. xml: System/etc/permissions/Android. Hardware. sensor. Accelerometer. xml \
Frameworks/native/data/etc/Android. Hardware. sensor. Compass. xml: System/etc/permissions/Android. Hardware. sensor. Compass. xml \
+ Frameworks/native/data/etc/Android. Hardware. sensor. gyroscope. xml: System/etc/permissions/Android. Hardware. sensor. gyroscope. xml \
Frameworks/native/data/etc/Android. Hardware. touchscreen. multitouch. xml: System/etc/permissions/Android. Hardware. touchscreen. multitouch. xml \
Frameworks/native/data/etc/Android. Hardware. touchscreen. xml: System/etc/permissions/Android. Hardware. touchscreen. xml \
Frameworks/native/data/etc/Android. Hardware. telephony. GSM. xml: System/etc/permissions/Android. Hardware. telephony. GSM. xml \

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.