最近有客户需要在Android添加谷歌框架,但是GSMcore经常弹出一个窗口,
无法使用位置信息
所有应用的设备位置信息均已关闭。万一您的设备丢失,您可能无法定位设备。
网上找了一些资料,说是要添加NetworkLocation.apk.
比如:
手机定位折腾记(1):安卓手机的网络定位与NetworkLocation.apk
【android】网络定位服务NetworkLocationProvider
于是,满世界的找NetworkLocation.apk,终于在github上觅到了它的身影
android_packages_apps_UnifiedNlp
将它push到板子的system/priv-app下以后GSM还是无法定位。
随后注意到一句话:
Make sure that no Google geolocation tool is installed (it is usually listed as Google Play Services in Apps)
好吧,看起来GSM自己有定位功能,把它加进去:
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index ee626d6..2156b81 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -777,6 +777,7 @@
<string-array name="config_locationProviderPackageNames" translatable="false">
<!-- The standard AOSP fused location provider -->
<item>com.google.android.location</item>
+ <item>com.google.android.gms</item>
<item>com.android.location.fused</item>
</string-array>
OK,搞定!