Android GMS無法通過網路定位

來源:互聯網
上載者:User

 

 

預置KK GMS後,開啟系統定位功能,Google Maps等應用無法通過網路定位 有兩個部分需要確認: 1.系統對提供LocationProvider的應用需要進行申明,而KK GMS將NetworkLocation應用的功能整合到了GmsCore(Google Play Service)中,所以需要添加GmsCore的packageName進去:

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

com.android.location.fused

com.google.android.location

com.google.android.gms

 

 

2.GMS4.4_r3(包含r3)之後版本在滿足1條件下依然可能存在無法使用網路定位功能,請繼續按照如下修改操作:

請在alpsexternalwpa_supplicant_8wpa_supplicantss.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);
}

如果是編譯模組進行驗證,請先執行./mk &project_name mm external/wpa_supplicant_8/wpa_supplicant
將alps/out/target/product/project_name/system/bin/wpa_supplicant push到system/bin/下,再執行命令
adb shell chmod 755 system/bin/wpa_supplicant
重啟系統後驗證

謝謝!


 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.