Commit Graph

17149 Commits

Author SHA1 Message Date
Presubmit Automerger Backend
34f0951f96 [automerge] Fix ServiceConnector failing unbind if not connected. 2p: efc50877d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17321988


Change-Id: If7c0bf7ab6c89e98bdecbc1ef98bf93313fa8176
Merged-In: I6a8c01390130bcec9aff1460004343ca2b207031
2022-03-23 09:33:53 +00:00
Ahaan Ugale
efc50877d2 Fix ServiceConnector failing unbind if not connected.
ServiceConnector does not call unbindService when requested to unbind if
the service isn't currently connected. This causes issues like leaving
zombie Trusted Hotword processes bound forever if the process is stopped
('restarted') immediately after being created (say if audio server
crashes twice in quick succession).

Fix: 223845998
Test: manual - locally comment out code that immediately connects the
 service, then `for i in {1..10}; do adb shell cmd voiceinteraction\
 restart-detection; done` - without fix results in an extra process
Change-Id: I6a8c01390130bcec9aff1460004343ca2b207031
Merged-in: I6a8c01390130bcec9aff1460004343ca2b207031
(cherry picked from commit 52e0dafcb3)
2022-03-23 09:33:37 +00:00
Eric Biggers
e1a9ca0ec8 Merge "Stop using FDE-related constants from IVold" am: 489ba5ac07 am: 84f05b1b9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2031025

Change-Id: Id7be68ef1c367fb461236a0c14b4dbb8e0ca5bdd
2022-03-22 17:47:04 +00:00
Eric Biggers
489ba5ac07 Merge "Stop using FDE-related constants from IVold" 2022-03-22 17:37:32 +00:00
Treehugger Robot
af02ce3a8e Merge "Add i18n Settings OWNER for system language settings" am: 06da2b3f5c am: 11f453bf93
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2033224

Change-Id: I3ceb4c857eb22b06d6d9b8e097c404e17d94c004
2022-03-21 21:17:34 +00:00
Calvin Pan
6cac5b89c0 Add i18n Settings OWNER for system language settings
Change-Id: Ia3217df6478716ec51b891057ba57a4d53a716ca
2022-03-21 09:06:57 +00:00
Eric Biggers
8f359f022a Stop using FDE-related constants from IVold
IVold.ENCRYPTION_STATE_* and IVold.PASSWORD_TYPE_* are values returned
by or accepted by FDE-specific vold methods, which are no longer used.
Stop using these constants so that we can remove them from IVold.aidl.

Notes on specific constants:

- Some constants have @UnsupportedAppUsage.  There is no reason why a
  non-system app should have been using these.  However, to avoid
  possibly breaking apps I just left these with hardcoded values.

- StorageManager.CRYPT_TYPE_* are used by
  LockscreenCredential.getStorageCryptType().  However, the caller of
  this method was removed by an earlier CL, so just remove this method.

- StorageManager.CRYPT_TYPE_* also have a user in
  packages/apps/Settings, but it is obsolete code that I'm removing in
  another CL.

Bug: 208476087
Change-Id: I41c684b69a97dbafac65d8f55db2c284d7a8dd70
2022-03-21 05:11:28 +00:00
Joanne Chung
2081b5d040 Merge changes from topic "presubmit-am-08bbcb587d4e47b6afcc900c23899344" into sc-v2-dev am: 0f608efde9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17184230

Change-Id: I35d157de8376b43f4359cd7243d12973704bf893
2022-03-18 10:21:11 +00:00
Joanne Chung
0f608efde9 Merge changes from topic "presubmit-am-08bbcb587d4e47b6afcc900c23899344" into sc-v2-dev
* changes:
  Add hotword detection metrics.
  Add HotwordMetricsLogger for statistics logging.
2022-03-18 10:02:36 +00:00
Joanne Chung
28faf49c0b Add hotword detection metrics.
Bug: 207717787
Test: build & boot pass.
Test: manual. Both trust and no-trust still work.
Test: manual. In nornal case, log with expected values, see bug for
details. Log expected value for some error cases (not all are tested)
by local changes.

Android Metrics Design Review : eldar/276723226

Merged-in: Iaa778616eca4cfad83a94297d9cd6116bb9577e7
Change-Id: I98fde2467e09564569cdbf10b20e9defece65cbf
(cherry picked from commit e4b76fc200)
2022-03-17 19:36:08 +08:00
Eric Biggers
67721acf6d Stop checking FDE password cache am: f33dbe0540 am: 5576b11597
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2016256

