Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Clean up handling of NetworkCapabilities#administratorUids." am: eb0b80c9e5 am: 2ea7a457b0
Change-Id: Ie2e85fc61fe3765beebcc511f2256bd6b4c37b1f

Cody Kesting   authored and   Automerger Merge Worker   commited 2020-03-30 22:50:39 +00:00
5c96dc912b
Merge "Clean up handling of NetworkCapabilities#administratorUids."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-03-30 22:04:43 +00:00
eb0b80c9e5
Clean up handling of NetworkCapabilities#administratorUids.
Update ConnectivityService's check for administrator UIDs to use
ArrayUtils to check for UID inclusion. Update the NetworkCapabilities
annotation on the administrator UIDs field to clarify that it is
NonNull.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: Id630fe9d76aacdaf038fdaa5360f0327520ee0c3

Cody Kesting   commited 2020-03-30 16:55:21 +00:00
7b987276db
Merge "Create a builder for NetworkCapabilities."
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-03-30 02:58:45 +00:00
e3aade0a30
Merge changes from topics "api-fix-networkagent", "networkprovider_api", "satisfiedby" into rvc-dev am: 199c91b659
Change-Id: I041fa5232ac2f653f0ff9070b9bcd924345f9987

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-03-27 22:56:26 +00:00
ec85550d64
Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1

Chalard Jean   commited 2020-03-27 23:46:30 +09:00
51b8e287ad
Address further API council comments.
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I8a785ae0e74e659c317deaaa28c203356c7766ed

Chalard Jean   commited 2020-03-27 17:57:24 +09:00
812e8cb87e
Update the NetworkProvider API for council comments
Bug: 152238712
Test: FrameworksNetTests NetworkStackTests
Change-Id: I6b086572cfc72a0727f4510351cff0e74cbc4302

Chalard Jean   commited 2020-03-27 17:53:05 +09:00
fd23dbbf07
Merge "API review: access field by method"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-27 07:03:25 +00:00
a09a992749
Merge changes from topic "networkagent_api" into rvc-dev am: f79df94011
Change-Id: If16fd956e2d694fa36492cc1a1512a9d12dee3dd

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-03-27 06:23:56 +00:00
58603f3a63
Merge changes from topic "networkagent_api" into rvc-dev
* changes:
  Update NetworkAgentConfig API for council comments
  Update the NetworkAgent API for council comments

Chalard Jean   authored and   Android (Google) Code Review   commited 2020-03-27 06:20:37 +00:00
f79df94011
Update NetworkAgentConfig API for council comments
Bug: 152238712
Test: FrameworksNetTests NetworkStackTests
Change-Id: Idca9f243a5c955f4caa30921ee520e1a93b0d11a

Chalard Jean   commited 2020-03-25 22:43:13 +09:00
15a3adbdf3
Update the NetworkAgent API for council comments
Bug: 152238712
Test: FrameworksNetTests NetworkStackTests
Change-Id: I9a2691f783f4449348c3f767568e05620f0b9df5

Chalard Jean   commited 2020-03-25 22:35:41 +09:00
68d0e42789
Merge "Allow MANAGE_TEST_NETWORKS to register limited agents" am: a982d12943 am: 3870a078e3
Change-Id: Ia0f76216636ae11d1d9cbea5ed6ff0ee4e2a3f5b

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-03-25 10:49:54 +00:00
abd9a140a6
Allow MANAGE_TEST_NETWORKS to register limited agents
This puts in force some restrictions against test networks,
and in exchange relaxes the restrictions around registering
a network agent that provides a test network.
Test networks can only ever have transport TEST, and have
only a few capabilities available to them.

This is useful in particular to test CTS. See aosp/1253423
for first, basic usage of this capability.

Test: IpSecManagerTunnelTest
Test: new CTS aosp/1253423
Bug: 139268426

Change-Id: Ibd162792a7ab02fcbb06130f21a825a386678c05
(cherry picked from commit 2c129e97cca2234ee6dd079a9c07df0c530d8b36)

Chalard Jean   commited 2020-03-25 10:43:26 +00:00
d22cb127b9
Merge "API review: make exception class and Builder final" into rvc-dev am: 9c9366b2df
Change-Id: I974be68ce205a701619a71e9ef7f43d8f8be0f8c

