A problem occurred while running cts. The record is as follows:
Error declaration:
JUnit. framework. assertionfailederror: packagemanager # hassystemfeature (Android. hardware. sensor. compass) returns false but sensormanager # getsensorlist (2) shows sensors [xxxx 3-axis magnetic field sensor] expected: <false> but was: <true>
At Android. App. CTS. systemfeaturestest. assertfeatureforsensor (systemfeaturestest. Java: 300)
Solution:
Add file: Android. Hardware. sensor. Compass. xml
<? XML version = "1.0" encoding = "UTF-8"?>
<! -- Copyright (c) 2009 the android open source project
Licensed under the Apache license, version 2.0 (the "License ");
You may not use this file before t in compliance with the license.
You may obtain a copy of the license
Http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
Distributed under the license is distributed on an "as is" basis,
Without warranties or conditions of any kind, either express or implied.
See the license for the specific language governing permissions and
Limitations under the license.
-->
<! -- Feature for devices with an ambient light sensor. -->
<Permissions>
<Feature name = "android. Hardware. sensor. Compass"/>
</Permissions>
Then, run CTS and find that the Fail can pass.
Have fun!