Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c608a3e2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Tighten up Binder.clearCallingIdentity() usage." am: 1fe717a5

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1510868

Change-Id: I2493e33b3c9a26367a9e6561b9803a4449d6ac9d
parents 919a826d 1fe717a5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -974,7 +974,7 @@ public class Vpn {
    /** Prepare the VPN for the given package. Does not perform permission checks. */
    @GuardedBy("this")
    private void prepareInternal(String newPackage) {
        long token = Binder.clearCallingIdentity();
        final long token = Binder.clearCallingIdentity();
        try {
            // Reset the interface.
            if (mInterface != null) {
@@ -1262,7 +1262,7 @@ public class Vpn {
        mNetworkCapabilities.setAdministratorUids(new int[] {mOwnerUID});
        mNetworkCapabilities.setUids(createUserAndRestrictedProfilesRanges(mUserId,
                mConfig.allowedApplications, mConfig.disallowedApplications));
        long token = Binder.clearCallingIdentity();
        final long token = Binder.clearCallingIdentity();
        try {
            mNetworkAgent = new NetworkAgent(mLooper, mContext, NETWORKTYPE /* logtag */,
                    mNetworkInfo, mNetworkCapabilities, lp,
@@ -1281,7 +1281,7 @@ public class Vpn {
    }

    private boolean canHaveRestrictedProfile(int userId) {
        long token = Binder.clearCallingIdentity();
        final long token = Binder.clearCallingIdentity();
        try {
            return UserManager.get(mContext).canHaveRestrictedProfile(userId);
        } finally {
@@ -1328,7 +1328,7 @@ public class Vpn {
        // Check if the service is properly declared.
        Intent intent = new Intent(VpnConfig.SERVICE_INTERFACE);
        intent.setClassName(mPackage, config.user);
        long token = Binder.clearCallingIdentity();
        final long token = Binder.clearCallingIdentity();
        try {
            // Restricted users are not allowed to create VPNs, they are tied to Owner
            enforceNotRestrictedUser();
@@ -2063,7 +2063,7 @@ public class Vpn {
     */
    public void startLegacyVpn(VpnProfile profile, KeyStore keyStore, LinkProperties egress) {
        enforceControlPermission();
        long token = Binder.clearCallingIdentity();
        final long token = Binder.clearCallingIdentity();
        try {
            startLegacyVpnPrivileged(profile, keyStore, egress);
        } finally {