summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java12
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java12
2 files changed, 12 insertions, 12 deletions
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();
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index fcc290560..a11fc6dcb 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -4602,7 +4602,7 @@ public class WifiServiceImplTest extends WifiBaseTest {
@Test
public void setDeviceMobilityStateThrowsSecurityExceptionOnMissingPermissions() {
doThrow(new SecurityException()).when(mContext)
- .enforceCallingPermission(
+ .enforceCallingOrSelfPermission(
eq(android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE),
eq("WifiService"));
try {
@@ -4630,7 +4630,7 @@ public class WifiServiceImplTest extends WifiBaseTest {
@Test
public void testAddStatsListenerThrowsSecurityExceptionOnMissingPermissions() {
doThrow(new SecurityException()).when(mContext)
- .enforceCallingPermission(
+ .enforceCallingOrSelfPermission(
eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE),
eq("WifiService"));
try {
@@ -4662,7 +4662,7 @@ public class WifiServiceImplTest extends WifiBaseTest {
@Test
public void testRemoveStatsListenerThrowsSecurityExceptionOnMissingPermissions() {
doThrow(new SecurityException()).when(mContext)
- .enforceCallingPermission(
+ .enforceCallingOrSelfPermission(
eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE),
eq("WifiService"));
try {
@@ -4703,7 +4703,7 @@ public class WifiServiceImplTest extends WifiBaseTest {
@Test
public void testUpdateWifiUsabilityScoreThrowsSecurityExceptionOnMissingPermissions() {
doThrow(new SecurityException()).when(mContext)
- .enforceCallingPermission(
+ .enforceCallingOrSelfPermission(
eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE),
eq("WifiService"));
try {
@@ -5475,7 +5475,7 @@ public class WifiServiceImplTest extends WifiBaseTest {
@Test
public void testSetNetworkScorerThrowsSecurityExceptionOnMissingPermissions() {
doThrow(new SecurityException()).when(mContext)
- .enforceCallingPermission(
+ .enforceCallingOrSelfPermission(
eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE),
eq("WifiService"));
try {
@@ -5505,7 +5505,7 @@ public class WifiServiceImplTest extends WifiBaseTest {
@Test
public void testClearNetworkScorerThrowsSecurityExceptionOnMissingPermissions() {
doThrow(new SecurityException()).when(mContext)
- .enforceCallingPermission(
+ .enforceCallingOrSelfPermission(
eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE),
eq("WifiService"));
try {