Commit Graph

18223 Commits

Author SHA1 Message Date
Andrei-Valentin Onea
ccc696859f Merge changes from topic "ignore-vendor-apex-allowlists" am: a22612eb94 am: 8ceedbd375 am: a5098729ea am: b486a6b6c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926339

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

Change-Id: I70b0ba1012990edb184db0e7362635b4e0533cd6
2022-03-01 16:34:12 +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
TreeHugger Robot
77d467429e Merge "Replace LinkedList by a more performant collection" 2022-02-25 01:08:26 +00:00
Eric Biggers
106d59a32d Merge changes from topic "remove-fde"
* changes:
  Remove unused FDE methods from StorageManager
  Stub out some FDE methods in StorageManager
  Stop trying to update FDE password from LockSettingsService
  Remove clearEncryptionPassword() from LockPatternUtils
  Stop trying to get/set fields in FDE footer
  Stop checking FDE password cache
  Remove checks for FDE in 'adb backup'
2022-02-24 21:01:50 +00:00
Pat Manning
852ffc196f Merge "Removing 'override' from nav bar mode APIs." into tm-dev am: 80c4b33ddf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16988243

Change-Id: I163546feab9b45348cb283ddde9f177b168ddef8
2022-02-24 17:42:38 +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
Jiakai Zhang
1ab404993d Merge changes from topic "presubmit-am-5e074e05e4c74163b4f9a025baec3cd0"
* changes:
  [automerge] Add a runtime check to ensure that system server jars are prefetched. 2p: 418ab8212c 2p: 1cab79eff5
  [automerge] Add a runtime check to ensure that system server jars are prefetched. 2p: 418ab8212c
  Add a runtime check to ensure that system server jars are prefetched.
2022-02-24 16:10:43 +00:00
Jiakai Zhang
4f04a08fef Merge "Add a runtime check to ensure that system server jars are prefetched." into tm-dev 2022-02-24 16:10:43 +00:00
Pat Manning
80c4b33ddf Merge "Removing 'override' from nav bar mode APIs." into tm-dev 2022-02-24 15:44:35 +00:00
TreeHugger Robot
7b64221077 Merge "Replace LinkedList by a more performant collection" 2022-02-24 15:20:47 +00:00
Nikolas Havrikov
ce658a693f Replace LinkedList by a more performant collection
This is a semi-automatic change.
See https://errorprone.info/bugpattern/JdkObsolete for the rationale.

Test: make
Bug: 221046110
Change-Id: I93bcb4fc6af88f6d6a659d578d5e85b9f47836f6
2022-02-24 10:32:29 +00:00
Nikolas Havrikov
34f9036d29 Replace LinkedList by a more performant collection
This is a semi-automatic change.
See https://errorprone.info/bugpattern/JdkObsolete for the rationale.

Test: make
Bug: 221046110
Change-Id: I70c65374e1da950a91c34d8ae7b1f945dcf9b8a0
2022-02-24 10:31:22 +00:00
Matt Casey
8ab848f9ff Merge "Remove system call to "headless" unbundled chooser" into tm-dev am: 08a5d6d84d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16988638

Change-Id: I976d5a7c1ba39b9657889e6d9c8d1b4231cf8b6c
2022-02-24 04:05:39 +00:00
Eric Biggers
3762ada110 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
2022-02-23 23:01:03 +00:00
Eric Biggers
8e265a9fd3 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
2022-02-23 23:00:54 +00:00
Eric Biggers
c6ce767e59 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
2022-02-23 23:00:47 +00:00
Eric Biggers
e9b69111b2 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
2022-02-23 23:00:35 +00:00
TreeHugger Robot
670d75fd34 Merge "Replace LinkedList by a more performant collection" 2022-02-23 20:45:04 +00:00
Joshua Trask
0c82ed90fa Remove system call to "headless" unbundled chooser
The behavior of proxying through a headless implementation of
the unbundled component was left over from an earlier stage of
the migration ("phase 2" of go/sharesheet-unbundling-phases).

This headless use is no longer supported in the unbundled
component, and it seems that some users are triggering this
code path even when unbundling is disabled -- resulting in
displaying both the "legacy" (system-side) UI and then, when
a share target is selected, the new unbundled UI (which is
no longer "headless").

