[高通SDM450][Android9.0]CTA认证--去除某些应用开机使用定位权限

文章目录

    • 开发平台基本信息
    • 问题描述
    • 解决方法

开发平台基本信息

芯片: SDM450
版本: Android 9.0
kernel: msm-4.9

问题描述

设备在进行入网认证,实验室在测试的时候,发现有应用会在开机启动的时候,使用定位功能,而实验室要求应用使用权限之前,需要先向用户申请,所以,要求整改去掉应用默认使用定位权限。

解决方法

diff --git a/frameworks/base/services/core/java/com/android/server/SensorNotificationService.java b/frameworks/base/services/core/java/com/android/server/SensorNotificationService.java
index 7f5befa..f5126a6 100644
--- a/frameworks/base/services/core/java/com/android/server/SensorNotificationService.java
+++ b/frameworks/base/services/core/java/com/android/server/SensorNotificationService.java
@@ -88,12 +88,14 @@ public class SensorNotificationService extends SystemService
             if (mLocationManager == null) {
                 if (DBG) Slog.d(TAG, "Cannot obtain location service.");
             } else {
-                mLocationManager.requestLocationUpdates(
-                        LocationManager.PASSIVE_PROVIDER,
-                        LOCATION_MIN_TIME,
-                        LOCATION_MIN_DISTANCE,
-                        this);
-            }
+                /** cta disable  auto location 
+                  mLocationManager.requestLocationUpdates(
+                  LocationManager.PASSIVE_PROVIDER,
+                  LOCATION_MIN_TIME,
+                  LOCATION_MIN_DISTANCE,
+                  this);
+                 **/    
+        }
         }
     }
 
diff --git a/frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java b/frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
index 44e4246..35b7678 100644
--- a/frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -2459,10 +2459,12 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt
             // 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());
+            /**
+              locManager.requestLocationUpdates(
+              request,
+              new NetworkLocationListener(),
+              getLooper());
+             **/
         }
     }
 
diff --git a/vendor/qcom/proprietary/commonsys/gps/framework/Android.mk b/vendor/qcom/proprietary/commonsys/gps/framework/Android.mk
index f87fb36..f4ef9ec 100755
--- a/vendor/qcom/proprietary/commonsys/gps/framework/Android.mk
+++ b/vendor/qcom/proprietary/commonsys/gps/framework/Android.mk
@@ -30,7 +30,9 @@ LOCAL_PROGUARD_ENABLED := disabled
 LOCAL_CERTIFICATE := platform
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
+ifdef 0
 include $(BUILD_PACKAGE)
+endif
 
 ######## Copy permissions for com.qualcomm.location
 include $(CLEAR_VARS)

你可能感兴趣的:(Android9.0,CTA认证-A9,framework,Android9.0,CTA,入网认证,定位权限)