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

Commit 68307bf3 authored by Cody Kesting's avatar Cody Kesting
Browse files

Clean up unit testing for ConnectivityDiagnostics.

Connectivity Diagnostics included an unnecessary try-catch for verifying
that the permissions check for invoking ConnectivityDiagnosticsCallbacks
doesn't throw when the uid and package name do not match.

Bug: 149119324
Test: atest FrameworksNetTests
Change-Id: Ie302b1f4f437e819fdd15ec28adb0b56750c2c53
parent beb34da4
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -6770,15 +6770,11 @@ public class ConnectivityServiceTest {

        mServiceContext.setPermission(android.Manifest.permission.NETWORK_STACK, PERMISSION_DENIED);

        try {
        assertFalse(
                "Mismatched uid/package name should not pass the location permission check",
                mService.checkConnectivityDiagnosticsPermissions(
                        Process.myPid() + 1, Process.myUid() + 1, naiWithoutUid,
                        mContext.getOpPackageName()));
        } catch (SecurityException e) {
            fail("checkConnectivityDiagnosticsPermissions shouldn't surface a SecurityException");
        }
    }

    @Test