This adds a null-check to verify that we got real data before
trying to use it and increases the timeout time to reduce the
likelihood of timing out.
Test: FrameworkServicesTests
Bug: 33836034
Change-Id: Ia1ad4aba05c5c4fb8688fc9fc94df344f736e396
This adds a new service which opportunistically saves the
file system categorization information and the app sizes. This
information is fetched during a diskstats dumpsys call from a file
stored on the disk. This allows us to keep the dumpsys running quickly
while adding information which is costly to calculate.
Bug: 32207207
Test: System server instrumentation tests
Change-Id: Id59e84b9ad38a9debf3e46e5133ef06f7353829d
The app collector gets a list of app sizes for packages on a given
storage volume. This information will be exposed as part of an
expansion of the diskstats dumpsys.
When the collector runs, it sets up a handler on a BackgroundThread
which asks the PackageManager for the package sizes for all apps and
all users. The call for the information is blocked using a
CompletableFuture until the call times out or until we've received
all of the package stats. After the stats are all obtained, the
future completes.
Bug: 32207207
Test: System server instrumentation tests
Change-Id: I3a27dc4410effb12ae33894b561c02a60322f7b0
The file collector takes in a file path and recursively
classifies and provides the amount of storage provided by
each classification. This information can be surfaced in
Settings or to fulfill storage telemetry calculations.
Bug: 32207207
Test: System server instrumentation tests
Change-Id: Iff03260859cd4bbd11e7d60b1825115aad540d48
This patch changes NetworkNotificationManagerTest to populate extraInfo
of NetworkInfo in order to catch regressions in malformed format Strings
of log statements in NetworkNotificationManager.
Test: verified that the test fails when reintroducing the format String
bug.
Bug: 33737715
Change-Id: If14063554b8246d9d80cd222cb41c30dee121c5a
* changes:
DO NOT MERGE IP Connectivity metrics: add connect() statistics
DO NOT MERGE Fix IP connectivity metrics tests
DO NOT MERGE IP connectivity metrics: introduce ConnectStatistics and DNS statistics
DO NOT MERGE IP connectivity metrics: add transport field.
This patch adds a ConnectStats class to aggregate connect() statistics
gathered in NetdEventListenerService. ConnectStats is uploaded once a
day by IpConnectivityMetrics.
Test: $ runtest frameworks-net + new unit test
Bug: 32198976
(cherry picked from commit 4f71a15973f7048076ed10f63d708f020e1a21e0)
Change-Id: I1450c126b90b628d9f1c73ddf054b4742f5e84c5
So that test assumptions match previous changes in ipconnectivity.proto.
This patch also tags metrics tests with @SmallTest.
Test: $ runtest frameworks-net
Bug: 32561414
Bug: 32198976
(cherry picked from commit 80df43ea8a4286f2b7e0678be35dbca3f16f3766)
Change-Id: I8926a92248ac2d46fc78749afc40bc5f0de10878
This CL follows up on ag/1530343 and adds:
1) Various network events.
2) Retrieval method in DPM and APIs in DeviceAdminReceiver.
3) Extension of NetworkLogger and it's NetworkLoggingHandler.
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Bug: 29748723
Change-Id: I42a1a477e7c75c109a3982f809c22732b814e8b2
This CL adds:
1) Setter and getter in DPM to manipulate logging switch (retrieval
method to come in a subsequent CL(s)).
2) A way for DPM to register to listen for events.
3) Skeleton of NetworkLogger class (more to come in subsequent CL(s)).
Bug: 29748723
Change-Id: I5c04662ccc6febd2ba294b0eaca1ed1da9c16e47
This patch uses the previously introduced TokenBucket to rate limit
ApfProgramEvents, still allowing for burst of ApfProgramEvents when a
new interface is set up (due to ipv4 provisioning, multicast lock, ipv6 RAs
triggering new APF program events in short amounts of time).
Test: new test in IpConnectivityMetricsTest
Bug: 1550402
(cherry picked from commit e1c173d2240a8eedf7685c9371087dc047a6931f)
Change-Id: Ibe41e9a76db36ea502697a5f19fc0d91c40a3087
Test: IpConnectivityMetricsTest passes. Also manually changed the new
setting and verified the buffer size is as expected after flushing the
buffer.
Bug: 32198637
(cherry pick from commit 05686dbb6b965eb1a54591d2ed2334337886c6ee)
Change-Id: Ie7ca1638533479601c5983bb6e54705003561b6c
This patch adds a version field to ipconnectivity.proto and populates it
to 2, which is the logical version number for NYC-MR2.
Test: IpConnectivity{EventBuilder,Metrics}Test pass
Bug: 32127906
(cherry picked from commit d680d4c856f54bea0c60dea74ba4204822391e49)
Change-Id: I5f37633afd9ec82f5402c5b6670fe2febae82a14
Test: new unit test + $ runtest franeworks-net
Bug: 32833400
(cherry picked from commit f98182ef5e80ede5de7f2c2a5f40fc92a46c9704)
Change-Id: I4c46304b9dc8105123fc02a29f99dbc835248eb0
Location providers may erroneously return (0.0, 0.0) when they
fail to determine the device's location. These location updates
can be safely ignored since the chance of a user actually being
at these coordinates is quite low.
Bug: 31009261
Test: added TwilightServiceTest; both tests pass
Change-Id: Ie9d7d10f81ade9b0be10f98ed74978539efaa658
This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.
Test: for now just the benchmarking, in the future unit and CTS
Bug: 29748723
(cherry picked from commit 14c9d2d0df7fab2b0470c3c404f600d87d4f0f93)
Change-Id: I3941b8d6fc1dd578e2af6ed4d3c3d0a722c39918
The service will be extended to include listening for connect events as well.
Test: this is just a renaming change
Bug: 29748723
Change-Id: I073187e354fc987222ec0108d7f0d3a422397d5e
When restoring to a new device, if a restored app is not compatible
with the old version (e.g. lower version or different signature),
then we won't restore shortcuts, which is working as expected.
However when it happens, the shortcut manager forgot to "un-shadow"
the package information, causing the app to not have shortcuts at all.
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Bug 32999759
Change-Id: I89832360114de0ce1c57d763bcaccab4fdb87b6d
Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699
Change-Id: Ibe63942da04748ab0406e24e0f44be31d47710a0
(cherry picked from commit be96da11ccb5dd500f920c3ba90d350857293b3d)
The admin can instead use the value of 0 to reset to default.
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
Bug: 31430135
Change-Id: I0d6b29ca4eca65d7ca72a8975a0c28c9050a946c
(cherry picked from commit 943aabd11cce3ab453762d3912395363720e1f5d)
This patch adds an explicit check in the DHCP packet parser for
rejecting packets without a magic cookie, instead of relying on the
top-level try-catch-all in the parser.
This allows to add to DHCP error metrics this specific error.
It also allows to add two poor man's fuzzing tests that tries to find
additional gaps in the DHCP packet parser by
- trying to parse all subslices of a valid offer packet.
- trying to parse random byte arrays.
Test: covered by previously introduced malformed DHCP packet unit tests
+ additional fuzzing tests.
Bug: 31850211
Change-Id: If53c9ba9df78d7604ec018c9d67c237ae59c4833
This patch adds a try catch all to DHCP packet parsing so that
DhcpClient does not choke on malformed packets, brinding down with it
the whole framework.
Test: added new unit tests catching the issue fixed in this patch.
Bug: 31850211
Change-Id: I3c50a149fed6b2cbc4f40bb4f0e5bb2b56859b44
Additionally, add this utility class to IpManager for compatibility
verification. A follow-on CL will make use of IpManager's local
AvoidBadWifiTracker.
Bug: 31827713
Change-Id: If8c56c3f8076d6a5157ea180e361bbdadc2bc1dd
This patch adds the possitibility to send a 3rd fallback validation
probe in sendParallelHttpProbes when neither the 1st http probe nor the
https probe came back with a conclusive answer.
This 3rd probe is only used for trying again captive portal detection
and does not return success, so that network validation always fails if
the https probe fails.
In addition, the url reveals a captive portal is now sent to the
CaptivePortalLoginActivity so that all three probes can use different
urls.
Bug: 29367974
Change-Id: I7385fde1aa1316d94aac350af0e956cb193aa4ee
This patch connects existing IpConnectivityLog to the new
IpConnectivityMetrics service:
- IpConnectivityLog is now an independent class that pushes events
directly to the new IpConnectivityMetrics service.
- DnsEventListenerService is moved from MetricsLoggerService to
IpConnectivityMetrics.
- this patch also features end to end tests from IpConnectivityLog to
IpConnectivityMetrics dumpsys output.
Bug: 31254800
Change-Id: I4fe4a209eedde2814d5f13c574a1a0d854bd05c9
This patch moves ipconnectivity.proto and companion serialization
classes from /vendor/google/app/ConnectivityMetrics into the framework
services jar.
This will allow to implement a dumpsys interface for IpConnectivity
metrics events defined in android.net.metrics that output metrics as
a serialized proto.
Bug: 31254800
Change-Id: Ia4449103fd7222c9d899352fea2dce47a790a49c
This patch transforms the IpConnectivityLogTest to test instead the base
class ConnectivityMetricsLogger.
The current test will not be relevant anymore after b/31254800 is
resolved.
Bug: 31254800
Change-Id: I8dc3374450e5f1f87ab1e6f372ad2d2beb25dc48
This contains the following changes:
1. Make NETWORK_AVOID_BAD_WIFI a tristate: 0 means never avoid
bad wifi, unset means prompt the user, 1 means always avoid.
2. Look at NETWORK_AVOID_BAD_WIFI only if the carrier restricts
avoiding bad wifi (previously, we relied on the setting being
null and defaulting to the value of the config variable).
3. Add an avoidUnvalidated bit to NetworkAgentInfo to track
whether the user has requested switching away from this
unvalidated network even though avoiding bad wifi is generally
disabled. This is set to true when the user selects "switch"
in the dialog without setting the "Don't ask again" checkbox.
4. Add a hidden setAvoidUnvalidated API to ConnectivityManager to
set the avoidUnvalidated bit.
5. Additional unit test coverage.
Bug: 31075769
Change-Id: I1be60c3016c8095df3c4752330149ce638bd0ce1
- It was (theoretically) possible for shortcut manager to update
the version code for a publisher package without rescanning manifest
shortcuts, if backup happens right after unlocking a user before
SM searches for updated packages. If it happens, then SM will not
scan the manifest for this package until it's updated next time.
So don't refresh the version code during backup, which we only
have to do for launchers but not publishers.
- Also fix the owner-user-id for launchers. (Luckily it's not causing
any issues.)
Bug 31402152
Change-Id: I5d898eb3882b74edaca8b2d5f960849370ffc23b
When IPv4 is provisioned on an interface with Apf capabilities,
ApfFilter will only keep track of the raw ipv4 address, with no
information about the subnet or prefix length.
This patch adds the missing prefix length information to ApfFilter. This
allows to calculate the subnet broadcast ipv4 address for more
precise ipv4 broadcast filtering when the multicast lock is not held.
Bug: 30231088
Change-Id: Iebaec040703647c4ced30bb585be173e97a1fae5