diff options
author | sqian <shuoq@google.com> | 2019-12-12 16:17:12 -0800 |
---|---|---|
committer | Shuo Qian <shuoq@google.com> | 2020-01-14 01:14:41 +0000 |
commit | 43138a18a64d63ae8536fe4e43ed210ea3d45d30 (patch) | |
tree | 47d53974caa8a0a15bee2f61dc1104aad1af0d83 | |
parent | 6c32b3e699f675f93e5b661a572ec18b6ad238e9 (diff) | |
download | AlternativeNetworkAccess-43138a18a64d63ae8536fe4e43ed210ea3d45d30.tar.gz |
Refactor TelephonyPermission Method in AlternativeNetworkAccess
Test: manual
Bug: 145688189
Change-Id: Iad7c297a6039c60b0cdc5cd367cfd9daedbbee8e
Merged-In: Iad7c297a6039c60b0cdc5cd367cfd9daedbbee8e
(cherry picked from commit 9be28087cafe95d3e7e5d5adf1652675903e9759)
-rw-r--r-- | src/com/android/ons/OpportunisticNetworkService.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/ons/OpportunisticNetworkService.java b/src/com/android/ons/OpportunisticNetworkService.java index 96af81f..ddd3e78 100644 --- a/src/com/android/ons/OpportunisticNetworkService.java +++ b/src/com/android/ons/OpportunisticNetworkService.java @@ -236,10 +236,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 { @@ -312,7 +312,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, @@ -422,7 +422,7 @@ public class OpportunisticNetworkService extends Service { if (Binder.withCleanCallingIdentity( () -> mSubscriptionManager.isActiveSubId( availableNetworkInfo.getSubId()))) { - TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege( + TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(mContext, availableNetworkInfo.getSubId(), "updateAvailableNetworks"); } else { /* check if the app has opportunistic carrier permission */ |