Bug: 213348070
Change-Id: I146b42e9624d795cfa6689b6a417778ae912d8b5
Test: manual verification of crash fix, atest ChooserActivityTest
2022-02-23 19:21:09 +00:00
Nikolas Havrikov
db7e2c72f6 Replace LinkedList by a more performant collection
This is a semi-automatic change.
See go/bugpattern/JdkObsolete#linkedlist for the rationale

Test: make
Bug: 221046110
Change-Id: Ic36738ad7159f759da330ae90441644bbba7ee2c
2022-02-23 16:17:13 +01:00
Pat Manning
5342b3d416 Removing 'override' from nav bar mode APIs.
Bug: 217668440
Test: StatusBarManagerTest.java, StatusBarManagerServiceTest.java
Change-Id: I1c5fa5f5d564a78e3abaf1457a105d5e8c6402b9
2022-02-23 10:46:25 +00:00
Xiaowen Lei
8d50e04afc Merge "Add role guarded APIs for subscribing to keyguard locked state in KeyguardManager." into tm-dev 2022-02-23 06:43:49 +00:00
Michael Wachenschwanz
e85ac3239e Smear ModemActivityInfo across multiple stats
If ModemActivityInfo is available on a device, smear the provided
transmit and received times across RadioAccessTechnology and frequency
(for NR RAT).

Bug: 207697945
Test: atest BatteryStatsNoteTest
Change-Id: Ifb4e30dc3fa5ac5dd4824a87a7a86c4a0d14d019
2022-02-22 14:40:58 -08:00
TreeHugger Robot
24637529b6 Merge "Improve Cast dialog styles" into tm-dev 2022-02-22 16:22:02 +00:00
Bernardo Rufino
c95042682f Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92 am: ce09bba3fc am: aed366dc04 am: 854cd54abd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: I797488b82ad5471d90483a8fa657ce2bcdf846e9
2022-02-22 15:40:19 +00:00
Bernardo Rufino
854cd54abd Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92 am: ce09bba3fc am: aed366dc04
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: I684471f938a4400fae3309ad2c9759d808075aea
2022-02-22 14:31:52 +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
Jiakai Zhang
2c2dfad535 [automerge] Add a runtime check to ensure that system server jars are prefetched. 2p: 418ab8212c 2p: 1cab79eff5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16970524

Bug: 203198541
Change-Id: Ic65c70822e2282b5117b1a8d61f11b15c9ed7904
2022-02-21 20:28:48 +00:00
Jiakai Zhang
418ab8212c 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
2022-02-21 20:28:32 +00:00
Jordan Demeulenaere
b587411e0d Improve Cast dialog styles
This CL applies the SystemUI dialog theme to the Cast dialog. See
b/202264918#comment20 for before/after screenshots.

Bug: 202264918
Test: Manual
Change-Id: Ic20df867177986a6a73617dd9141e4d091651b5b
(cherry picked from commit b8310b0dec)
Merged-In: Ic20df867177986a6a73617dd9141e4d091651b5b
2022-02-21 13:43:02 +01: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
Xiaowen Lei
a650c2c4b7 Add role guarded APIs for subscribing to keyguard locked state in KeyguardManager.
Bug: 216630470
CTS-Coverage-Bug: 220371902
Test: manual
Test: atest CtsAppTestCases:KeyguardLockedStateApiTest
Ignore-AOSP-First: (for packages/Shell/AndroidManifest.xml) Permission
not yet publicly announced.

Change-Id: I1f44ec6799b0f74791613389ce28aadf84c9fe5c
2022-02-19 03:48:40 +00:00
Bryce Lee
ec8565e6c5 Merge "Add role guarded APIs for subscribing to keyguard locked state in KeyguardManager." 2022-02-19 02:35:20 +00:00
TreeHugger Robot
8ba1803384 Merge changes from topic "yukawa-b213350732"
* changes:
  [automerge] Fix NPE when IMM#invalidateInput() is called too early 2p: a4a6960b62
  Fix NPE when IMM#invalidateInput() is called too early
2022-02-19 00:26:47 +00:00
Michael Wachenschwanz
929f144e7e Merge "Ref count isolated uid use for long partial wakelocks" 2022-02-18 23:09:47 +00:00