History log of /frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
281a17c9580de5c9898be7d9654d428801976511 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> De-guava BroadcastInterceptingContext and move it to testutils.

Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
a3f828ba3079408543091a4ccd6c11896ec4e0c7 19-Mar-2014 Ashish Sharma <ashishsharma@google.com> Update the tests to deal with the new timestamps in idletimer module.

Change-Id: I1a8368d84ef806f1501b0a1f5e817388a1d10518
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
64483947fdb03bf838e317ac0a4af5e0f53a5bbf 15-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Add address flags and scope to LinkAddress.

This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
Since most callers don't know about flags and scope, provide
constructors that default the flags to zero and determine the
scope from the address. Addresses notified by the kernel will
have these properly set. Make multicast addresses invalid.
Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
address and prefix information between two LinkAddress
objects. This is necessary because an interface can't have
two addresses with the same address/prefix but different
flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
to identify existing addresses to add/remove using
isSameAddressAs instead of implicit equals(). Specifically:
- If addLinkAddress is called with an address that is already
present, the existing address's flags and scope are updated.
This allows, for example, an address on an interface to go
from preferred to deprecated when it expires, without it
having to be removed and re-added.
- If removeLinkAddress is called with an address that is
present but with different flags, it deletes that address
instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
notification methods to take just a LinkAddress instead of
LinkAddress, flags, and scope. While I'm at it, change the
order of the arguments for consistency with the other
functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
5ad421a3d00c92c155d57af9d1a05d81cc2fa88f 17-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Use LinkAddress in address notifications.

Currently address{Updated,Removed} pass in the address as a
string such as "fe80::1/64". Use LinkAddresses instead, since
that's what it is.

This makes the code more robust in the unlikely case that netd
passes in an invalid string. In the future we can move flags and
scope into the LinkAddress itself and simplify the code further.

Bug: 9180552
Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
5ae4a531cc31be2868f65c40e8636658f1ae2f06 31-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Pass DNS server info notifications to observers.

These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

[Cherry-pick of 416740ad4d9132005a71dc0883334e852235a18a]

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
a9626c1c956f51e7b4cb783d70b75abc3b180a00 04-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Minor cleanups to NetdCallbackReceiver.onEvent.

- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

[Cherry-pick of 59be800e7fe81842aa8c77b91319f58ab165983d]

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
7421a01f18f34d554ca7a9fd987c4f96da2bdf2f 20-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Add a simple test for NetworkManagementService.

For now, this only tests network observers. It works by starting
NetworkManagementService with a fake netd socket, feeding it
inputs, and seeing if the appropriate observer methods are
called.

Bug: 10232006
Change-Id: I827681575642a4ee13ae48b81272521544b676bd
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
1059c3c30ad96a15695c1a92ae8896e078a6309f 05-Oct-2011 Jeff Sharkey <jsharkey@android.com> Move battery stats to xt_qtaguid for data stats.

Replace TrafficStats calls by reading values from xt_qtaguid kernel
module. To keep BatteryStatsImpl changes lightweight, cache recently
parsed stats. Tracks mobile ifaces from ConnectivityService.

Refactor xt_qtaguid parsing into factory outside of NMS. Add stats
grouping based on UID, and total based on limiting filters like iface
prefix and UID.

Bug: 4902271
Change-Id: I533f116c434b77f93355bf95b839e7478528505b
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
ae2c1810839430c84e4a1172580d9c4b18f568ca 04-Oct-2011 Jeff Sharkey <jsharkey@android.com> Read iface stats from single proc file.

When available, use single "iface_stat_all" file instead of reading
values from dozens of files scattered across proc. Tests to verify.

Bug: 5397840
Change-Id: I0247be518436c1f79b32c4b72216739f49a9e8cc
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
98a4f7e7e12effb78b3d1035e5a670ccbbf5bca1 03-Sep-2011 JP Abgrall <jpa@google.com> NetworkManagement SocketTagger: Migrate QTagUid support to JNI.

