Android GMS cannot be positioned over the network

Source: Internet
Author: User

Objective
welcome everyone I share and recommend useful code Snippets ~ ~
Statement
Welcome reprint, but please keep the original source of the article:
CSDN:
http://www.csdn.net
rainy season o mo away:http://blog.csdn.net/luckkof

Body

after the KK GMs is provisioned, the system positioning function is turned on, and apps such as Google Maps can't be located on the networkthere are two parts to confirm:1.system to provide Locationprovider application needs to be affirmed,The KK GMs integrates the functionality of the NetworkLocation application into the Gmscore (Google Play Service), so you need to add Gmscore PackageName in:

Framework/base/core/res/res/values/config.xml

<string-array name= "Config_locationproviderpackagenames" translatable= "false" >

<!--the standard AOSP fused location provider-

<item>com.android.location.fused</item>

<!--MTK Add for GMS--

<item>com.google.android.location</item>

<item>com.google.android.gms</item>

<!--MTK Add end--

</string-array>

2.GMS4.4_R3 (contains R3) after the version can still exist under 1 conditions can not use the network location function, please continue to follow the following modifications:

Please modify the following function in the ALPS\EXTERNAL\WPA_SUPPLICANT_8\WPA_SUPPLICANT\BSS.C

static void Wpa_bss_copy_res ( struct WPA_BSS *dst, struct wpa_scan_res *src,
        struct os_time *fetch_ Time)
{
    struct timespec ts;//add this line;
    dst->flags = src->flags;
    os_memcpy (Dst->bssid, Src->bssid, Eth_alen);
    dst->freq = src->freq;
    dst->beacon_int = src->beacon_int;
    dst->caps = src->caps;
    dst->qual = src->qual;
    dst->noise = src->noise;
    dst->level = src->level;
   /* DST->TSF = src->tsf;*///delete this line

Add below Code
if (Clock_gettime (Clock_monotonic, &ts)! = 0)
DST->TSF = src->tsf;
Else
DST->TSF = ts.tv_sec*1000000 + ts.tv_nsec/1000;
End
Calculate_update_time (Fetch_time, Src->age, &dst->last_update);
}

If you are compiling the module for validation, do so first./MK &project_name mm External/wpa_supplicant_8/wpa_supplicant
Push the alps/out/target/product/project_name/system/bin/wpa_supplicant to system/bin/and execute the command
ADB shell chmod 755 system/bin/wpa_supplicant
Verify after rebooting the system

Thank you!

 

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.