Commit Graph

18324 Commits

Author SHA1 Message Date
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
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
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
TreeHugger Robot
24637529b6 Merge "Improve Cast dialog styles" into tm-dev 2022-02-22 16:22:02 +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
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
Yohei Yukawa
a4a6960b62 Fix NPE when IMM#invalidateInput() is called too early
This is a follow up CL to my previous CL [1], which introduced

  InputMethodManager#invalidateInput(View).

One thing I overlooked is that apps may call that API even before

  InputMethodManager#mCurrentInputMethodSession,

which results in a NullPointerException.

With this CL, such a case will be gracefully fallen back into

  InputMethodManager#restartInput(View)

like other cases when IMM#invalidateInput() is not available.

 [1]: I3161755779080f98bcef0e47dd0c5247d8a3a256
      daa6695c2e

Fix: 213350732
Test: atest CtsInputMethodTestCases:InputMethodStartInputLifecycleTest
Change-Id: I67458494b3069498a1395e3278f6a975e821e610
2022-02-18 12:05:15 -08:00
TreeHugger Robot
5585ad36b0 Merge "Defer the instrument of AOD transition per doze amount" 2022-02-17 12:42:59 +00:00
Ady Abraham
171380fd37 Merge "Correct JankData.PREDICTION_ERROR meaning" 2022-02-17 02:12:43 +00:00
Abodunrinwa Toki
62599cbdcc Merge "Ensure that TextViewActivityTest still pass for the new system toolbar." 2022-02-17 01:10:21 +00:00
Steve Elliott
ba790ec0e9 Merge "Defer MessagingGroup#recycle until bind completes" 2022-02-16 17:26:15 +00:00
BK Choi
1ccbddadfb Merge "Fix the infinite loop bug for AndroidFuture.ThenCombine." 2022-02-16 16:01:46 +00:00
Oli Lan
9807b6350f Merge "Increase default user icon size." 2022-02-16 15:50:00 +00:00
Ahan Wu
c60451d094 Defer the instrument of AOD transition per doze amount
When the doze changes, StatusBar#updateDozing will be invoked at the
first frame, usually make the following one be regarded as janky,
but it is unperceptible by the users, so ignore it.

Bug: 201987244
Test: Capture the trace manually
Change-Id: Iac739d23eb0fdc988bd52076bdccca4665e28d18
2022-02-16 19:55:24 +08:00
Marcin Oczeretko
b548b1a38d Merge "Change PerfettoTrigger throttling to be per trigger name" 2022-02-16 11:40:46 +00:00
Ady Abraham
e4a9000b03 Correct JankData.PREDICTION_ERROR meaning
JankData.PREDICTION_ERROR is asserted when SF vsync calculation
is incorrect and should be attributed to SF missed frames.

Bug: 211763914
Test: SF unit tests
Change-Id: I332480ad1017c220501ed938319f8b2fbfe22826
2022-02-15 15:06:45 -08:00
Nicolò Mazzucato
fc5f85a892 Merge "Avoid binder transaction to WM for lock orientation" 2022-02-15 22:09:40 +00:00
Marcin Oczeretko
6c5c8abcd8 Change PerfettoTrigger throttling to be per trigger name
This is to allow us to collect more representative traces even if one of
the triggers is invoked more frequently than other.

Increased the throttling to be 5min per trigger name

Bug: 213920740
Test: manual - flashed and checked logcat
Change-Id: I078c640cc1e72c4ce8641b047fc90eb13bc8f2a4
2022-02-15 15:43:27 +00:00
Nicolo' Mazzucato
8fa312bb67 Avoid binder transaction to WM for lock orientation
When rotation happened during a change of screen (e.g. on foldable devices), getRotationLockOrientation was blocked by a wm binder call to get the display size. wm was holding the lock while changing display power state. This cl removes this dependency.

Bug: 197515205
Test: Manual
Change-Id: I950e80289ea0f385bcaedf052d393ac7a23a14c6
2022-02-15 12:33:44 +01:00
Steve Elliott
2a68270c76 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: 212689920
Test: manual
Change-Id: Idef815d54690544615512bd2bd1006f172403e18
2022-02-15 00:18:13 -05:00
Badhri Jagan Sridharan
9c80283f83 Convert @UsbDataStatus into bit field flags.
getUsbDataStatus now returns bit field values of @UsbDataStatus.

Also renaming from USB_DATA_STATUS_* to DATA_STATUS_* based on
review comments.

Bug: 216640242
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I96ade3dd7041a4094e57907069a872909a62e72f
2022-02-15 03:17:46 +00:00
Evan Rosky
33cfda6944 Merge "Add ability for sysui/featureflags to restart android" 2022-02-14 20:49:12 +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
Felipe Leme
865dc828f5 Merge "Final (?!?!?!) improvements on Activity.dump()" 2022-02-14 19:28:29 +00:00
bkchoi
052cba1feb Fix the infinite loop bug for AndroidFuture.ThenCombine.
The bug was found and fixed in
android.car.util.concurrent.AndroidFuture. The same fix is being
duplicated from commit 9dcaf6862035676b2574e92cb72cba67ff0a879b.