* Instead of javaland trying to write commands to
/proc/net/xt_qtaguid/ctrl
use the libcutils/qtaguid.c support via JNI.
* Get rid of tagToKernel() handled by qtaguid library.

Requires libcutils changes from c/132538/

Change-Id: I9de5b3fa4a596c56835024c6d376769a0eea7db1
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
0fea823673e9cab24bd16a1c80a9bd689fc7a6f9 01-Sep-2011 Jeff Sharkey <jsharkey@android.com> Selectively add stats based on iface active state.

Only combine /proc/net/dev and xt_qtaguid stats when iface is marked
as active. When inactive, only return xt_qtaguid stats. When iface
is unknown to xt_qtaguid, always pass through /proc/net/dev stats.

Bug: 5242730
Change-Id: I469fc6abe45309f794afebca814cbb39e4f13af5
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
47eb102b40cd1324d89816a7fb0fecd14fd7a408 26-Aug-2011 Jeff Sharkey <jsharkey@android.com> Always splice historical data stats, debug info.

When reading network counters, always splice in xt_qtaguid values
to avoid counting backwards. Test to verify.

Remove verbose logging around global alerts, and add dumpsys debug
info for NMS and MDST. Also fix subtle bug around stats persisting
and dumping.

Bug: 5212893, 5211028
Change-Id: I783e5286637a67ee2dd2b09878198711a926d0cb
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
b5d55e302d2253e4bfb233ea705caf258cdc4cb9 11-Aug-2011 Jeff Sharkey <jsharkey@android.com> Foreground/background network stats using sets.

Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background. Add AID_NET_BW_ACCT to
system_server so it can control counter sets.

Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage. Persisting still clusters by identity,
since that is heaviest object.

Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.

Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
a63ba59260cd1bb3f5c16e395ace45a61f1d4461 20-Jul-2011 Jeff Sharkey <jsharkey@android.com> Add operation counts to network statistics.

Provide API to increment "operation counts" for a UID and tag, used
to eventually derive bytes/operation stats. Internally is stored at
network layer, but should belong at data layer. Switch profiling
to use data layer stats, which are emulated by summarizing network
layer details.

Read packet counts from new /proc/ columns and collect them into
NetworkStatsHistory. Prevent double-counting by ignoring values from
first snapshot. Watch for duplicate /proc/ entries. Update tests
to verify packet and operation counters.

Bug: 5052136, 5097392
Change-Id: I1832f65a2b8a9188f8088f253474a667c21a2f09
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
fd8be3e5e7420f3cca591daeec8a44487f5f65aa 11-Jul-2011 Jeff Sharkey <jsharkey@android.com> Return stats from inactive ifaces, packet counts.

When an iface goes inactive, xt_qtaguid maintains historical counters
instead of discarding. Now reading and returning those values in
NetworkManagementService summary calls. Tests to verify stats are
returned.

Modify NetworkStats to include rxPackets and txPackets values, and
move to Entry to eventually hide internal storage details.

Bug: 4984539
Change-Id: I1ba0bb5580c62e946d9dff2cc2a6f64aff403efc
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
8568db534118fc14cc28100306d51626464ff319 29-Jun-2011 Jesse Wilson <jessewilson@google.com> Move socket tagging from libcore.

Change-Id: I7515896936c5bbd212c88e2801b831914219a925
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java
4414cea13908b8230640f84ef39603d68ff9c377 25-Jun-2011 Jeff Sharkey <jsharkey@android.com> Better network stats parsing, integer tags, async.

Change NMS parsing to handle extended /proc/ stats formats by pairing
values with header keys. Move TrafficStats to integer tags to match
kernel internals, and offer well-known tags for system services.

Async policy event dispatch from NPMS, and update tests to block for
event dispatch. Narrow app policy to exclude apps signed with system
key, which are usually critical.

Bug: 4948913, 4903489, 4585280

Change-Id: Idb357227ccaa617906411f309371cea18d7bc519
/frameworks/base/services/tests/servicestests/src/com/android/server/NetworkManagementServiceTest.java