Resolve service may take long time due to network issue or
using wrong service information, but users are not able to stop
it. They can only wait for the callback of resolveService to end,
which sometimes takes a long time. Thus, add the new API that
users can stop the service resolution.
Bug: 245369943
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I6b6183c8c73f8db981b9afa51fbc73bf886d9ed3
Service resolved should be notified when receive the
onServiceFound callbacks from MdnsServiceBrowserListener
Bug: 254166302
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I681720065084bf3449c5b1ab44cd4ed6a659dcdb
Service found should be notified when receives the
onServiceNameDiscovered callbacks from
MdnsServiceBrowserListener.
Bug: 254166302
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I3f41b4fe85cd85ad356fa764663187a88914412c
This commit exposes APIs to migrate a tunnel mode transform to
new source/destination addresses, as required by MOBIKE.
By calling the exposed API, the caller only caches the new
address in the transform. To complete the migration, caller
MUST apply the tranform to the appropriate tunnel.
This API design is mainly based on the kernel interface and use
cases. The Linux kernel requires Android to provide both the
IpSecTransform and the IpSecTunnelInterface to perform the
migration. And in most cases those two instances are managed
by different entities: IpSecTranform is managed by the key
exchange protocol (e.g. IKE) and IpSecTunnelInterface is managed by
the security tunnel provider (e.g. VPN, VCN, and IWLAN). Thus the
migration process has been designed to have two steps where the
key exchange protocol negotiates and caches the new address,
passes out the updated transform, and the security tunnel
provider applies the transform to a tunnel.
Another benefit of this API is it can also apply to the case
where the network peer does not support MOBIKE and thus cannot
update the existing transforms. In this case, the key exchange
protocol can create a new transform and give it to the security
tunnel provider, and the tunnel provider can still call "apply"
to perform migration without needing to know the details of the
transform update process.
Bug: 169171001
Test: atest FrameworksNetTests, IpSecManagerTunnelTest
Change-Id: I0658cdb09fb31f7e0fb9d0b07f37c2b72b6e705f
Based on documentation, String parameter to CloseGuard.open() should be the name of the method to close the resource (in this case Resource.close()).
As currently written, the debug output from warnIfOpen() will be "Resource failed to call constructor."
Bug: 131838407
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I25f005a7944bf3995ae6dc4c021ed1034f2187dd
Based on documentation, String parameter to CloseGuard.open() should be the name of the method to close the resource (in this case Resource.close()).
As currently written, the debug output from warnIfOpen() will be "Resource failed to call constructor."
Bug: 131838407
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9b8a71f9076712014bb883bbde5e5fbdb018b2d5
NetworkTemplate was moved into mainline module and
provide Builder for external users to build template.
MATCH_MOBILE_WILDCARD and MATCH_WIFI_WILDCARD are not
exposed so currently the usage of these two constants
only in module. This change is to remove the constants.
After removing the constants, two methods matchesWifi
and matchesMobile are changed to adapt the original
matches[Wifi|Mobile]Wildcard behavior.
Bug: 238843364
Test: FrameworksNetTests
Change-Id: I9e156b504ce4eb903b39279e443fad27bc921186
Currently NetworkTemplate provides Builder for users to build a
template and it supports multiple subscriber ids. The mSubscriberId
is a local variable in current design so it can be removed from
NetworkTemplate and also can be removed from the parameter of a
constructor as long as the constructor is not annotated with
@UnsupportedAppUsage.
Bug: 238843364
Test: build, FrameworksNetTests
CtsNetTestCases
Change-Id: Ic6a695e1c1719111bf26ba905a38673952a24736
Currently, mSubscriberIdMatchRule is only used in NetworkTemplate
and it depends on if mMatchSubscriberIds is empty or not. Thus,
remove it since is not really necessary and replace it with
checking matchSubscriberIds if needed.
Bug: 238843364
Test: build, FrameworksNetTests
CtsNetTestCases
Change-Id: Ic66d2ff2826846778b004bb15a4718a62fa1f470
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
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
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I7625fa386afe93823b97cb2ecb8fd09a5856c05b
Previously, the hiddenapi*-tiramisu.txt files that were created as part
of the work for creating framework-connecvity-t were just added to the
list of hidden API files on the bootclasspath_fragment. Unfortunately,
that made it impossible to exclude those when generating an sdk
snapshot for S which cannot include framework-connectivity-t.
This change moves those files to be part of framework-connectivity-t
instead of the bcpf so that they will only be used in an sdk snapshot
when the library is part of the snapshot.
Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
# Ran the previous command with and without this change to make
# sure that this change does not change the sdk snapshot
# contents. A follow up change will exclude the
# framework-connectivity-t library from the S sdk snapshot.
Change-Id: Ib5c5c6046d96b911c8e9e5ac3729ce963f1b6907
Currently, data usage of all test networks are all attributed to
the same NetworkIdentity, which does not allow services to
distinguish upload & download traffic of different test networks.
Thus, this CL put specifier that comes along with
TestNetworkAgent into wifiNetworkKey field to build different
NetworkIdentity to attribute data usage to different for
individual networks. And allow querying test network usage with
wifiNetworkKeys.
Bug: 139774492
Test: atest FrameworksNetTests
atest android.net.cts.ConnectivityManagerTest
Change-Id: I1bb38fd20781eaf3105735440a04b27bef36fcae