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 \