Change-Id: I0b596cfd20e6442084c89b1a728397b031f941cf
2022-03-15 17:52:41 +00:00
TreeHugger Robot
d50e5886fe Merge "Defer MessagingMessage#recycle until bind ends" into sc-v2-dev 2022-03-15 17:48:49 +00:00
TreeHugger Robot
da1701ce29 Merge "Keyguard - Treat messsages to lock with priority" into sc-v2-dev 2022-03-15 16:38:21 +00:00
Eric Biggers
f33dbe0540 Stop checking FDE password cache
Now that FDE is no longer supported, checking the FDE password cache
will never accomplish anything.  Remove this check from Keyguard, and
remove the supporting code from LockSettingsService.

Bug: 208476087
Change-Id: If1bb80dfcc015aeea19916a88c89a4067e6ada32
(cherry picked from commit e9b69111b2)
Merged-In: If1bb80dfcc015aeea19916a88c89a4067e6ada32
2022-03-14 23:03:52 +00:00
Presubmit Automerger Backend
e6038b6cb3 [automerge] Defer MessagingMessage#recycle until bind ends 2p: 3c52f4881d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17160815


Change-Id: I95eb7dee2eaa6219e7f241b47532e378ba2f3bff
Merged-In: I924f917fbf757d2c3866fcd60de2fbfccae2eb6a
2022-03-14 19:06:32 +00:00
Steve Elliott
3c52f4881d Defer MessagingMessage#recycle until bind ends
See ag/17158486 for context.

Fixes: 216202070
Test: manual
Change-Id: I924f917fbf757d2c3866fcd60de2fbfccae2eb6a
Merged-In: I924f917fbf757d2c3866fcd60de2fbfccae2eb6a
(cherry picked from commit 88f4dbce89)
2022-03-14 19:05:46 +00:00
TreeHugger Robot
586488e799 Merge "Defer MessagingGroup#recycle until bind completes" into sc-v2-dev am: 037cc9fb09
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17158486

Change-Id: Ib19739ab362701e24ca7d047e2a583ee32fd6289
2022-03-14 17:47:49 +00:00
Steve Elliott
654c615cf9 Defer MessagingGroup#recycle until bind completes
There is a "race condition" where a MessagingGroup is recycled while the
contents of that group are being used elsewhere in the
ConversationLayout, namely in the "image message container" used to show
the most recent image message in the collapsed state.

This state isn't cleared until later in the bind() process, which
unfortunately depends on the groups being updated. For that reason, we
defer all synchronous calls to recycle() until the end of bind(), which
will ensure that the old groups are still around as long as necessary.

Fixes: 216202070
Test: manual
Change-Id: Idef815d54690544615512bd2bd1006f172403e18
(cherry picked from commit 2a68270c76)
2022-03-10 20:19:43 +00:00
Matt Pietal
256b5f08a8 Keyguard - Treat messsages to lock with priority
When switching users and attempting to lock the device, the sysui main
thread becomes overwhelmed with events, creating a significant lag
between the time a message is posted and processed on the main
thread. This can be dangerous when these events are critical for
security, such as calls coming from PhoneWindowManager#lockNow() that
call KeyguardViewMediator#doKeyguardTimeout(). On older devices with
slower CPUs and less memory, the delay in processing can be
significant (15 - 30s).

The result of not prioritizing these events leads to a window of time
where a guest user can switch back to the owner, and gain access to
the owner's homescreen without needing to unlock the device with the
owner's credentials.

As a mitigation, prioritize two events originating in two specific
methods to make sure the device locks as soon as possible as well as
have the system server preemptively update its local cache.

Bug: 151095871
Test: Very manual race condition - follow steps listed in bug
Change-Id: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
Merged-In: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
(cherry picked from commit 28c53ab8bc)
(cherry picked from commit f8023c9829)
2022-03-10 15:15:13 +00:00
Eric Biggers
6d66f9a556 Stop trying to update FDE password from LockSettingsService am: d63d0e12cc am: 426b3da0d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2016259

Change-Id: Id5a34ed74e970ea553bdf46640ccc3d0f35dc09d
2022-03-10 01:18:10 +00:00
Eric Biggers
c1341a7fb3 Remove clearEncryptionPassword() from LockPatternUtils am: 0a9389d296 am: a8daebb9d0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2016258

Change-Id: I8829b879fdd22f5a029a269d17113928df4f4827
2022-03-10 01:18:06 +00:00
Eric Biggers
c76db81ef9 Stop trying to get/set fields in FDE footer am: 77d147be49 am: a051497d86
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2016257

