Restricted mode allowed reasons are not considered in power and data usage restriction rule updates.
This could result in sending the wrong network state to apps.
Bug: https://issuetracker.google.com/issues/206947902
Change-Id: I5e616fd1e9a916ad9a367b4391c85c1febbf1f6b
In the current design, the transport types of metrics won't be
updated when the underlying network of VPN is changed.
Update the transport types of metrics when getMetricsForNetwork()
is called.
And since the underlying network is changed, enforce to collect
the pending metrics before updating the transport types.
dns/connect events:
// The original underlying network is wifi, but now it's replaced
by mobile data.
ConnectStats(netId=105, transports={0, 4}, 0 events, 0 success, 0 blocking, 0 IPv6 dst)
DnsEvent(netId=105, transports={0, 4}, 4 events, 4 success)
network statistics:
// Wifi is the underlying network of VPN
{netId=105, transports={1, 4}, dns avg=488ms max=633ms err=0.0% tot=2,
connect avg=0ms max=0ms err=0.0% tot=0,
tcp avg_loss=0.0% total_sent=0 total_lost=0, tcp rtt=0ms, tcp sent-ack_diff=0ms}
// Mobile data is the underlying network of VPN
{netId=105, transports={0, 4}, dns avg=633ms max=633ms err=0.0% tot=1,
connect avg=0ms max=0ms err=0.0% tot=0,
tcp avg_loss=0.0% total_sent=0 total_lost=0, tcp rtt=0ms, tcp sent-ack_diff=0ms}
Bug: 189166339
Test: Manual test.
Change-Id: I9b1d0c635f30d0c88d85777d820b15e546bda60b
NetworkTemplate with MATCH_CARRIER can be created in NPMS,
and can be backup by SettingsBackupAgent. However, since
the meteredness is not stored in the backup. After incorrectly
deducing from match rule, meteredness always becomes
METERED_ALL after restoring from backup.
This change also adds debug log if any non-persistable template
is being backed up.
Test: TH, dedicated test is included in the follow-up CL.
Bug: 204830222
Change-Id: I865b1d6e571ed998a75b776f01afc7c2534af2dc
When the default gateway is not used in IP configurations,
for example the gateway info in ip configurations was fed with
custom gateway address
```
out.writeUTF(GATEWAY_KEY);
out.writeInt(0); // Default route.
out.writeInt(1); // Have a gateway.
out.writeUTF(staticIpConfiguration.getGateway().getHostAddress());
```
A NPE occurred.
When there is no destination, assume it is default route and use
the gateway address in all cases.
Test: manual
Change-Id: I5904efad5d277de6724f81d99e62c21ff8347caa
Signed-off-by: gary-wzl77 <gary.wang@canonical.com>
When the NetworkStatsProvider reports alert/limit reached,
NetworkStatsService will relay the event to other services
such as NPMS or NMS. The identity should be cleared before
calling into other services.
Test: TH
Bug: 181106917
Change-Id: I2a7b273dc30156a84b30566319894ec3a42d4429
Set MOUNT_FLAG_VISIBLE_FOR_READ for StubVolumes that are not specified
to be visible so that they are indexed by MediaScanner, but no "Android"
directory is created inside them.
Bug: 206019156
Test: StubVolumes not specified to be visible are mounted with the flag
Test: MOUNT_FLAG_VISIBLE_FOR_READ.
Change-Id: I6b8f4a498651d996e57dff45f4875dd05f786086
Currently, VolumeInfo.isVisibleForUser(), VolumeInfo.isVisibleForRead(),
and VolumeInfo.isVisibleForWrite() are all equivalent; all of them just
mean that the volume has MOUNT_FLAG_VISIBLE.
This CL splits MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_READ and
MOUNT_FLAG_VISIBLE_FOR_WRITE. They correspond to isVisibleForRead() and
isVisibleForWrite(), respectively, whereas isVisibleForUser() is now
defined as isVisibleForRead() || isVisibleForWrite().
Accordingly, all usages of MOUNT_FLAG_VISIBLE are replaced with
MOUNT_FLAG_VISIBLE_FOR_WRITE, and all usages of isVisibleForRead() are
replaced with isVisibleForUser().
Bug: 206019156
Test: m
Change-Id: I576430680620363f4fbe49787035bd52445b3554
Merged-In: I576430680620363f4fbe49787035bd52445b3554
Instead of computing uid rules separately by potentially calling
into other system services, use blocked reasons to derive the
uid rules for informing the listeners. Once we migrate the clients
to use NetworkPolicyCallback, we can remove uid rules entirely.
Bug: 202065802
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: Ifc3708c16ae7cf4d7ff26eac0ba1c6fbeb7ed7d9
Merged-In: Ifc3708c16ae7cf4d7ff26eac0ba1c6fbeb7ed7d9
Set MediaFormat based on bitDepth and bitDepthAllocated.
Validate semiplanarness of chroma planes.
Bug: 206456921
Test: atest android.media.cts.ImageReaderDecoderTest
Change-Id: I88145d7eb9d372deb02ca2d633eebe087f7c4733
Since the jarjar solution was introduced, api_srcs support was
added back to java_sdk_library. Migrate to that.
Aside from the slightly simpler setup, I also noticed the jarjar-version
left some *.uau and *.xml files in the output jar.
Test: diff jar before and after
Change-Id: I9724cce159ea4f1b882505f589a9cfe17a880514
This makes art/build/boot/boot-image-profile.txt +
frameworks/base/boot/boot-image-profile.txt identical to
frameworks/base/config/boot-image-profile.txt, so we can rule out
performance regressions due to profile changes in
https://r.android.com/1896660.
Test: presubmits
Bug: 207590908
Change-Id: I599e8df8818d2d2dc9f471fdc22c9d92719e6cae
Move UnderlyingNetworkRecord to a spearate file, and
move calculatePriorityClass to a new class NetworkPriorityClassifier.
This is a preparation CL to support vcn routeselection with
configurable network priority classes and network metric
monitors.
Bug: 206044122
Test: atest FrameworksVcnTests, CtsVcnTestCases
Change-Id: I88aa9e8dcf01524ddce9f913f40a4c712f8c878d
When empty the usap pool, the usap processes may be blocked by
usapPoolSocket.accept(), which cause the usap process fail to kill
immediately. So we can move the position of blockSigTerm after
usapPoolsSocket.accept() and delele the old blockSigTerm in the while
loop.
Test: manual test.
1.setprop persist.device_config.runtime_native.usap_pool_enabled true.
After 1 min, trigger fill usap pools.
2.setprop persist.device_config.runtime_native.usap_pool_enabled false.
After 1 min, trigger empty usap pools.
3.repeat step 1.
Signed-off-by: zhangjianqiu <zhangjianqiu@oppo.com>
Change-Id: I657940b30f71cdc717c673be6d70738e61e2bb68
Devices upgrading to S are not required to update their memtrack HAL
implementation and won't support reporting the total GPU private memory.
In these cases it's likely the HAL reports 0 for the total GPU private
memory, since in S the HAL defition only overloads the already existing
getMemory() API to report this.
Return an error value in these cases to prevent swapping the sum of GL
type memory for all processes with the total GPU private memory when not
supported as doing this effectively leaves the GL memory as part of
lost RAM.
Bug: 203245390
Test: dumpsys meminfo
Change-Id: I478143e435b047bf349bd4ec6808707a5db1505b
Extend the API to be able to check NFC event permission based on userId.
Update API naming.
Bug: 192994529
Bug: 201235792
Test: manually with CtsVerifier
Change-Id: I5dbf3af6f10063f47cf570ba3148d0ef9eb7a4e1
Bind to the TvInputService even if TvInputService
calls addHardwareInput(), addHdmiInput(), or
removeHardwareInput().
Bug: 207301256
Test: manual
Change-Id: I91cdf49f9ff1af240b5d87cec02e95ae305cf46f
StorageManagerService and AppFuseBridge are used
NativeDaemonConnectorException to represent app fuse mount
failure. But NativeDaemonConnectorException is part of NSD
module files and it will be moved to the Connectivity module.
Thus, create AppFuseMountException to separate the usage and
make the exception more precisely.
Bug: 206702844
Test: m
Change-Id: I8b0224ce8894bc68b082dcdba054e2ccc22869ef