Android4.4 CTS test Fail Item Modification Summary (i)

Source: Internet
Author: User

1. Test Android.webkit.cts.GeolocationTest Fail

Tips:

CTS-TF > Run CTS--class android.webkit.cts.geolocationtest12-13 16:55:23 i/testinvocation:starting invocation for ' C TS ' on Build ' 4.4_R3 ' on device 385b4e4a12-13 16:55:23 i/385b4e4a:created result dir 2014.12.13_16.55.2312-13 16:55:34 I/ 385b4e4a:collecting device info12-13 16:55:35 i/385b4e4a:-----------------------------------------12-13 16:55:35 i/ 385b4e4a:test Package Android.webkit started12-13 16:55:35 i/385b4e4a:----------------------------------------- 12-13 16:55:38 i/385b4e4a:android.webkit.cts.geolocationtest#testgeolocationpermissions FAIL Java.lang.SecurityException:Requires access_mock_location Secure Settingat android.os.Parcel.readException ( parcel.java:1480) at Android.os.Parcel.readException (parcel.java:1429) at android.location.ilocationmanager$stub$ Proxy.addtestprovider (ilocationmanager.java:944) at Android.location.LocationManager.addTestProvider ( locationmanager.java:1205) at Android.webkit.cts.GeolocationTest.addTestProviders (geolocationtest.java:188) at AndroId.webkit.cts.GeolocationTest.setUp (geolocationtest.java:166) at Android.test.AndroidTestRunner.runTest ( androidtestrunner.java:191) at Android.test.AndroidTestRunner.runTest (androidtestrunner.java:176) at Android.test.InstrumentationTestRunner.onStart (instrumentationtestrunner.java:554) at Android.app.instrumentation$instrumentationthread.run (instrumentation.java:1701)
Prompt does not have the relevant permissions

<uses-permission android:name= "Android.permission.ACCESS_MOCK_LOCATION"/>
If the "Allow analog location" switch is not turned on in the developer options, the default value for this switch is/frameworks/base/packages/settingsprovider/src/com/android/, even if it is added. setting in Providers/settings/databasehelper.java

Allow mocks locations default, based on Build            loadsetting (stmt, Settings.Secure.ALLOW_MOCK_LOCATION,                    "1"). Equals (Systemproperties.get ("Ro.allow.mock.location"))? 1:0);
The value of Ro.allow.mock.location is set in the following configuration file

Files are located in:/build/core.main.mk

# # User/userdebug # #user_variant: = $ (Filter user userdebug,$ (target_build_variant)) Enable_target_debugging: =  Truetags_to_install: =ifneq (, $ (user_variant)) # Target is secure in user builds. Additional_default_properties + = Ro.secure=1 ifeq ($ (user_variant), Userdebug) # Pick up some extra useful tools tag    S_to_install + = Debug # Enable Dalvik lock contention logging for Userdebug builds.    Additional_build_properties + = dalvik.vm.lockprof.threshold=500 Else # Disable debugging in plain user builds. Enable_target_debugging: = endif # Turn on Dalvik preoptimization for libdvm.so user builds, but only if not # explicit  Ly disabled and the build is running on Linux (since host # Dalvik isn ' t built for Non-linux hosts). Ifeq (, $ (with_dexpreopt)) ifeq ($ (dalvik_vm_lib), libdvm.so) ifeq ($ (user_variant), user) Ifeq ($ (host_os), Li Nux) With_dexpreopt: = True endif endif endif endif # Disallow mock locations by default for use R BuilDS Additional_default_properties + = ro.allow.mock.location=0else #!user_variant # Turn on Checkjni for Non-user builds.  Additional_build_properties + = ro.kernel.android.checkjni=1 # Set device insecure for Non-user builds. Additional_default_properties + = ro.secure=0 # allow mock locations by DEFAULT for non user builds ADDITIONAL_DEFAULT_PR Operties + = ro.allow.mock.location=1endif #!user_variant
Of course there are two ways to modify this CTS fail

1. Modify the Databasehelper.java file

Loadsetting (stmt, Settings.Secure.ALLOW_MOCK_LOCATION, 1);

2. Modify the Main.mk file

# Disallow mock locations By default for user builds  additional_default_properties + = Ro.allow.mock.location=1
If you need to verify that you can manually open


Android4.4 CTS test Fail Item Modification Summary (i)

Related Article

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.