需求
安卓8设备过CTA认证,不能不请求就获取定位。
frameworks
diff --git a/base/services/core/java/com/android/server/SensorNotificationService.java b/base/services/core/java/com/android/server/SensorNotificationService.java
index 7f5befab..5d1b522f 100644
--- a/base/services/core/java/com/android/server/SensorNotificationService.java
+++ b/base/services/core/java/com/android/server/SensorNotificationService.java
@@ -88,11 +88,13 @@ public class SensorNotificationService extends SystemServiceif (mLocationManager == null) {if (DBG) Slog.d(TAG, "Cannot obtain location service.");} else {
+ /* cta认证,去掉应用默认使用定位权限mLocationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER,LOCATION_MIN_TIME,LOCATION_MIN_DISTANCE,this);
+ */}}}diff --git a/base/services/core/java/com/android/server/location/GnssLocationProvider.java b/base/services/core/java/com/android/server/location/GnssLocationProvider.java
index ea1861c1..b33a9cbc 100644
--- a/base/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/base/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -2480,10 +2480,12 @@ public class GnssLocationProvider implements LocationProviderInterface {// Don't keep track of this request since it's done on behalf of other clients// (which are kept track of separately).request.setHideFromAppOps(true);
+ /*locManager.requestLocationUpdates(request,new NetworkLocationListener(),getLooper());
+ */}}
作者:帅得不敢出门 谢绝转载