Commit Graph

661264 Commits

Author SHA1 Message Date
Anton Hansson
ea2c2589ab Merge "Revert "Disable ChangedThrows"" 2022-02-23 15:06:46 +00:00
Treehugger Robot
350176393c Merge "AudioService: fix regression on hearing aid profile" 2022-02-23 13:00:26 +00:00
Treehugger Robot
7db2d81ae0 Merge "Settingslib: create OWNERS file for tests/integ/devicestate" 2022-02-22 17:51:32 +00:00
Treehugger Robot
f7ee046cd6 Merge "Add pasteAsPlainText in some documentation where it is missing." 2022-02-22 17:45:48 +00:00
William Escande
84af04b39e AudioService: fix regression on hearing aid profile
Fix regression introduced by Commit 3fe5af48 where the
hearing aid profile is not stored in BtHelper.

Bug: 211530990
Test: make
Merged-In: Ie3f8757f5fec78df2da028791e9ba2ebb5833675
Change-Id: Ie3f8757f5fec78df2da028791e9ba2ebb5833675
2022-02-22 16:41:35 +01:00
Anton Hansson
9eadc4611f Revert "Disable ChangedThrows"
This reverts commit 4d6f55f9c1.

Reason for revert: No longer needed
Bug: 217545629

Change-Id: I51978bf3a27a48bec890e044b9989ea46991a9be
2022-02-22 14:08:18 +00:00
Bernardo Rufino
c5589d2c92 Merge "Add safer Bundle APIs and deprecated old ones" 2022-02-22 13:19:47 +00:00
Arthur Milchior
e33dd38c11 Add pasteAsPlainText in some documentation where it is missing.
I discovered this error in documentation while I needed to capture "PasteAsPlainText" in an android app. 
I suspect it might be missing in other folder too, but I’m not familiar enough with Android to be sure

Change-Id: I77af9b06eb602c4ba60b0744cc02f7449bc4f500
2022-02-22 12:20:54 +00:00
Aaron Huang
3fb0bce788 Merge "Check iface by TextUtils.equals" 2022-02-22 09:48:08 +00:00
Lorenzo Colitti
15390dd13f Merge "Fix system_notification_accent_color in Vpn.java as well." 2022-02-22 09:10:42 +00:00
Tiger Huang
fe0504b2a9 Merge "Fix content insets calculation error when taking task snapshot." 2022-02-22 08:31:31 +00:00
Shawn Lin
bd8fb4581e Merge "Update the sdk doc of Default & ShortEdge cutout mode" 2022-02-22 06:36:42 +00:00
shawnlin
78cf7c826d Update the sdk doc of Default & ShortEdge cutout mode
We now allow OEMs to extend the window to cutout area in below cutout
mode, only if the cutout overlaps at most 16dp with the app windows.
 - LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFUALT
 - LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES

Bug: 218603390
Test: make
Change-Id: I8c83cde40f321de2a301b5865445ff765c824d43
Merged-In: I8c83cde40f321de2a301b5865445ff765c824d43
2022-02-22 06:34:31 +00:00
Treehugger Robot
dc59956478 Merge "Fix unwanted sign-extention when converting byte -> int" 2022-02-22 02:34:49 +00:00
Lorenzo Colitti
2525e6bc27 Merge "Get system_notification_accent_color from public resources." 2022-02-22 01:59:20 +00:00
Treehugger Robot
1a11b7b5d5 Merge "Remove EXTRA_USERID from NFC CardEmulation" 2022-02-22 01:25:00 +00:00
Lorenzo Colitti
b2a7422f62 Fix system_notification_accent_color in Vpn.java as well.
The previous CL only fixed it in LockdownVpnTracker.

Test: forrest
Change-Id: I5e4dd34a45615bc1221a93fb52ef290d924acb3e
2022-02-22 10:20:44 +09:00
Christian Göllner
24e8867ae2 Settingslib: create OWNERS file for tests/integ/devicestate
Add alexflo@ and chrisgollner@
Bug: n/a
Test: n/a

