Add back methods that were removed in recent refactoring
(aosp/2286634). Even though they are fully @hide, some usage by
an OEM has been found on T.
Test: atest; the methods should be unused except on the OEM device
Change-Id: Icd67fb8b7e63cc131356a30a3044458ae2f5efff
Apps targeting sdk < U are considered to use a legacy native
daemon as NsdManager backend, but other apps use a
platform-integration mDNS implementation as backend. So add a
CompatChange flag to enable platform backend for non-legacy
apps.
Bug: 270306772
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I7ba58f8a5186fb49ad5f8aeacc8b8234bef1eabe
There's now a shared defaults module for this kind of filegroup. Use
that and remove the previously duplicated prop.
Bug: 271816210
Test: m
Change-Id: Ia4547984a73179fdfc98c427482dd10246f9722c
matchesWifiNetworkKey expects a non-null value of the
wifiNetworkKey, however, it might be null in practice
and the null wifiNetworkKey will be stored into disk.
And then when the matchesWifiNetworkKey is called, the
requireNonNull will crash the system. Thus, remove the
requireNonNull from matchesWifiNetworkKey to avoid
system crash and handle if the wifiNetworkKey is null
then it should not match a template with non-empty
mMatchWifiNetworkKeys.
Check if WifiInfo contains a null network key then skip it
to prevent adding the identity to the network identity set.
Also, add a Log.wtf when setWifiNetworkKey(info.getNetworkKey()),
this might be useful to catch why the wifiNetworkKey is
null.
Bug: 267815242
Bug: 266598304
Test: FrmeworksNetTests
Change-Id: I9c21f7e3dca9482133c7e331741cf808105414e9
HalfSheetUX uses private apis of framework-connectivity-t. It appears
that using just "framework-connectivity-t" will compile against either
the stubs or source of framework-connectivity-t depending on if the
module was included in the same apex as it or not.
aosp/2462194 is adding the ability to compile modules like HalfSheetUX
outside of the context of the apex, at which point it will start
compiling against stubs if we don't explicetly specify to use the
implementation library.
Bug: 254205429
Test: m javac-check with aosp/2462194
Change-Id: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
Merged-In: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
HalfSheetUX uses private apis of framework-connectivity-t. It appears
that using just "framework-connectivity-t" will compile against either
the stubs or source of framework-connectivity-t depending on if the
module was included in the same apex as it or not.
aosp/2462194 is adding the ability to compile modules like HalfSheetUX
outside of the context of the apex, at which point it will start
compiling against stubs if we don't explicetly specify to use the
implementation library.
Bug: 254205429
Test: m javac-check with aosp/2462194
Change-Id: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
Merged-In: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
registerServiceInfoCallback currently only sends updates for
addresses added, but does not handle removes (expiration) and
TXT/SRV record updates. Thus, migrate its backend to
MdnsDiscoveryManager which can support the expiration update.
Bug: 266030646
Test: atest FrameworksNetTests CteNetTestCases
Change-Id: I72add213935dc1beacb6277007868ad30bd89c00
* changes:
Add constructor which used by Android T CTS
Delete testUnsupportedAppUsageConstructor from coverage test
Add some hidden APIs back to NetworkTemplate
aosp/2241257 and aosp/2241058 are included in the mainline train
release and it causes the T device can’t pass CTS-13_R2/CTS-13_R3.
It’s because some parameters of the constructor have been removed.
Add it back to keep backward compatibility.
Test: 1. atest CtsNetTestCases:android.net.netstats.NetworkTemplateTest
2. CTS-13_R3
Fix: 269974916
Fix: 269834366
Change-Id: I197fbfb8419e4d4885a97a93a71f13d33c3f02da
Since there's a bug about apps still call hidden
APIs, it's likely some developers might build apps
against hidden API.
To be safe, add these methods back to avoid apps
crash. These methods are still in
hiddenapi-max-target-o-low-priority.txt, so they
should not be removed without considering hidden
API usage. Removing hidden API in general isn't
forbidden, but the ones listed in hiddenapi usage
need extra care.
Bug: 269178029
Test: 1. atest CtsNetTestCases:android.net.netstats.NetworkTemplateTest
2. CTS-13_R3
Change-Id: I485369274ccacd314230e3d267df665d8083bf97
There's a user still call this method which causes the app
crash and it might be the app was built against hidden API.
The bug was observed after updating the mainline module so
adding this method back to the module to avoid apps crash
due to the method is not found in NetworkTemplate.
Bug: 269178029
Test: build
Change-Id: I06dc694b1ce060488135f5d34138f14abd50ad32
A template with type MATCH_MOBILE could have empty subscriber
IDs but it should not contain one of subscriber IDs is null.
An app might still build a template through the constructor
which is annotated with @UnsupportedAppUsage. NetworkTemplate
will throw an exception when the app trying to construct a
template with type *_WILDCARD. The constructor should be
backward compatible with old version so this change is to add
the backward compatibility to have NetworkTemplate not throw
an exception.
Bug: 267701889
Test: FrameworksNetTests
Change-Id: I23a607dae508e0c53520e2edf187cb611ed36b68
mSubscriberId was removed from NetworkTemplate and equals/hashCode
does not check the mMatchSubscriberIds. This will cause tempates
with different subscriber ID matching that are equal now. Thus
adding the check for mMatchSubscriberIds to fix it.
Bug: 267968247
Test: FrameworksNetTests:NetworkTemplateTest
Change-Id: I2956bf4c8cf2c4d73ebe102d53e755fbcc5d7642
ConnectivityCompatChanges.java becomes the centralized place for all the
CompatChanges used in the Connectivity module. By putting all the
CompatChanges here, we are able to manage them under a single
platform_compat_config.
Bug: 268440216
Test: atest FrameworksNetTests
Change-Id: I3e17af545718073d7d1c96e27298e7790563fd33
Rename the method onResolveStopped(NsdServiceInfo) to
onResolutionStopped(NsdServiceInfo) for consistency as API
review feedback.
Bug: 266811051
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I788b5903ecaf78a9aa960dd3b7413a22f171c72f
Currently, the resolution is a one shot query, it only notifies
the first finding service information. There is no way to listen
the service update. Thus, add a new API that can register a
callback to listen to the service updates continuously.
Bug: 245369943
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I0e9d92b9028375feb3e344ab6c4acb515c5b2be9