Allow NetworkAgent "immutable updates" to NetworkCapabilities
This patch loosens the validation checks when a NetworkAgent updates it
NetworkCapabilities: instead of checking that capabilities labeled as
"immutable" stay identical across updates, it is now accepted to change
immutable capabilities in a way that the new NetworkCapabilities
satisfies the old NetworkCapabilities.
This allows a NetworkAgent to update itself in order to match more
requests, but will still catch NetworkAgents that sends degradation
updates causing potentially requests to not match anymore.
Bug: 64125969
Test: runtest frameworks-net
Merged-In: I2a1b3f9c0be6415e40edc989d0c1b03b5631f7b1
Merged-In: I0ab76de59e87c46a6961229399ff7200bce49838
Merged-In: Ied592bf6112574399a1e808da337004e1c35f244
Merged-In: I01e287b4df82a53a522566d33b3166f7801badca
Merged-In: I7ee60daa9c4266e9b9179032815dd7267e06377f
Merged-In: I31ef741eb83d64c476e5930d5762514b5d4cb16f
(cherry picked from commit 56a1054ab4)
Change-Id: I9d630d63336f4db69f3eb52faa8483f1b1e35d16
This commit is contained in:
parent
da05c2351f
commit
2f90b2dee0
1 changed files with 7 additions and 4 deletions
|
|
@ -770,7 +770,6 @@ public final class NetworkCapabilities implements Parcelable {
|
|||
|
||||
StringJoiner joiner = new StringJoiner(", ");
|
||||
|
||||
// TODO: consider only enforcing that capabilities are not removed, allowing addition.
|
||||
// Ignore NOT_METERED being added or removed as it is effectively dynamic. http://b/63326103
|
||||
// TODO: properly support NOT_METERED as a mutable and requestable capability.
|
||||
final long mask = ~MUTABLE_CAPABILITIES & ~(1 << NET_CAPABILITY_NOT_METERED);
|
||||
|
|
|
|||
Loading…
Reference in a new issue