Aaron Huang   authored and   Automerger Merge Worker   commited 2020-03-25 09:47:47 +00:00
df68f4f75e
Merge "Allow MANAGE_TEST_NETWORKS to register limited agents"
Chalard Jean   authored and   Gerrit Code Review   commited 2020-03-25 09:47:03 +00:00
a982d12943
Allow MANAGE_TEST_NETWORKS to register limited agents
This puts in force some restrictions against test networks,
and in exchange relaxes the restrictions around registering
a network agent that provides a test network.
Test networks can only ever have transport TEST, and have
only a few capabilities available to them.

This is useful in particular to test CTS. See aosp/1253423
for first, basic usage of this capability.

Test: IpSecManagerTunnelTest
Test: new CTS aosp/1253423
Bug: 139268426
Change-Id: I47600e6097e8519e50ae771daa13bb6bb7640451

Chalard Jean   commited 2020-03-25 16:28:50 +09:00
5b63976366
API review: make exception class and Builder final
- InvalidPacketException exception class should be final
- NetworkCapabilities.Builder should be final

Bug: 152203926
Test: atest FrameworksNetTests
Change-Id: If9b799151aff6d41c9bcd8bb86c65a58e46bad73

Aaron Huang   commited 2020-03-25 13:36:38 +08:00
4b1aada0aa
Create a builder for NetworkCapabilities.
Bug: 151322799
Test: FrameworksWifiTests
Change-Id: I69c00c9e3963950e55d7105d8825f7d3a3ec9b2f
Merged-In: I06eb97e50d5583579b3c26d1365d2dbaec8bfc99
(cherry picked from commit 9771f34dae9cdeb857636cac2b3c2d473713914e)

Chalard Jean   commited 2020-03-25 13:27:04 +09:00
542e60001a
Merge "Expose netId by adding getter API"
Chalard Jean   authored and   Gerrit Code Review   commited 2020-03-25 02:23:03 +00:00
461f81faac
API review: access field by method
- InvalidPacketException, public field should be a method so
  add getter to get error code.
- KeepalivePacketData, public fields should be methods so
   add getter for fields.

Bug: 151322799
Test: atest FrameworksNetTests
      atest FrameworksWifiTests
      atest FrameworksTelephonyTests: some failure in CarrierAppUtilsTest
Copy from ag/10731108
Change-Id: Id01e6135193716cc21bba11da529bf1507a954f7
Merged-In: Id01e6135193716cc21bba11da529bf1507a954f7

Aaron Huang   commited 2020-03-24 10:55:18 +00:00
005f9d10ae
Expose netId by adding getter API
Bug: 151156820
Test: m
      atest TetetheringTests

Clean CP from ag/10747732

Change-Id: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
Merged-In: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899

markchien   authored and   Chalard Jean   commited 2020-03-24 09:19:26 +00:00
9d26f92289
Fix addRoute replace default route unexpectedly
In aosp/1203789, if two routes are with the same destination,
it will be replaced instead of added when calling addRoute.
This breaks scenarios which rely on the ability to add multiple
default routes, such as multiple IPv6 default routes learned
via address autoconfiguration.

This change treats the route is an update if the destination
and nexthop are the same, but different in other properties.

Test: atest OffloadControllerTest#testSetUpstreamLinkPropertiesWorking
Test: atest LinkPropertiesUtilsTest#testLinkPropertiesIdenticalEqual
Test: atest ConnectivityServiceTest#testStackedLinkProperties
Test: atest ConnectivityServiceTest#testRouteAddDeleteUpdate
  (only directly related tests are listed)
Fix: 152170074
Fix: 151911339
Bug: 142892223

Change-Id: I7153ec9866f14a109ba8155c905e5d9e4f85eb64
Merged-In: I7153ec9866f14a109ba8155c905e5d9e4f85eb64
(cherry picked from commit 11aa9cb44aee289329b306cfc51a73cfe1456b61)

