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
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
* 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
This is a chery-picked commit from internal branch which is to
add nullability to reslove the nullness suppression.
Bug: 242631897
Bug: 254155029
Test: atest FrameworksNetTests
Change-Id: I289b0408c0c4ccdefc498d3b6d3f381c2b04132e
Currently 5G usage includes both metered and unmetered usage.
To support 5G unmetered usage metrics, unmetered usage should
be separated from the 5G usage. Thus, ConnectivityService needs
to inform NetworkStatsService if TEMPORARILY_NOT_METERED has
changed. Then NSS will count temporarily not metered usage as
unmetered.
Bug: 222339311
Bug: 183776809
Test: FrameworksNetTests:ConnectivityServiceTest
Change-Id: I0c7e1eb98925184f36e322e09b4d3d8c6f056fa6
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
This change addresses comment from aosp/1784390 to improve test
Bug: 200454911
Test: FrameworksNetTests:NetworkTemplateTest#testMobileWildcardMatches
Change-Id: Ia0ac9e44d12e7c9e26cf46adaa26a2e2771947d0
registerSystemDefaultNetwork now can be accessed via
CONNECTIVITY_USE_RESTRICTED_NETWORKS, there is no need
to mock NETWORK_SETTINGS prior to test.
Test: atest com.android.server.ConnectivityServiceTest
Change-Id: I408094959286f3782496ce7f356f84a6a47c0902
Some callers (e.g. iwlan) need to learn about system default
network but they cannot have NETWORK_SETTINGS permission.
To allow them to use this API but prevent from misuse by
unprivileged apps, enforce USE_RESTRICTED_NETWORKS for this API.
Test: atest com.android.server.ConnectivityServiceTest#testRegisterPrivilegedDefaultCallbacksRequireNetworkSettings android.net.cts.ConnectivityManagerTest#testRegisterNetworkCallback
Fix: 242456635
Change-Id: I80ab27445af874328c9c0f4814a8fbf035ae5df4
This use was checked in after the cleanup that changed the latter into the former
Bug: 157405399
Test: FrameworksNetTests
Change-Id: I2b27ad712ee218322209bbc6af6e8147a0a41430
This change adds testing for VPN MTU calculations, and in particular
cases where IPv6 is not supported due to MTUs being too small.
Bug: 245612827
Test: atest FrameworksNetTests:VpnTest
Change-Id: Ib064e6670244cf3b53b5d03bd62c86b2139ff32a
Fix the policy leak by deleting forwarding policies when deleting
the IPsec tunnel interface.
Bug: 254566085
Test: atest IpSecServiceParameterizedTest (new tests added)
Change-Id: I29dd4810abb978fe886776b2fbacdfc74325436d
The interface index is only propagated if there is an A/AAAA
record in the response. Since the responses here are not entirely
controlled in the test, we just want to verify that we get a
response with the target we expect.
Verified by running the test 1400 times via --runs_per_test flag.
Bug: 254155029
Fix: 255922416
Test: atest MdnsSocketClientTests#startDiscovery_andPropagate\
InterfaceIndex_includesInterfaceIndex --iteration 100
Change-Id: Icb0fe7a58a1e626b7f781ff24c2389a3095d4dc6
aosp/2267683 adds the new param "mark" in generateIpv6Address and
TestDependencies#generateIpv6Address needs to override for this change
correctly.
Change-Id: Ia526bcdf80a428948d55a28bd5adec405530a634
Test: TH
Add tests to verify ike session being triggered when data stall.
Bug: 238692379
Test: atest FrameworksNetTests
Change-Id: I656ea0973072b0bbdd54863eccbe105adb02d6ad