Change-Id: I0cfcaaa9d6113abb8a62ac56a34b872f380f29f3
2022-03-10 01:17:54 +00:00
Eric Biggers
d63d0e12cc Stop trying to update FDE password from LockSettingsService
Since FDE is no longer supported, updating the FDE password never does
anything.  Stop trying to do so.  Remove updateEncryptionPassword() from
ILockSettings, since its only caller outside of LockSettingsService
itself was in LockPatternUtils, and the previous CL removed that caller.

Bug: 208476087
Change-Id: I46c2a472177836f0c9084e4c3b4ed2e6c0ab61d5
(cherry picked from commit 3762ada110)
Merged-In: I46c2a472177836f0c9084e4c3b4ed2e6c0ab61d5
2022-03-09 05:11:10 +00:00
Eric Biggers
0a9389d296 Remove clearEncryptionPassword() from LockPatternUtils
Remove this method which cleared the FDE password, since is no longer
used.  It was only being used by the accessibility settings in the
Settings app, and that caller was removed by http://ag/16624515.

Bug: 208476087
Change-Id: If0c75774555d3503f21857e66cce527c5edfa586
(cherry picked from commit 8e265a9fd3)
Merged-In: If0c75774555d3503f21857e66cce527c5edfa586
2022-03-09 05:11:09 +00:00
Eric Biggers
77d147be49 Stop trying to get/set fields in FDE footer
Now that FDE is no longer supported, getting/setting FDE fields is
always a no-op, so there is no need to do so.

Bug: 208476087
Change-Id: Iab7ba8d36890daa0645b2cedf33e4bd177a86b63
(cherry picked from commit c6ce767e59)
Merged-In: Iab7ba8d36890daa0645b2cedf33e4bd177a86b63
2022-03-09 05:11:09 +00:00
Chiachang Wang
c30f82b94b Merge "Set local routes exclusion in the networkAgent" am: 4734b5810b am: b8cda9d7e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978095

Change-Id: I46931b7926b1da889989384159b012826e02d96a
2022-03-07 08:09:05 +00:00
Chiachang Wang
b8cda9d7e0 Merge "Set local routes exclusion in the networkAgent" am: 4734b5810b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978095

Change-Id: I03eaf7cf1ffc7237f267a85d2d1a25d93afe3896
2022-03-07 07:46:21 +00:00
Chiachang Wang
4734b5810b Merge "Set local routes exclusion in the networkAgent" 2022-03-07 07:25:52 +00:00
Chiachang Wang
68e528d468 Set local routes exclusion in the networkAgent
Add a field in the VpnConfig to store local route exclusion
bit from VpnProfile, and set the value into the networkAgent
of VPN network.

Bug: 184750836
Test: atest FrameworksNetTests HostsideVpnTests
Change-Id: I22b9a5990a3dab0418b44ec19d2996ead6529231
2022-03-07 04:26:52 +00:00
Andrei-Valentin Onea
a5098729ea Merge changes from topic "ignore-vendor-apex-allowlists" am: a22612eb94 am: 8ceedbd375
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926339

Change-Id: Ida1d994bb0f24f7a8f83bf1fef47d41457b243d1
2022-03-01 16:13:12 +00:00
Rhed Jao
6bd95fdfb4 Ignore prebuilt shared library if it doesn't exist on device am: 791eb6934d am: e7be86fd15
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926342

Change-Id: Iff9caa4a49a55f47ef785466ba29f355a569593e
2022-03-01 16:13:04 +00:00
Pedro Loureiro
2367227297 Rename updatable-library to apex-library am: 1df9a1e8f5 am: be595a1cb7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954037

Change-Id: I89d0a4a0ef490a8bc8d9bd41c346aece4e1df58e
2022-03-01 16:13:00 +00:00
Pedro Loureiro
c19d3ed957 Parse new xml attributes used for updatable shared libraries am: 5c228ca3e9 am: 7936aaf92e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926341

Change-Id: I7ae71734b45022e40403df1f1ec7d4290fb61d76
2022-03-01 16:12:58 +00:00
Alex Buynytskyy
56ab2afd2c Create XML parser only once. am: 66fc1f1941 am: 1adacbf9d7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926340

Change-Id: I0fce88538388f7105653e20c66a7b78cecc490ad
2022-03-01 16:12:55 +00:00
Andrei-Valentin Onea
8ceedbd375 Merge changes from topic "ignore-vendor-apex-allowlists" am: a22612eb94
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926339