Treehugger Robot   authored and   Junyu Lai   commited 2020-03-24 08:41:44 +00:00
cbd7b6b1dd
Merge "Fix addRoute replace default route unexpectedly" am: 56d39d3251 am: c6a56b7678
Change-Id: I59759bb5241f24f5b0a3359c9c9bdb089b1b9515

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-03-24 06:15:24 +00:00
c73de276e3
Merge "Fix addRoute replace default route unexpectedly"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-03-24 05:51:30 +00:00
56d39d3251
Fix addRoute replace default route unexpectedly
In aosp/1203789, if two routes are with the same destination,
it will be replaced instead of added when calling addRoute.
This breaks scenarios which rely on the ability to add multiple
default routes, such as multiple IPv6 default routes learned
via address autoconfiguration.

This change treats the route is an update if the destination
and nexthop are the same, but different in other properties.

Test: atest OffloadControllerTest#testSetUpstreamLinkPropertiesWorking
Test: atest LinkPropertiesUtilsTest#testLinkPropertiesIdenticalEqual
Test: atest ConnectivityServiceTest#testStackedLinkProperties
Test: atest ConnectivityServiceTest#testRouteAddDeleteUpdate
  (only directly related tests are listed)
Fix: 152170074
Fix: 151911339
Bug: 142892223

Change-Id: I7153ec9866f14a109ba8155c905e5d9e4f85eb64

junyulai   commited 2020-03-24 10:27:01 +08:00
a1493a52d0
Merge "Refactor Network's use of mUrlConnectionFactory." am: f06634ae70 am: a831fdfb1f
Change-Id: I7ce77a1735521cc10ee16a4c6f45e59c0a87585a

Tobias Thierer   authored and   Automerger Merge Worker   commited 2020-03-23 12:08:11 +00:00
d8dff567fa
Refactor Network's use of mUrlConnectionFactory.
1.) Replace maybeInitUrlConnectionFactory() with a static method
    createUrlConnectionFactory(Dns) and move the logic to acquire
    the lock and initialize mUrlConnectionFactory out into
    openConnection. This makes it a bit clearer that the lock
    is acquired during openConnection().
2.) Use @GuardedBy("mLock") rather than a human readable comment
    on mUrlConnectionFactory.
3.) Make mUrlConnectionFactory non-volatile (since it's guarded by
    mLock), as recommended by Narayan on the review thread for
    http://r.android.com/370652
    Alternatively, the field could have remained volatile
    and we could have used double-checked locking to avoid
    acquiring the lock in the common case.
    The lock is only acquired during getSocketFactory() and
    openConnection(), so it shouldn't usually be contended.

This CL is a pure refactoring that shouldn't have any observable
behavior change.

Bug: 38311512
Test: Treehugger
Exempt-From-Owner-Approval: refactoring only, owner didn't respond in time
Change-Id: I1cf6075dc7cd994657b11d6a82de3ec63235fb1e

Tobias Thierer   commited 2020-03-23 11:34:32 +00:00
47c0d852da
Merge "Expose netId by adding getter API" into rvc-dev am: ad76cd9864
Change-Id: I826f8a561b2bd0f456302247f90d26ffc42c42df

Junyu Lai   authored and   Automerger Merge Worker   commited 2020-03-20 11:23:27 +00:00
f5098d2040
API review: access field by method am: 410236b92e
Change-Id: I5128f2865406e0f35fb30af102dc9957ceac29ed

Aaron Huang   authored and   Automerger Merge Worker   commited 2020-03-20 11:22:39 +00:00
3cfac75f49
Merge "API review: access field by method" into rvc-dev
Aaron Huang   authored and   Android (Google) Code Review   commited 2020-03-20 11:09:43 +00:00
de4c7dcda4
Create a builder for NetworkCapabilities. am: d7d24015a5
Change-Id: I3d7a595d25b65ff4f5762c83a3dfc82c0f5ddc2d

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-03-20 11:08:52 +00:00
52ce44e5b6
Merge "Create a builder for NetworkCapabilities." into rvc-dev
Junyu Lai   authored and   Android (Google) Code Review   commited 2020-03-20 11:03:47 +00:00
7049aa6816
Merge "Expose netId by adding getter API" into rvc-dev
Junyu Lai   authored and   Android (Google) Code Review   commited 2020-03-20 11:03:05 +00:00
ad76cd9864
Merge "Change NetworkCapabilties administrator UIDs to be stored as int[]."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-03-19 18:09:26 +00:00
1a78f835eb
Merge "TetheringManager API clean up"
Mark Chien   authored and   Gerrit Code Review   commited 2020-03-19 16:09:21 +00:00
bc91f858e6
Merge "Move NetworkCallback to last parameter for new exposed requestNetwork"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-03-19 15:51:32 +00:00
f0da719ed1
Merge "Make Ethernet interfaces more testable." into rvc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2020-03-19 14:31:57 +00:00
3577796e6a
Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" into rvc-dev am: 3eb3c377b8
Change-Id: I03fd96ffe141f5cf5c2448390aba5be9c28fc96a

