android_packages_modules_Co.../tests/unit/java/com/android
Repository files (latest commit first)
Filename Latest commit message Latest commit date
junyulai 96bd9fe4de Check carrier privilege for CBS network requests synchronously
Normally if an app calls requestNetwork with capabilities that it
does not have permission to request, it gets a SecurityException,
except if it requests NET_CAPABILITY_CBS, in which case the request
will not throw but the app will get an onUnavailable callback.

Make this codepath throw as well. This simplifies the code and makes
the app-visible behaviour more consistent (and consistent with what
happens in S and below). The reason the code was written this way is because the carrier privilege app should receive a callback if it
loses permission. But onUnavailable is also not the best callback to
send, since it is used very rarely and also releases the app's
request. It seems better to leave the request registered and send
onLost.

Test: atest FrameworksNetTests
Bug: 194332512
Change-Id: I5eaeb415a6654851246e38599a996fbd9366fde0
2022-05-10 10:26:54 +00:00
..
internal/net Test Ikev2VpnProfile provisioned with IkeTunnelConnectionParams 2022-04-21 14:49:41 +08:00
server Check carrier privilege for CBS network requests synchronously 2022-05-10 10:26:54 +00:00