Change-Id: Ie97fb105893064f92231b34f64c86609b6a0d722
2022-02-21 15:22:58 +00:00
Anton Hansson
c741f70ac2 Merge "Sort metalava_framework_docs_args" 2022-02-21 14:19:51 +00:00
Yi-Yo Chiang
428f499930 Fix unwanted sign-extention when converting byte -> int
byte(255) converts to int(-1). This is not what we want, we want
int(255), in other words unsigned conversion.

This bug is causing premature EOF when read() is called, because when a
byte(255) is returned, it gets sign-extend to int(-1), causing the
caller to think EOF is reached.

Bug: 217427392
Test: Presubmit
Change-Id: I8ee864816c77cfe2900f5e300d7d4411cce6753a
2022-02-21 21:07:22 +08:00
Bernardo Rufino
58b4c57393 Merge "Add @hide Bundle.getParcelable() with explicit type" 2022-02-21 13:07:13 +00:00
Lorenzo Colitti
ea9b16facf Get system_notification_accent_color from public resources.
LockdownVpnTracker gets system_notification_accent_color from
com.android.internal.R. This is not stable across releases, so it
can crash ConnectivityCoverageTests when run on older releases.

Use the system API constant instead, since that is guaranteeed to
be stable. The constant was added in ag/5795405.

Test: atest ConnectivityCoverageTests
Change-Id: I956f9fac4b89cf8429bf46682b52c0203cc4210e
2022-02-21 15:56:07 +09:00
Maciej Żenczykowski
dd5a31eb2d Merge "Fix system_server crash while iterating CookieTagMap" 2022-02-19 21:41:29 +00:00
Bernardo Rufino
cccb1b78d9 Add safer Bundle APIs and deprecated old ones
Add safer Bundle APIs that take an extra Class<T> argument that checks
that the type about to be deserialized is a child of the type passed in
parameter *before* actually deserializing it, while also deprecating old
APIs.

This allows use to reap the benefits of the new typed Parcel APIs and
enhances security.

Only the APIs that could involve custom object injection are modified.
So, besides the obvious ones that have that design (eg.
readParcelableList()), subtler cases such as readIntegerArrayList()
could result in custom object deserialization, and since it's all
generics, even the casting inside Bundle wouldn't fail, only after the
client unpacked the list items would it blow up. Now those are checked
beforehand.

