diff options
| author | 2018-09-19 21:46:05 +0000 | |
|---|---|---|
| committer | 2018-09-19 21:46:05 +0000 | |
| commit | 69c973b33f261a8f75dd0cb72ebd425d63609a56 (patch) | |
| tree | 5df6954a567d727f41ae7f3f747bb3e41c81e025 | |
| parent | 999be2982239cfaa2f84a830e8b9241d916370aa (diff) | |
| parent | d8db9189ecf5678635985fa98dbf9f9e4f864fb2 (diff) | |
Merge "Re-enable checks for MANAGE_IPSEC_TUNNELS"
| -rw-r--r-- | services/core/java/com/android/server/IpSecService.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/services/core/java/com/android/server/IpSecService.java b/services/core/java/com/android/server/IpSecService.java index 380f6a7e581e..a69d41683c29 100644 --- a/services/core/java/com/android/server/IpSecService.java +++ b/services/core/java/com/android/server/IpSecService.java @@ -1490,23 +1490,19 @@ public class IpSecService extends IIpSecService.Stub { } } - private static final String TUNNEL_OP = "STOPSHIP"; // = AppOpsManager.OP_MANAGE_IPSEC_TUNNELS; + private static final String TUNNEL_OP = AppOpsManager.OPSTR_MANAGE_IPSEC_TUNNELS; private void enforceTunnelPermissions(String callingPackage) { checkNotNull(callingPackage, "Null calling package cannot create IpSec tunnels"); - if (false) { // STOPSHIP if this line is present - switch (getAppOpsManager().noteOp( - TUNNEL_OP, - Binder.getCallingUid(), callingPackage)) { - case AppOpsManager.MODE_DEFAULT: - mContext.enforceCallingOrSelfPermission( - android.Manifest.permission.MANAGE_IPSEC_TUNNELS, "IpSecService"); - break; - case AppOpsManager.MODE_ALLOWED: - return; - default: - throw new SecurityException("Request to ignore AppOps for non-legacy API"); - } + switch (getAppOpsManager().noteOp(TUNNEL_OP, Binder.getCallingUid(), callingPackage)) { + case AppOpsManager.MODE_DEFAULT: + mContext.enforceCallingOrSelfPermission( + android.Manifest.permission.MANAGE_IPSEC_TUNNELS, "IpSecService"); + break; + case AppOpsManager.MODE_ALLOWED: + return; + default: + throw new SecurityException("Request to ignore AppOps for non-legacy API"); } } |