OSDN Git Service

Fix setCapabilities.
authorChalard Jean <jchalard@google.com>
Fri, 18 May 2018 14:48:49 +0000 (23:48 +0900)
committerChalard Jean <jchalard@google.com>
Wed, 6 Jun 2018 08:24:43 +0000 (08:24 +0000)
commitd1d8b627dd23b0bda8399a04b04320498271a105
treed7fb197c46f7af13071b16d9e5eca60e6af07d15
parentfdd9e2f73a779c54a661d768709c02d699b872ca
Fix setCapabilities.

P introduced setSSID, UIDs and unwanted capabilities.
None of these exhibit commutative behavior through combineCapabilities
because their semantics don't allow it. Therefore
NetworkRequest.setCapabilities() is badly broken around any of
these. Look at the comments in the new tests to realize the
extent of the damage.

Clean cherry-pick of ag/4083952

Bug: 79748782
Test: new tests written, old tests pass
Change-Id: Iafe074126132a82af37f4bf056c4a7b8d56bdc83
Merged-In: Ia5bebf8a233775367bbf1b788870528934ecbcfb
Merged-In: I13d7782a6c0c7b1f94137995bbb0d257a58d89c1
core/java/android/net/NetworkCapabilities.java
core/java/android/net/NetworkRequest.java
tests/net/java/android/net/NetworkCapabilitiesTest.java