Since Bundle always calls Parcel.readValue() under the hood (instead of
specialized APIs such as readParcelable() etc), we had to augment that
method (that's used by LazyValue when retrieving the item) to accept
item types now for containers, which I implemented as a vararg of
Class<?> parameters (this is all private/@hide). This way we could
retrieve a list of intents like readValue(.., List.class, Intent.class),
or a map of string to intents like readValue(.., Map.class,
String.class, Intent.class). For non-container items, we can just pass
no arguments for the vararg. This is explained in internal javadocs.

Inside readValue() now, we also check the container types before
calling the internal methods for deserialization. So, if the thing on
the wire is a VAL_MAP and we know the method we're about to call will
return a HashMap, we verify that the type passed in parameter is a super
type of that (if it's non-null, if it's null it means "perform no
check").

Now, LazyValue became a BiFunction<Class<?>, Class<?>[], Object> to
receive those extra "item types" for containers. The reason for
separating the first from the rest is that the first defines the return
type in the new APIs and inside Parcel, so we need the T from Class<T>
to ensure type-safety.

(I was torn here between using BiFunction or just exposing LazyValue as
@hide for Bundle since it feels like we're missing meaning/abstraction,
but end up leaving this way, advise if you'd prefer the other way)

There was a bit of a refactor in Parcel so readValue() could call
internal methods that accepted nullable Class<?> parameters with the
meaning that null = "no verification"  and non-null = "check against
type provided" (because the external APIs all require non-null
parameters).

Now we can return null in all cases when there is a type mismatch. Note
that the Bundle APIs catch ClassCastException to return null, but that
only works for non-generic types (eg. getSizeF()). For generic types
wrapping "return (T) o" with try-catch doesn't work because the type
gets erased to its bound at runtime, so the type mismatch escapes that
try-catch to the caller, potentially causing a crash. Now they happen
inside the getters, as the non-generic ones.

Test: Boots for now
Test: Working on CTS
Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
CTS-Coverage-Bug: 219980813
Change-Id: Ifcbeb34b4684d7de105756b9d414162a9205ffaa
2022-02-19 14:10:29 +00:00
Anton Hansson
f67ce74fe6 Sort metalava_framework_docs_args
It was difficult to read.

Test: m nothing
Change-Id: I4af28967c146d6b1a27daea4f297e33b258bccfe
2022-02-18 19:27:16 +00:00
Lalit Maganti
b27a57a7b6 Merge "base: remove onBind and onMessage from TraceReport API surface" 2022-02-18 19:20:21 +00:00
Lalit Maganti
73f1063c39 base: remove onBind and onMessage from TraceReport API surface
Bug: 217554856
Change-Id: I9e60d20d5a7f159ad80a6ca256dd59c644aa4bc1
2022-02-18 16:33:32 +00:00
Anton Hansson
dad3c928d8 Merge "Generate an api-versions.xml from stubs jar" 2022-02-18 15:38:12 +00:00
markchien
77bb1cef4a Fix system_server crash while iterating CookieTagMap
When uid is removed, NetworkStatsService will iterate CookieTagMap and
delete the corresponded uid socketTag value. But not only
NetworkStatsService would detete CookieTagMap entries. There are other
threads may also delete CookieTagMap entries such as #unTagSocket in
bpfHandler and desctroy socket listener in TrafficController. System
server crash as NPE because the CookieTagMap entry it iterate just be
removed by other threads at the same time. This is just a simple fix to
prevent the crash. Will have follow up CL for formal fix.

Bug: 220084230
Test: m
Change-Id: I08cad87f537fb09499faf1ff5cfd443fcb8ce436
2022-02-18 10:11:15 +00:00
Pablo Gamito
07dee30e0c Merge changes I9881453b,I57fa88c6
* changes:
  Don't set background color if TDA doesn't have a valid surface
  Use TDA for background color instead of new color layer
2022-02-18 01:46:40 +00:00
Yurii Zubrytskyi
871327e261 Merge "idmap2: Remove redundant "using" statements" 2022-02-17 23:41:22 +00:00
Meng Wang
93a4ac7070 Merge "5G opportunistic data config per-band." 2022-02-17 21:53:32 +00:00
Sam Gilbert
65ef5b4d8c Merge "Disable ChangedThrows" 2022-02-17 19:04:02 +00:00
Baligh Uddin
8aa8ce4f91 Merge "Remove apex/media - migrated to packages/modules/Media" 2022-02-17 18:59:06 +00:00
Yi Kong
b0981d9287 idmap2: Remove redundant "using" statements
They are already under the same namespace.

Test: presubmit
Bug: 219872355
Change-Id: Ie09d529bc9d9f690feb5dba16fe174b89a14ee08
2022-02-17 17:53:42 +00:00
Baligh Uddin
235f9b1078 Remove apex/media - migrated to packages/modules/Media
Fix references for local_include_dirs for aidl support.

BUG: 171106157
Test: Local build and TH
Merged-In: Ice516a0ab0819c4a076c394c05be1643461d4309
Change-Id: I3625bf1e262a031263d500b2c6129bf3c18cdeb2
2022-02-17 16:01:56 +00:00
Sam Gilbert
4d6f55f9c1 Disable ChangedThrows
Bug: 217545629
Test: build passes
Change-Id: I6cf1fe48f81c414f9709ddf7b117108de4028f22
2022-02-17 10:36:16 -05:00
Treehugger Robot
d3b8608d23 Merge "Create OWNERS file for settingslib/devicestate" 2022-02-17 12:34:35 +00:00
Anton Hansson
36bc27cb47 Generate an api-versions.xml from stubs jar
The current api-versions.xml shipped in the SDK and used internally in
the android build system is generated by the framework-doc-stubs target.

This CL adds a new target that generates an (almost) equivalent database
in a different way. There are a few upshots of using this method to
generate them:
- using the framework-doc-stubs target is inefficient. It runs late in
  the build but also takes a long time, extending the critical path of
  the modules that depend on api-versions.xml
- the framework-doc-system-stubs target is using module sources as
  input, which is desireable to avoid because we want to separate
  module sources from the rest of the platform.

Bug: 187398174
Bug: 186197911
Test: m api_versions_{public,system} && diff with "originals"
Change-Id: I8adab94ee7ca0bee4fc0be8d99f1125360387d89
2022-02-17 12:27:49 +00:00
Meng Wang
84b8cd1168 5G opportunistic data config per-band.
Bug: 200629485
Test: make
Change-Id: I4c6ab1febcf12c6a7e2ab3364bb720e81c58dae7
2022-02-17 00:23:44 +00:00
Treehugger Robot
2a491d487f Merge "p2p: add MANAGE_WIFI_AUTO_JOIN permission for CTS external approver tests" 2022-02-16 22:54:36 +00:00
Rahul Sabnis
2eebe9a0bc Merge "Remove hidden Bluetooth dependencies" 2022-02-16 22:31:57 +00:00
William Escande
b72b351d21 Merge "Remove intdef usage that block bluetooth apex" 2022-02-16 22:13:09 +00:00
Benedict Wong
0b957a2f89 Merge "Add type string to VCN NetworkAgentConfig" 2022-02-16 21:00:36 +00:00
Bernardo Rufino
32b2842e07 Add @hide Bundle.getParcelable() with explicit type
Provider a type-safer API getParcelable() that takes a Class<?>
parameter.

Test: Manual (tested downstream)
Bug: 213169612
Bug: 212804042
Bug: 212803946
Bug: 210885162
Merged-In: Ieebc044043e0776e71d35c1cc11be9299f972c45
Change-Id: I76f9558bfa1525877bec15cfc43abdc43cba0f24
2022-02-16 20:16:44 +00:00
Patrick Rohr
9ee2d46a8c Merge "Replace qtaguid_deleteTagData with java implementation" 2022-02-16 19:59:14 +00:00
Benedict Wong
37a6ef1cd6 Add type string to VCN NetworkAgentConfig
This change populates the VCN type string used in NetworkInfo. While
the NetworkInfo API has long been deprecated, some apps apparently still
use this API. Even more unusually, some apps use the NetworkInfo's type
strings, and perform string comparisons on the type string, as opposed
to the type integer/enums to determine network types.

This change ensures maximum backward compatibility.

Bug: 219287843
Test: atest FrameworksVcnTests
Change-Id: I059dbc997f97482f7355fdc29d464d5452933ce3
2022-02-16 19:06:16 +00:00
William Escande
b87c56fb3b Remove hidden Bluetooth dependencies
Bug: 217736913
Test: pre-submit
Change-Id: Id5d8ac79f773d29fd2200ed336872067cddfa276
2022-02-16 20:03:47 +01:00
William Escande
a877bd488f Remove intdef usage that block bluetooth apex
Test: pre-submit
Change-Id: I932cea4b02bbc8e43d5d373ba2a3305322032104
Bug: 217736913
2022-02-16 17:15:06 +01:00
Jared Duke
478baf2287 Merge "Restrict optional system_server optimizations to shrinking" 2022-02-16 15:55:57 +00:00