Change-Id: Ia43268fea619a0af6a39aef79cc52ed67e92ee99
2022-03-01 15:51:43 +00:00
Rhed Jao
e7be86fd15 Ignore prebuilt shared library if it doesn't exist on device am: 791eb6934d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926342

Change-Id: I63155e278047882b33af00e349d2a7a32099655c
2022-03-01 15:51:38 +00:00
Pedro Loureiro
be595a1cb7 Rename updatable-library to apex-library am: 1df9a1e8f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954037

Change-Id: I559fecd56edbc4fcf1047bb8ab9ec029e515e17f
2022-03-01 15:51:31 +00:00
Pedro Loureiro
7936aaf92e Parse new xml attributes used for updatable shared libraries am: 5c228ca3e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926341

Change-Id: I2255f2357f4786cb8931e83cb007a2818a3ba720
2022-03-01 15:51:26 +00:00
Alex Buynytskyy
1adacbf9d7 Create XML parser only once. am: 66fc1f1941
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926340

Change-Id: I83e8a593a251300aee1fa8d6d9002d22eabf6fc8
2022-03-01 15:51:14 +00:00
Andrei-Valentin Onea
a22612eb94 Merge changes from topic "ignore-vendor-apex-allowlists"
* changes:
  Ignore vendor apex priv-app permission allowlists
  Add test for parsing apex allowlists
  Ignore prebuilt shared library if it doesn't exist on device
  Rename updatable-library to apex-library
  Parse new xml attributes used for updatable shared libraries
  Create XML parser only once.
2022-03-01 15:15:56 +00:00
Treehugger Robot
cdeb61ebb7 Merge "Add a runtime check to ensure that system server jars are prefetched." am: 990ac01f71 am: a80c2cd027
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925695

Change-Id: I38f4a3f9f523fc2a59c0dd9569870c0a7de7379f
2022-02-25 14:35:25 +00:00
Treehugger Robot
a80c2cd027 Merge "Add a runtime check to ensure that system server jars are prefetched." am: 990ac01f71
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925695

Change-Id: I90d1b85718c49e772107724aea59155dbe0bf8d1
2022-02-25 14:10:46 +00:00
Treehugger Robot
990ac01f71 Merge "Add a runtime check to ensure that system server jars are prefetched." 2022-02-25 13:44:34 +00:00
Jiakai Zhang
8db9757f08 Add a runtime check to ensure that system server jars are prefetched.
We prefetch standalone system server jars in ZygoteInit based on the
STANDALONE_SYSTEMSERVER_JARS environment variable, so that they can take
the advantage of AOT compilation. This CL adds a check to disallow jars
that are not prefetched, which reminds developers to make appropriate
changes so that their jars will be in the environment variable.

Bug: 203198541
Test: 1. Build a system image.
  2. The device boots.
Test: 1. Remove an entry from PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
  2. Build a system image.
  3. The device does not boot and encounters the following error:
     java.lang.RuntimeException: Creating a ClassLoader from /apex/com.android.wifi/javalib/service-wifi.jar is not allowed. Please make sure that the jar is listed in `PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS` in the Makefile and added as a `standalone_contents` of a `systemserverclasspath_fragment` in `Android.bp`.
Change-Id: I275d75ac37194a4d8fd491529b7cdb697dc04e37
Merged-In: I275d75ac37194a4d8fd491529b7cdb697dc04e37
(cherry picked from commit 418ab8212c)
2022-02-24 16:21:28 +00:00
Bernardo Rufino
aed366dc04 Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92 am: ce09bba3fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: I2f821d9de45980035ae3b4f36d83b36ad859568e
2022-02-22 14:10:52 +00:00
Bernardo Rufino
ce09bba3fc Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: Iadab8b0106bf99b9c6fbdeca6cc020e1d909ae1a
2022-02-22 13:50:00 +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
Xin Li
2b87be68b8 Merge SP2A.220305.012
Bug: 219523960
Merged-In: I748fdd49626acaa0e986a9d8038039cada6faa60
Change-Id: I67693156d705f2488fe18149d2dd02d529f009ff
2022-02-14 20:06:38 +00:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Treehugger Robot
94c6cdf4fb Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" am: 8bbb5be10e am: 6a48a6d6f2 am: acc12c32f4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978092

Change-Id: Ib55e46bdb2679fea42d37a4858accd4c41d86d51
2022-02-10 18:49:56 +00:00