TreeHugger Robot   authored and   Automerger Merge Worker   commited 2020-03-19 13:52:20 +00:00
678b6ddb65
Merge "Move NetworkCallback to last parameter for new exposed requestNetwork" into rvc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2020-03-19 13:40:51 +00:00
3eb3c377b8
Create a builder for NetworkCapabilities.
Bug: 151322799
Test: FrameworksWifiTests
Change-Id: I06eb97e50d5583579b3c26d1365d2dbaec8bfc99

Chalard Jean   commited 2020-03-19 21:55:57 +09:00
d7d24015a5
Make Ethernet interfaces more testable.
This CL adds a setIncludeTestInterfaces method to EthernetManager
that, when called, causes the Ethernet service to recognize and
manage test interfaces created by TestNetworkManager.

Bug: 150644681
Test: Tested by EthernetTetheringTest in same topic
Change-Id: I86eef7a93267f800dbfc8eafd307effa76a344ca
Merged-In: I86eef7a93267f800dbfc8eafd307effa76a344ca
(cherry picked from commit 3410fb0aa92bbd4f9d7dc031e89f6f528ff34245)

Lorenzo Colitti   commited 2020-03-19 12:30:39 +00:00
4574935dca
Merge "TetheringManager API clean up" into rvc-dev am: cca0c6192e
Change-Id: Id093ec8add4777f1d4a2c3d0890378acdc7ceaed

Mark Chien   authored and   Automerger Merge Worker   commited 2020-03-19 12:07:18 +00:00
0a28218eee
Merge "TetheringManager API clean up" into rvc-dev
Mark Chien   authored and   Android (Google) Code Review   commited 2020-03-19 12:04:05 +00:00
cca0c6192e
Merge "Make Ethernet interfaces more testable." am: cabe5e5615 am: 5b7eccf20d
Change-Id: I5a73dc5ad6576573bcac6c7ac6f1270dfbb97470

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-03-19 11:46:55 +00:00
5a82f3c4ad
Move NetworkCallback to last parameter for new exposed requestNetwork
Bug: 151243698
Test: atest TetheringTests
Change-Id: I87ef1d451eefa6998b9793c4eacabae978376d24
Merged-In: I87ef1d451eefa6998b9793c4eacabae978376d24

markchien   authored and   Mark Chien   commited 2020-03-19 11:36:07 +00:00
fac84a2be1
TetheringManager API clean up
Per API review:
- @IntDef defined on the type integer parameter
- have getters on each parameter that is set in the
  TetheringRequest.Builder
- new added API should not be deprecated
Below APIs is moved from system-current to module-lib-current that only
plafrom code(e.g. ConnectivityManager and Settings) can use them.
TetheringRequest.
onTetherableInterfaceRegexpsChanged, TetheringInterfaceRegexps:
Only platform code can use them because interfaces by regular
expressions are a mechanism which is planning to be deprecated.

Also rename some constants for easier to understand.

Bug: 149858697
Bug: 151243337
Test: m doc-comment-check-docs
      atest TetheringTests
Change-Id: I45cb21d5bc919f6d32c42650326597d5173ea028
Merged-In: Idd041f0fbeca411ea23e49786a50dd7feb77ef45

markchien   commited 2020-03-19 19:32:50 +08:00
f47d83448c
Merge "Make Ethernet interfaces more testable."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-03-19 11:12:09 +00:00
cabe5e5615
Move NetworkCallback to last parameter for new exposed requestNetwork
Bug: 151243698
Test: atest TetheringTests
Change-Id: I87ef1d451eefa6998b9793c4eacabae978376d24

markchien   commited 2020-03-19 19:10:23 +08:00
38ef330e46