Merge "Ensure calling package name and uid are matched" into sc-qpr1-dev am: e93efb6f96

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15618365

Change-Id: I80aa5da33f8c4c5154a721ceec58852b6c2d42f1
This commit is contained in:
TreeHugger Robot
2021-10-01 14:21:16 +00:00
committed by Automerger Merge Worker
2 changed files with 28 additions and 0 deletions

View File

@@ -14411,4 +14411,11 @@ public class ConnectivityServiceTest {
mDefaultNetworkCallback.expectCallback(CallbackEntry.LOST, mWiFiNetworkAgent);
mDefaultNetworkCallback.expectAvailableCallbacksValidated(mCellNetworkAgent);
}
@Test
public void testRequestRouteToHostAddress_PackageDoesNotBelongToCaller() {
assertThrows(SecurityException.class, () -> mService.requestRouteToHostAddress(
ConnectivityManager.TYPE_NONE, null /* hostAddress */, "com.not.package.owner",
null /* callingAttributionTag */));
}
}