Bug: 218377773

Test: atest com.android.internal.infra.AndroidFutureTest

Change-Id: I1e13d512a449a7330c74ed06f6afd90e3c4f9493
2022-02-14 10:30:33 -08:00
Felipe Leme
bca61d7f66 Final (?!?!?!) improvements on Activity.dump()
- Fix handle of special args (they were not called unless the app
  targeted T).
- Lazy-adds some dumpables to Activity (so the list of dumpables
  is not created until dump() is called).

Test: adb shell am start com.android.settings && adb shell dumpsys activity com.android.settings --list-dumpables
Test: atest CtsAppTestCases:android.app.cts.ActivityDumpTest

Bug: 149254050

Change-Id: Id25d115d4aef8ab16ceb3d035c134c637e16dadd
2022-02-14 09:20:51 -08:00
Caitlin Cassidy
89e1907bba Merge "[Nearby Media Devices] Add a SystemApi to get information about nearby media devices from external clients." 2022-02-14 12:59:24 +00:00
TreeHugger Robot
5a290d0b4d Merge "Remove KeyValuePair logging" 2022-02-12 03:53:38 +00:00
Evan Rosky
bd36a8115c Add ability for sysui/featureflags to restart android
When setting flags/sysprops, full reboot is overkill.
This adds a way to just restart system_server.

Bug: 219067621
Test: Call API and verify that it restarts
Change-Id: I67aecbc6ec0570fbaf36165034648ab39da57940
2022-02-11 15:42:16 -08:00
TreeHugger Robot
c16349a69d Merge "Revert "Query only necessary columns in ChooserActivity.extractF..."" 2022-02-11 21:35:54 +00:00
Caitlin Cassidy
ba6b756d0e [Nearby Media Devices] Add a SystemApi to get information about nearby
media devices from external clients.

Bug: 216313420
Test: CTS included in same topic
Test: atest NearbyMediaDevicesManagerTest
Change-Id: Ic5f26d3048a3475dbd232c913bb00bee46339b0a
2022-02-11 20:59:43 +00:00
Hai Zhang
454c526e5e Revert "Query only necessary columns in ChooserActivity.extractF..."
Revert submission 16791148-chooseractivity-queryresolver

Reason for revert: b/218994001
Reverted Changes:
I91bbd3971:Query only necessary columns in ChooserActivity.ex...
I2ab9c6f03:Query only necessary columns in ChooserActivity.ex...

Fixes: 16850551
Change-Id: Idbc6270bb0dc1f2402c44d111bdcebe8a25f28c2
2022-02-11 18:08:16 +00:00
TreeHugger Robot
f7d49172b1 Merge "Recycle obtained TypedArrays" 2022-02-11 15:48:52 +00:00
Oli Lan
b50567218e Increase default user icon size.
This increases the size of the default user icon to 190dp.

A new method convertToBitmapAtUserIconSize is added to UserIcons to
allow bitmaps of this size to be easily obtained. The existing
method convertToBitmap uses the intrinsic size of the drawable, which
is only 48dp as standard.

Bug: 218838295
Test: visual inspection of user icon for owner and new users
Test: atest UserIconsTest
Change-Id: I5cbf110731f4c944bb1d3af63b5a0fcb5ab50f16
2022-02-11 13:25:32 +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
Tej Singh
8bf391e405 Remove KeyValuePair logging
Test: m
Test: use device and make sure no KVP atoms are logged
Bug: 218956185
Change-Id: I7abfaaa78581d6d8945640e77578f8698282ad10
2022-02-10 22:24:57 -08:00
Caitlin Cassidy
dc5dff8698 Merge "[Media TTT] Add app icon and name to the receiver SystemApi." 2022-02-10 21:35:27 +00:00
Hai Zhang
cedebbc921 Merge "Query only necessary columns in ChooserActivity.extractFileInfo()." 2022-02-10 19:11:26 +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
Treehugger Robot
acc12c32f4 Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" am: 8bbb5be10e am: 6a48a6d6f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978092

Change-Id: I81ad272bcfd09eaf9da4dbcaf2e5b56c73eba5ea
2022-02-10 18:34:14 +00:00
Treehugger Robot
8bbb5be10e Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" 2022-02-10 18:04:39 +00:00
Alan Viverette
7d1188244c Merge "Migrate frameworks/base javadocs references to androidx" 2022-02-10 18:02:28 +00:00
Nikolas Havrikov
1859e347b4 Recycle obtained TypedArrays
Bug: 218835043
Test: make
Change-Id: Ibe4a9593a574159497b300a98be4af196ee110fe
2022-02-10 15:05:24 +01:00