660093 Commits

Author SHA1 Message Date
paulhu
4e690dd40d Centralize nsd associated files
Move all nsd associated files include framework, service and test
to package/Nsd first. After clear all hidden API dependencies, we
can easily migrate these files into connectivity mainline module.

Bug: 206893064
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Id26f471a10fe7882e31ccc2dbb73219461f00dbd
2021-11-29 23:08:06 +08:00
Treehugger Robot
4c1e2a20ca Merge "Update vibrator file owners" am: fcab8baf60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1905230

Change-Id: Ie0f0dc75410cec10173fdb99e8eebb50b24c04ea
2021-11-29 14:53:50 +00:00
Hao Ke
b67fc38355 Adding typed Parcel readParcelableList API.
Added typed Parcel readParcelableList API that takes extra clazz
parameters check that the class written on the wire is the same,
or a descendant from the one provided as the key and value arguments.

Doing so could enhance the security of Parcel deserialization,
as it would prevent unexpected types of objects being deserialized.
More details can be found at go/safer-parcel.

Test: atest -d android.os.cts.ParcelTest
Bug: 195622897
Change-Id: Ibdb90fa622ef6eaa0bd2b9de629f51fc4fa7091a
2021-11-29 14:48:25 +00:00
Treehugger Robot
fcab8baf60 Merge "Update vibrator file owners" 2021-11-29 14:32:13 +00:00
Lais Andrade
2447152914 Update vibrator file owners
This should include the missing file VibrationAttributes as well.

Change-Id: I041fc01bba70da46004f27e9dd4fafdef7768ba3
2021-11-29 13:13:14 +00:00
Treehugger Robot
87147e2710 Merge "Create memory safe overload of BluetoothGattServer#notifyCharacteristicChanged" am: f33e7ff081
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1894087

Change-Id: I0df291e73939c18883e9e44f084d3ffaa6937d2a
2021-11-29 08:02:21 +00:00
Treehugger Robot
9078248b75 Merge "Fix an issue when empty the usap pool." am: faf1b1cf0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: I6d5e04471f756ee5544bb1f77cf1927f44d7715a
2021-11-29 08:00:57 +00:00
Treehugger Robot
f33e7ff081 Merge "Create memory safe overload of BluetoothGattServer#notifyCharacteristicChanged" 2021-11-29 07:49:09 +00:00
Treehugger Robot
faf1b1cf0b Merge "Fix an issue when empty the usap pool." 2021-11-29 07:46:36 +00:00
Treehugger Robot
fc7e697e4c Merge "Print anonymized address when new profile update" am: 286d24fd0d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1903973

Change-Id: I10a0a068f8a53b2df246dde20cddcdddad4ff0b1
2021-11-29 05:28:33 +00:00
Treehugger Robot
286d24fd0d Merge "Print anonymized address when new profile update" 2021-11-29 05:04:20 +00:00
Treehugger Robot
bf6cc67976 Merge "Fix that AccessibilityServiceConnection#serviceInterface may be invalid in the async" am: 700fb9ebeb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1870459

Change-Id: I83ebfd13525cbd567d16eef6b2201a9956bbf292
2021-11-29 04:28:05 +00:00
Treehugger Robot
700fb9ebeb Merge "Fix that AccessibilityServiceConnection#serviceInterface may be invalid in the async" 2021-11-29 04:02:12 +00:00
Chienyuan
2645fa289d Print anonymized address when new profile update
Bug: 206676415
Test: manual
Change-Id: Ia65cb0a4310158583bfb6b025888b0b76aa76966
2021-11-29 11:03:07 +08:00
Oliver Scott
0b4cafdae8 Fix the case where restricted mode allowed reasons are ignored
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
2021-11-27 15:36:08 -05:00
Treehugger Robot
13a74e1f60 Merge "Fix work profile applications do not receive event transaction data" am: 67bf96eac9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1838431

Change-Id: Ib6e5532e0ab81d6ae17f46504f33602c999c743d
2021-11-26 13:50:43 +00:00
Treehugger Robot
67bf96eac9 Merge "Fix work profile applications do not receive event transaction data" 2021-11-26 13:32:11 +00:00
lucaslin
4eb3a8a966 Update the transport types of metrics
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
2021-11-26 17:14:43 +08:00
Chalard Jean
eec8e24ef3 Merge "net: fix NPE when reading IP configurations" am: eed1a20c65
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1879657

Change-Id: I9ad5d7bdb2c9aa08bcfeca78c0a4858101f28444
2021-11-26 07:23:37 +00:00
Chalard Jean
eed1a20c65 Merge "net: fix NPE when reading IP configurations" 2021-11-26 07:04:34 +00:00
Treehugger Robot
3ac404a52d Merge "[MS06] Add carrier template fields into cloud backup/restore" am: bf424ed534
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1892336

Change-Id: I65e9824a56727bd6a2386b2c6407fe407060d43c
2021-11-26 05:26:27 +00:00
Treehugger Robot
bf424ed534 Merge "[MS06] Add carrier template fields into cloud backup/restore" 2021-11-26 05:07:26 +00:00
Treehugger Robot
6d27f88ec2 Merge "Clear calling identity when notifying alert/limit reached" am: a4df58705c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1896540

Change-Id: If2b8b6e8b8856d6db2aa167484c71163e06828c2
2021-11-26 03:47:01 +00:00
Treehugger Robot
a4df58705c Merge "Clear calling identity when notifying alert/limit reached" 2021-11-26 03:28:58 +00:00
Treehugger Robot
5dc7e50d24 Merge "Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}" am: b6f19328d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891615

