Add NetworkRequest.Builder creating from an existing instance

Provide a formal way to construct a new NetworkRequest from an
existing instance. The network capabilities inside the
NetworkRequest is hidden. There is no way to pass a
NetworkRequest and update its capabilities. Add
NetworkRequest.Builder creating from an existing instance to
allow to clone the network capabilities.

Bug: 172183305
Test: make update-api
Change-Id: I068462b2a1410daf67b0c95f2b643d396f079531
CTS-Coverage-Bug: 172183305
This commit is contained in:
Chiachang Wang
2021-03-22 17:24:11 +08:00
parent a12c9fa7cf
commit c2e79ada6c
2 changed files with 9 additions and 0 deletions

View File

@@ -396,6 +396,7 @@ package android.net {
public static class NetworkRequest.Builder {
ctor public NetworkRequest.Builder();
ctor public NetworkRequest.Builder(@NonNull android.net.NetworkRequest);
method public android.net.NetworkRequest.Builder addCapability(int);
method public android.net.NetworkRequest.Builder addTransportType(int);
method public android.net.NetworkRequest build();