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
This commit is contained in:
@@ -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");
|
||||
}
|
||||
assertFalse(
|
||||
"Mismatched uid/package name should not pass the location permission check",
|
||||
mService.checkConnectivityDiagnosticsPermissions(
|
||||
Process.myPid() + 1, Process.myUid() + 1, naiWithoutUid,
|
||||
mContext.getOpPackageName()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user