Change-Id: I2aaee0d7eae200481bafd21d3082222412c998bd
2021-11-26 03:23:23 +00:00
Junyu Lai
4af17682d4 [MS06] Add carrier template fields into cloud backup/restore
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
2021-11-26 03:04:37 +00:00
Treehugger Robot
b6f19328d5 Merge "Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}" 2021-11-26 03:02:16 +00:00
gary-wzl77
91333788a0 net: fix NPE when reading IP configurations
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>
2021-11-25 22:05:31 +08:00
Junyu Lai
4c1bcbcabf Clear calling identity when notifying alert/limit reached
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
2021-11-25 06:53:52 +00:00
Sudheer Shanka
41fc427c40 Merge changes Ifc3708c1,If07045c1 am: 61c79dbc8d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1902411

Change-Id: Ibeaec84460b6953ce6567e8694f3d1593d714253
2021-11-25 04:48:16 +00:00
Sudheer Shanka
72e61c83bf Include blocked reasons in the netpolicy dump. am: 6a0976aa75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1902410

Change-Id: Icbe093e03734b0e560497112b72e11c238ad8824
2021-11-25 04:48:12 +00:00
Sudheer Shanka
61c79dbc8d Merge changes Ifc3708c1,If07045c1
* changes:
  Remove uid rules computation in NPMS.
  Include blocked reasons in the netpolicy dump.
2021-11-25 04:28:56 +00:00
Youkichi Hosoi
564e1f86da Make StubVolumes visible for read
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
2021-11-25 13:04:35 +09:00
Youkichi Hosoi
9b033785ae Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}
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
2021-11-25 13:04:34 +09:00
Sudheer Shanka
2d17572eca Remove uid rules computation in NPMS.
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
2021-11-25 03:10:16 +00:00
Gopalakrishnan Nallasamy
655ca9f343 MediaCodec:Add code for YCbCrP010 format support
Set MediaFormat based on bitDepth and bitDepthAllocated.
Validate semiplanarness of chroma planes.

Bug: 206456921

Test: atest android.media.cts.ImageReaderDecoderTest
Change-Id: I88145d7eb9d372deb02ca2d633eebe087f7c4733
2021-11-24 16:46:00 -08:00
Yan Yan
1baad423a7 Merge "Split out NetworkPriorityClassifier and UnderlyingNetworkRecord" am: 42bf9da702
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1901030

Change-Id: I76c541ac5ec113118bb94e02e6fe14a441c0d2b1
2021-11-25 00:43:44 +00:00
Yan Yan
42bf9da702 Merge "Split out NetworkPriorityClassifier and UnderlyingNetworkRecord" 2021-11-25 00:23:38 +00:00
Sudheer Shanka
6a0976aa75 Include blocked reasons in the netpolicy dump.
Bug: 202065451
Test: adb shell dumpsys netpolicy
Change-Id: If07045c16d97935378f39c9c171ac909dfe1a0b2
Merged-In: If07045c16d97935378f39c9c171ac909dfe1a0b2
2021-11-25 00:11:20 +00:00
Rahul Sabnis
a74b7f7406 Merge "BT_MAINLINE Delete getControllerActivityEnergyInfo" am: 4045c6f336
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1896735

Change-Id: I079814137b2d994c059ac0f2ae7f1b7217ebbdde
2021-11-24 23:09:56 +00:00
Rahul Sabnis
4045c6f336 Merge "BT_MAINLINE Delete getControllerActivityEnergyInfo" 2021-11-24 22:54:10 +00:00
Martin Stjernholm
de2b0ded2e Merge "Reconcile differences between boot image profiles." am: 181c8f0033
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1895131

Change-Id: I9c731a33701ea9a0787c1e523d6c6a51714f6950
2021-11-24 19:46:22 +00:00
Martin Stjernholm
181c8f0033 Merge "Reconcile differences between boot image profiles." 2021-11-24 19:31:14 +00:00
Jeff Sharkey
5a518c85ee Merge "Add OWNERS for Verity related JNI files" am: af4484c3d7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1901157

Change-Id: Id8256fdfa37f7720c1da786f99e0bdd7be8f7444
2021-11-24 19:10:19 +00:00
Jeff Sharkey
af4484c3d7 Merge "Add OWNERS for Verity related JNI files" 2021-11-24 19:06:18 +00:00
Yan Yan
d57881db66 Merge "Rename UnderlyingNetworkTracker to UnderlyingNetworkController" am: f249e691cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893220

Change-Id: I7ac258ca0cbde70cb1c739c01772ce5ae6707d0d
2021-11-24 19:04:10 +00:00
Yan Yan
f249e691cf Merge "Rename UnderlyingNetworkTracker to UnderlyingNetworkController" 2021-11-24 18:39:29 +00:00
Anton Hansson
7a4b9d91f9 Make android.test.mock use api_srcs instead of jarjar
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
2021-11-24 17:59:16 +00:00
Chienyuan Huang
45e2ad027e Merge "Print anonymized address when new device found" am: 0c4d524c33
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1900311

Change-Id: I99d8232674bc19e9db4c29c961123ee4f187db2b
2021-11-24 11:45:05 +00:00
Martin Stjernholm
4c9551ed8b Reconcile differences between boot image profiles.
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
2021-11-24 11:37:53 +00:00