summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuo Qian <shuoq@google.com>2019-12-04 20:28:50 -0800
committerShuo Qian <shuoq@google.com>2019-12-09 22:20:10 +0000
commit9be28087cafe95d3e7e5d5adf1652675903e9759 (patch)
tree7075f362d88a32005bd4dcd3d5ae9912aebc9e4e
parentc64e2aa9c48ad9fd39cc7b959f17f8d805a79fc4 (diff)
downloadplatform_packages_services_AlternativeNetworkAccess-9be28087cafe95d3e7e5d5adf1652675903e9759.tar.gz
platform_packages_services_AlternativeNetworkAccess-9be28087cafe95d3e7e5d5adf1652675903e9759.tar.bz2
platform_packages_services_AlternativeNetworkAccess-9be28087cafe95d3e7e5d5adf1652675903e9759.zip
Refactor TelephonyPermission Method in AlternativeNetworkAccess
Test: manual Bug: 145688189 Change-Id: Iad7c297a6039c60b0cdc5cd367cfd9daedbbee8e
-rw-r--r--src/com/android/ons/OpportunisticNetworkService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/ons/OpportunisticNetworkService.java b/src/com/android/ons/OpportunisticNetworkService.java
index b4a3b8f..a64ffca 100644
--- a/src/com/android/ons/OpportunisticNetworkService.java
+++ b/src/com/android/ons/OpportunisticNetworkService.java
@@ -229,10 +229,10 @@ public class OpportunisticNetworkService extends Service {
ISetOpportunisticDataCallback callbackStub, String callingPackage) {
logDebug("setPreferredDataSubscriptionId subId:" + subId + "callingPackage: " + callingPackage);
if (!enforceModifyPhoneStatePermission(mContext)) {
- TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(
+ TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(mContext,
mSubscriptionManager.getDefaultSubscriptionId(), "setPreferredDataSubscriptionId");
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
- TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(subId,
+ TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(mContext, subId,
"setPreferredDataSubscriptionId");
}
} else {
@@ -305,7 +305,7 @@ public class OpportunisticNetworkService extends Service {
(ArrayList<AvailableNetworkInfo>) availableNetworks, callbackStub);
} else {
/* check if the app has primary carrier permission */
- TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(
+ TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(mContext,
mSubscriptionManager.getDefaultSubscriptionId(), "updateAvailableNetworks");
handleCarrierAppAvailableNetworks(
(ArrayList<AvailableNetworkInfo>) availableNetworks, callbackStub,
@@ -409,7 +409,7 @@ public class OpportunisticNetworkService extends Service {
Binder.restoreCallingIdentity(identity);
}
if (isActiveSubId) {
- TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(
+ TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(mContext,
availableNetworkInfo.getSubId(), "updateAvailableNetworks");
} else {
/* check if the app has opportunistic carrier permission */