This commit adds methods to support migrating tunnel mode
IpSecTransform to new source/destination addresses.
Bug: 169171001
Test: atest FrameworksNetTests (new tests added)
Change-Id: Ic177015fba5b62d3f73009633118109d3631086f
Setting the MTU for an interface should not be skipped when the
interface names are different. This occurs when a VPN network creates
a new interface with identical MTU.
Bug: 246398088
Test: atest ConnectivityServiceTest
Test: Manual test: Connect to VPN network and switch networks
Test: Confirm MTU of interface is set correctly with `adb shell ip addr`
Change-Id: I811a01feca2fb2130c57c6c924145314180434c5
MdnsAnnouncer is a implementations of MdnsPacketRepeater, which sends a
packet at various intervals.
It will be used to send initial advertisements when a service is
registered or there is a network change.
Bug: 241738458
Test: atest
Change-Id: If187d023dd48d9b575431759cc6b67460bc0d33b
The previous implementation of writeLabels would not include a
compressed name in the label dictionary, so if a packet had
"something.local", "a.service.local" and "b.service.local",
"service.local" would not be compressed because "a.service.local"
already used compression (for .local).
Fix this and add a test.
Bug: 254166302
Test: atest
Change-Id: I41c557d6debd11acb4c0813735ef7af7323f45d7
Although RFC3845 2.1.1 specifies that NSEC records should not use
compression for the Next DomainName field, RFC6762 18.14 specifies that
compression should also be used for NSEC RDATA. The legacy mDNS
implementation does use compression for that field.
Bug: 241738458
Test: atest
Change-Id: I9cd2b8618b01bb569a7f1d13dc3bfd09a0433300
MdnsProber is an implementation of MdnsPacketRepeater that will be used
to send probes for service names before advertising them, to know if
they are already in use.
Bug: 241738458
Test: atest
Change-Id: I4e5f779b891e2c665ba7f752fb5fbd4255070725
MdnsInterfaceSocket: using for listening the multicast
socket on specific interface.
MdnsSocketProvider: using for creating and managing the
multiple multicast sockets.
- Listen NetworkCallback and TetheringEventCallback to know the
network connected / disconnected changes. And use the callbacks
to create / remove the sockets for mdns discovery
Bug: 254166302
Test: atest FrameworksNetTests
Change-Id: Icd8424792e89e71198fa31f9ec92e1ec8172128d
In Nsd, every request has Network info to assign the specific
network to do the mdns query. But the response MdnsServiceInfo
only has interface index which is not very useful and need to
transfer to a Network every time when using it because most
APIs for apps to use the network are based on Network object.
Thus, put the Network info into MdnsServiceInfo.
Bug: 254166302
Test: atest FrameworksNetTests
Change-Id: I2206a84636981fc7d9aa9deda0f18f60642bc7d7
Unit tests covering the different possible cases of calls to updateMtu.
Bug: 246398088
Test: atest ConnectivityServiceTest
Change-Id: Iced44c00e9dbe944c3a31bbf1da88f8077e4379a
Add some checks to verify that the underlying network info will
only be cleared when the underlying network is lost, or will only
be sent when the category is not CATEGORY_EVENT_DEACTIVATED_BY_USER
and CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED.
Bug: 237050331
Test: atest FrameworksNetTests:VpnTest
Change-Id: Ifc66658cf59481c4a9804e6933be1048f758b698
For network lost case, the process should be triggered by calling
onLost() instead of triggering onClosedWithException() directly.
Bug: 237050331
Test: atest FrameworksNetTests:VpnTest
Change-Id: I32781d4ac96ee8212d1fd7ba23009293f72b442e
Add onServiceNameDiscovered method which is used to listen the
discovery callbacks. It would be called once the service is found
even the response is incomplete. This is different from
onServiceFound which needs to receive a complete response.
onServiceNameRemoved is used for service removal if received
response is incomplete.
Bug: 254166302
Test: atest FramworksNetTests
Change-Id: I03313b045d74bb65f7fe6ac93673f02ce3b2c664
Now, the value in TextEntry would be a zero length byte array if
the text record response doesn't contain the value. The problem
is that the value could either be an empty string ("key="), or
there can be no value ("key"), as per rfc6763 6.4 "If there is
no '=' in a DNS-SD TXT record string, then it is a boolean
attribute, simply identified as being present, with no value.".
Bug: 254166302
Test: atest FramworksNetTests
Change-Id: I4eaa5e593ce9ddaa6b6cb2f069c1aef977910796
Currently, NET_CAPABILITY_TEMPORARILY_NOT_METERED traffic is
counted as unmetered data usage, and "mobile data usage"
settings screen shows metered data usage which means it doesn't
include TEMPORARILY_NOT_METERED traffic. However, some carriers
show TEMPORARILY_NOT_METERED data usage in customer's bill which
would be confusing if the data usage in the device shows different
results. Thus, revert the change to avoid confusing.
Bug: 183776809
Test: FrameworksNetTests
Change-Id: I4ef25095462adf30b1ecf82134996739f167930d
In current design, mMatchSubscriberIds can be null which has the
same meaning with empty set, and is not easy to maintain since it
need more checks for this variable when mSubscriberId is null.
Thus make mMatchSubscriberIds NonNull for the maintenance.
Bug: 238843364
Test: build, FrameworksNetTests
Change-Id: I6cfc529b5f4a39ded8598283ff968f2f4d1bc89f
NetworkTemplate.Builder was introduced in Android T and the callers
outside of Connectivity module should use this Builder to build a
template instead. Thus remove the buildTemplate* methods from
NetworkTemplate class. Also, deprecate the methods which are
annotated with @UnsupportedAppUsage and also use Builder to build
the template.
Bug: 238843364
Test: build, FrameworksNetTests
Change-Id: I3190325f6663e4771edf5c7a19bf5ecc7780bf12
Send MdnsServiceInfo on onServiceRemoved callback which include
service name, service type and other info instead of service name
only. These extra info is necessary for service lost callback on
NsdService on the following changes.
Bug: 254166302
Test: atest FrameworksNetTests
Change-Id: Ibacbef4b893209bbc2a37376bf26d713ce41429c
* changes:
Add synchronized to UidRange getter and dump methods
Deal with permission update on handler thread
Running PermissionMonitor#startMonitoring on handler thread
To ensure that permission cannot change while CS is doing works,
scoring networks, sending callbacks, etc. So making all
permission update are running on handler thread.
Bug: 232048835
Test: FrameworksNetTests CtsNetTestCases
Change-Id: I5380ec8ff1282a1056d9063848e0fff8b3a570ec
In current code, the test will call pressHome before show
network notification but it does not verify the home screen
is shown. The test might be failed due to the notification
shade is still opened. Thus adding an assertion to verify
the launcher is shown.
Bug: 255643296
Test: FrameworksNetTest:NetworkNotificationManagerTest
Change-Id: Iee3476a26030b9ba72994dee624e0e6974c9369f
Move VpnTransportInfoTest to common test to add the cts
coverage.
Annotate @ConnectivityModuleTest so that the test will
not fail with module that is not up-to-date, and use
assertParcelingIsLossless to prevent similar order module
in device case.
Bug: 256775913
Test: atest CtsNetTestCases:android.net.VpnTransportInfoTest
Change-Id: I1c40a4fc42468748d71c3df5c18b2ceb5b3769e1
NSEC records are included as mDNS negative responses, as per
RFC6762 6.1.
Bug: 241738458
Test: atest
Change-Id: I1546a2c10447ad46321f595b714c7ee7f6dc34c7
Refactor this test to make it easier to test the no-op
refactoring coming as a follow-up
Test: this
Change-Id: I47c81bdec2b8f9575835ba664b61721d5f2c69ff