From c7f7a636e55d4f2acbbc7f5f6b85c4f1d3b69cac Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 16 Apr 2020 18:30:14 -0700 Subject: WifiServiceImpl: Always Use enforceCallingOrSelfPermission Bug: 154276058 Test: atest com.android.server.wifi Change-Id: Ibfd392d0ee9ffe9c4983589c499990da721068e2 --- service/java/com/android/server/wifi/WifiServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 4a9902484..6e339044a 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -3874,7 +3874,7 @@ public class WifiServiceImpl extends BaseWifiService { */ @Override public void setDeviceMobilityState(@DeviceMobilityState int state) { - mContext.enforceCallingPermission( + mContext.enforceCallingOrSelfPermission( android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE, "WifiService"); if (mVerboseLoggingEnabled) { @@ -4000,7 +4000,7 @@ public class WifiServiceImpl extends BaseWifiService { if (listener == null) { throw new IllegalArgumentException("Listener must not be null"); } - mContext.enforceCallingPermission( + mContext.enforceCallingOrSelfPermission( android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE, "WifiService"); if (mVerboseLoggingEnabled) { mLog.info("addOnWifiUsabilityStatsListener uid=%") @@ -4021,7 +4021,7 @@ public class WifiServiceImpl extends BaseWifiService { */ @Override public void removeOnWifiUsabilityStatsListener(int listenerIdentifier) { - mContext.enforceCallingPermission( + mContext.enforceCallingOrSelfPermission( android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE, "WifiService"); if (mVerboseLoggingEnabled) { mLog.info("removeOnWifiUsabilityStatsListener uid=%") @@ -4040,7 +4040,7 @@ public class WifiServiceImpl extends BaseWifiService { */ @Override public void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec) { - mContext.enforceCallingPermission( + mContext.enforceCallingOrSelfPermission( android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE, "WifiService"); if (mVerboseLoggingEnabled) { @@ -4205,7 +4205,7 @@ public class WifiServiceImpl extends BaseWifiService { if (scorer == null) { throw new IllegalArgumentException("Scorer must not be null"); } - mContext.enforceCallingPermission( + mContext.enforceCallingOrSelfPermission( android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE, "WifiService"); if (mVerboseLoggingEnabled) { mLog.info("setWifiConnectedNetworkScorer uid=%").c(Binder.getCallingUid()).flush(); @@ -4221,7 +4221,7 @@ public class WifiServiceImpl extends BaseWifiService { */ @Override public void clearWifiConnectedNetworkScorer() { - mContext.enforceCallingPermission( + mContext.enforceCallingOrSelfPermission( android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE, "WifiService"); if (mVerboseLoggingEnabled) { mLog.info("clearWifiConnectedNetworkScorer uid=%").c(Binder.getCallingUid()).flush(); -- cgit v1.2.3