Commit Graph

1846 Commits

Author SHA1 Message Date
Felipe Leme
bcafba3a1f Creates a generic mechanism to dump app-side information.
Currently, 'dumpsys activity' can dump the state of some managers:
 - AutofillManager
 - ContentCapturemaanger
 - UiTranslationController

But the support for these custom dumping is hardcoded into
Activity itself, which makes it harder to extend. For example,
automotive builds provide an app-side Car object, which currently
cannot be dumped.

This CL makes the mechanism more flexible by providing a couple new
public / SystemAPIs that let Automotive (or other mainline modules)
extend it.

Examples:

$ adb shell dumpsys activity com.android.car.carlauncher/.CarLauncher --list-dumpables
$ adb shell dumpsys activity com.android.car.carlauncher/.CarLauncher --dump-dumpable CarUserManager
$ adb shell dumpsys activity service com.android.systemui/.SystemUIService CarUserManager

NOTE: this CL only adds the new APIs; a follow-up CL will change the
existing managers to use them.

Test: see above
Test: m update-api

Bug: 149254050
CTS-Coverage-Bug: 149254050

Change-Id: I6920ff3542d3d75edd667c2c7658e9d0a7af534f
2022-01-13 11:43:13 -08:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
TreeHugger Robot
66eca70ab0 Merge "Change close guard logged messages" 2021-12-21 15:55:19 +00:00
Ioannis Ilkos
0bde67ab00 Change close guard logged messages
Unless we are looking at stack traces (e.g. from strict mode) it's not
possible to identify which type of object is not being closed (most
methods are 'close' or 'release). Change the logged text to clarify.

Change-Id: Ib90eac716f43c2c2caf8d8c6fb64a7bd90562da9
Test: manual
2021-12-21 11:46:10 +00:00
Zoey Chen
ca44a97a4f Merge "[ProviderModel] Internal cleanup, remove the Provider Model flag" 2021-12-20 15:27:26 +00:00
Zoey Chen
29c2e807e0 [ProviderModel] Internal cleanup, remove the Provider Model flag
Bug: 197066557
Test: atest TileServicesTest, atest TileQueryHelperTest, atest QSTileHostTest, atest NetworkControllerDataTest, atest NetworkControllerSignalTest
Change-Id: Ic88255873fe6ed8ac3e8b0a1368e9a7f480b09ff
2021-12-17 13:08:12 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Jing Ji
fcedd7e1fe Merge "Add settings to toggle the phantom process monitoring in dev options" 2021-12-14 06:06:08 +00:00
Jing Ji
03d398b271 Add settings to toggle the phantom process monitoring in dev options
For power users, the monitoring on phantom processes could be turned
off from the Settings->Developer Options->Feature flags.

Bug: 210353231
Bug: 205156966
Test: Manual
Test: atest AppChildProcessTest
Test: atest CtsAppTestCases:ActivityManagerTest
Change-Id: I05f5b43e281b98676c615d350c213620d3d72b5c
2021-12-13 02:39:40 -08:00
Jorim Jaggi
794720fbd2 Add cheap aidl tracing suitable for always-on-tracing (1/3)
Instead of having only one switch to enable all binder tracing,
we seperate between stack tracking and tracing. Stack tracking
still works as before. However, the more lightweight option,
tracing using android.os.Trace, is toggleable separately and will
work on the receiver side without dumping the entire stack trace.

We also make the tracing more efficient by caching
getTransactionName and concatting the class name.

Also, enable this selectively for SysUI+Launcher, which is
currently the focus of always-on-tracing effort to figure out
what kind of binder calls these processes are calling which seems
to contribute a huge amount of jank (long binder calls are in
>= 50% of janky traces).

Test: external/perfetto/tools/record_android_trace gfx view freq sched wm am aidl
Test: atest aidl_unittests
Bug: 202278427
Change-Id: I4d803d073cc4b69d07fa433bfef7e1c7f45132b7
2021-12-10 17:03:24 +01:00
Neil Fuller
8d86d7dd92 Merge "Use ISO 8601 format for LocalLog local timestamps" am: 172fd44b2f am: 22ed1a7a79 am: 218b1d80e4 am: dfa18bff1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878440

Change-Id: I56b60c35e8dae782973a704b0c307dd4f428a4e9
2021-12-07 15:36:12 +00:00
Neil Fuller
dfa18bff1b Merge "Use ISO 8601 format for LocalLog local timestamps" am: 172fd44b2f am: 22ed1a7a79 am: 218b1d80e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878440

Change-Id: I8848a0d7a1e256b3cb71188137ab51a8a1c829b3
2021-12-07 15:17:42 +00:00
Neil Fuller
172fd44b2f Merge "Use ISO 8601 format for LocalLog local timestamps" 2021-12-07 14:26:24 +00:00
Songchun Fan
502ab7764e Merge "[pm] change internal flags to long" 2021-11-30 15:47:16 +00:00
Treehugger Robot
9fc693babe Merge "[MS06] Add carrier template fields into cloud backup/restore" am: bf424ed534 am: 3ac404a52d am: 2a239d2ae6 am: 703f963cc4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1892336

Change-Id: Ie8589e8b2a82f116f9266fc874991ea60c795e83
2021-11-26 06:07:09 +00:00
Treehugger Robot
703f963cc4 Merge "[MS06] Add carrier template fields into cloud backup/restore" am: bf424ed534 am: 3ac404a52d am: 2a239d2ae6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1892336

Change-Id: Ibfb26963222568f64670c4bc3983c242a8595a28
2021-11-26 05:55:16 +00:00
Treehugger Robot
bf424ed534 Merge "[MS06] Add carrier template fields into cloud backup/restore" 2021-11-26 05:07:26 +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
Songchun Fan
5fab45ef67 [pm] change internal flags to long
Changes IPackageManager.aidl methods to use long flags instead of int.
Public API change to be followed.

BUG: 204432643
BUG: 204433659
Test: manual
Change-Id: Ib5c42fef998f0116e312c71d620e1a15329e26e0
2021-11-24 06:58:50 -08:00
Jonathan Lepage
5aa7fd5d18 Merge "Document that Log can quietly swallow UnknownHostExceptions." am: 9d01845696 am: fc60d843e6 am: 2bf9cccba6 am: 4e0b4bc2ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1873073

Change-Id: I55307ab11eb4bc423662d7cd6157d1a1e3c36141
2021-11-16 00:57:32 +00:00
Jonathan Lepage
4e0b4bc2ce Merge "Document that Log can quietly swallow UnknownHostExceptions." am: 9d01845696 am: fc60d843e6 am: 2bf9cccba6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1873073

Change-Id: If5276716a304cfc0e795e74d3457f2bf9b4f0f17
2021-11-16 00:55:37 +00:00
Neil Fuller
c4b75122e7 Use ISO 8601 format for LocalLog local timestamps
Change to using ISO 8601 duration formatting for LocalLog local
timestamps, which makes it consistent with other time / time zone
detection dumpsys for easier comparison.

LocalLog is used by NetworkStack code as a standalone library, so
therefore has to depend on public SDK APIs, hence the use of Duration.

The local timestamp logging mode is only currently used for time / time
zone detection, which is low-frequency logging.

Bug: 204855374
Test: atest core/tests/coretests/src/android/util/LocalLogTest.java
Change-Id: Idce0d39c59670facdf48deca852b862ff0d71991
2021-11-15 17:30:27 +00:00
Varun Shah
d364e6ad9c Merge "Run the service start user lifecycle phase in parallel." 2021-11-10 17:46:22 +00:00
Varun Shah
287afa1901 Run the service start user lifecycle phase in parallel.
Execute the on start user lifecycle phase in parallel.
Services will be a added to a new thread pool, and depending
on which category they are in, they will either be executed
right away (bootstrap and core categories), or run in parallel
along with other services in that category (other category).

This change will only apply for non-system users for now.
Additionally, low ram devices will have this change disabled.

Initial results show about 16% improvement in execution times.

Note: This CL does not enable the thread pool, a separate CL will
enable it.

Bug: 197257926
Test: atest UserLifecycleTests
Change-Id: I76ba673f78b69c7f0caac2d843fa77079e92138a
2021-11-08 16:26:52 -08:00
Felipe Leme
5dae3ca918 Merge "Implemented AtomicFile.toString()" 2021-11-05 15:07:14 +00:00
TreeHugger Robot
d9cbb79988 Merge "Enable large screen flag in the Settings app" into sc-v2-dev am: a67a07e2fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16187602

Change-Id: I001ac219364f4293d55739d8ce0579dd4d81dbd4
2021-11-05 08:13:58 +00:00
Tsung-Mao Fang
d5c2afc91c Enable large screen flag in the Settings app
Test: Rebuilt rom and see flag enable.
Bug: 197829997
Change-Id: Ib2490a58c39cfeddc588c5355b652fcb86d391bd
Merged-In: Ib2490a58c39cfeddc588c5355b652fcb86d391bd
2021-11-05 06:31:19 +00:00
Tsung-Mao Fang
475b78376b Enable large screen flag in the Settings app
Test: Rebuilt rom and see flag enable.
Bug: 197829997
Change-Id: Ib2490a58c39cfeddc588c5355b652fcb86d391bd
2021-11-04 08:49:46 +00:00
Jonathan Lepage
ff42a9938b Document that Log can quietly swallow UnknownHostExceptions.
Change-Id: I7d3239eadf7dd73dd1ff12d2924bb43d3e357299
2021-11-04 00:53:34 +00:00
Felipe Leme
4fa666998e Implemented AtomicFile.toString()
It shows the path of the base filename.

Test: atest FrameworksUtilTests:android.util.AtomicFileTest
Fixes: 203131233

Change-Id: Ib8d36610a4c34d210cc465ec8006d4df33ef638d
2021-10-22 16:25:34 +00:00
Alex Buynytskyy
0de533f5ce Optimization to avoid parsing v2/v3/v31 blocks.
If v4 contains no additional signature blocks.

Bug: 202011194
Test: atest PkgInstallSignatureVerificationTest
Change-Id: I7a498e313f4bf8a6d14a9796be6caeb5e6a7775e
2021-10-20 14:44:10 -07:00
TreeHugger Robot
50f156e11f Merge "v4.1: support v3.1 key rotation in v4 signature" 2021-10-18 17:50:26 +00:00
tom hsu
375f3c08f4 Add a new settings' flag to control enable of app's language function.
Bug: 203382108
Test: local test.
Change-Id: I63e007e44113f6f59dfcf13471a6a259aaf7a692
2021-10-18 17:24:45 +08:00
Alex Buynytskyy
616584b035 v4.1: support v3.1 key rotation in v4 signature
Bug: 202011194
Fixes: 202011194
Test: atest PkgInstallSignatureVerificationTest
Change-Id: I63b067c077a4ee1af54e7081e7691b4091f229d2
2021-10-15 22:07:44 +00:00
Suprabh Shukla
05212eaec7 Merge "Redact key value from log when DEBUG is false" am: 17a7d79ff4 am: 694cf0f6af am: 23315f8003 am: fefc7f08be am: 0708411189
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458401

Change-Id: I1a937222e7f92e2db0ca183f14f08aa05d7e295b
2021-09-30 00:21:32 +00:00
Suprabh Shukla
0708411189 Merge "Redact key value from log when DEBUG is false" am: 17a7d79ff4 am: 694cf0f6af am: 23315f8003 am: fefc7f08be
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458401

Change-Id: I00953ab4617fb631f792694e43376c67f421e705
2021-09-30 00:13:12 +00:00
Suprabh Shukla
694cf0f6af Merge "Redact key value from log when DEBUG is false" am: 17a7d79ff4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458401

Change-Id: Iea902e93f038cd3a06d63cf6c6cdd149c873df79
2021-09-29 23:39:49 +00:00
Suprabh Shukla
17a7d79ff4 Merge "Redact key value from log when DEBUG is false" 2021-09-29 23:25:21 +00:00
Jordan Demeulenaere
2dae097d13 Merge changes from topics "dialog-launch", "launch-animator" into sc-v2-dev am: 3bf72bd3f9 am: 6bd5b1160a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15663086

Change-Id: Id15f2116c09f4f98ec3df25005362711ae66dc43
2021-09-29 12:26:42 +00:00
Jordan Demeulenaere
6bd5b1160a Merge changes from topics "dialog-launch", "launch-animator" into sc-v2-dev am: 3bf72bd3f9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15663086

Change-Id: If7f060b1c162f27d9659a0f71448d9622cbe25f8
2021-09-29 12:09:45 +00:00
Edward Savage-Jones
46b4ba4201 Redact key value from log when DEBUG is false
See bug for details

Bug: 170653379
Test: see bug
Change-Id: I713fd8c03444167faf35a170b885c38af5482e31
2021-09-29 06:53:42 +00:00
Jordan Demeulenaere
c0a85b7c3b Split ActivityLaunchAnimator (1/2)
This CL splits ActivityLaunchAnimator by extracting common logic into
LaunchAnimator. The goal of this CL is to be able to reuse the
LaunchAnimator logic for dialog launches.

This CL also improves GhostedViewLaunchAnimator such that it also works
with:
 * launch containers that are not located at (0, 0).
 * ghosted views that move.

Test: atest ActivityLaunchAnimatorTest
Bug: 193634619
Change-Id: Ic05603600d4a7d4e27182c79bef54286087d00d0
2021-09-23 17:17:47 +02:00
Michael Groover
daadf0795e Add support for APK Signature Scheme V3.1
This commit adds support for the V3.1 APK signature scheme; this
scheme allows an APK to target T+ for rotation without needing to
configure multi-targeting APKs. This scheme can be used by apps that
are impacted by any of the known issues with rotation on pre-T
releases. The v3.1 signature scheme uses a new block ID that is not
recognized by previous platforms, so earlier releases will use the
original signer in the v3.0 block, and T+ devices will use the
rotated signer in the v3.1 block. This scheme also supports SDK
version targeting allowing rotation to target a later release.

Bug: 192301300
Test: atest PkgInstallSignatureVerificationTest
Change-Id: I0b3345f0fd688aaaa1ef9f57d362d0fd0cb0565b
2021-09-20 14:14:12 -07:00
Kweku Adams
6a97c5d9f5 Improve replaceAll.
The default implementation of Map.replaceAll() iterates through the
entrySet. Switch to a simple for loop iterating through the array
since the iterator is an inefficient way to access the array contents.

Benchmark results:

Before:

android.util.ArrayMapPerfTest#testReplaceAll_Large:
	replaceAll_Large_min (ns): 888977
	replaceAll_Large_median (ns): 904642
	replaceAll_Large_mean (ns): 914596
	replaceAll_Large_standardDeviation: 23960
android.util.ArrayMapPerfTest#testReplaceAll_Small:
	replaceAll_Small_min (ns): 177767
	replaceAll_Small_median (ns): 179955
	replaceAll_Small_mean (ns): 180331
	replaceAll_Small_standardDeviation: 2865

After:

android.util.ArrayMapPerfTest#testReplaceAll_Large:
	replaceAll_Large_min (ns): 557385
	replaceAll_Large_median (ns): 586495
	replaceAll_Large_mean (ns): 583712
	replaceAll_Large_standardDeviation: 20356
android.util.ArrayMapPerfTest#testReplaceAll_Small:
	replaceAll_Small_min (ns): 108051
	replaceAll_Small_median (ns): 110802
	replaceAll_Small_mean (ns): 109987
	replaceAll_Small_standardDeviation: 1334

Bug: 194098491
Test: atest CorePerfTests:ArrayMapPerfTest (see results above)
Test: atest CtsUtilTestCases:ArrayMapTest
Test: atest FrameworksCoreTests:ArrayMapTest
Change-Id: If87ae5f3aa4b184b95c16aed5f2fb6f31d11668a
2021-09-10 14:33:40 -07:00
Nataniel Borges
a61012f1d7 [DO NOT MERGE] Sync flicker from master to sc-v2 am: c8287a930f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15716594

Change-Id: I1c8ba8041d346d6991fd113b60e75184aa849ea6
2021-09-04 00:36:01 +00:00
TreeHugger Robot
6bd19fab1c Merge "[DO NOT MERGE] Sync flicker from master to sc-v2" into sc-v2-dev 2021-09-04 00:15:31 +00:00
Michael Groover
b7701dd484 Merge "Update APK sig scheme verification OWNERS" am: 1e5f1a293a am: 16fd109212 am: baa5efcd7b am: acae3b9578 am: 221154184b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1817421

Change-Id: I70cbc711153770dced8a47ae569ed8f9a0c2060b
2021-09-03 18:29:46 +00:00
Michael Groover
221154184b Merge "Update APK sig scheme verification OWNERS" am: 1e5f1a293a am: 16fd109212 am: baa5efcd7b am: acae3b9578
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1817421

Change-Id: Ia93adaf84f08f75e5b964e047d3ef9c1ab69dade
2021-09-03 18:13:31 +00:00
Michael Groover
16fd109212 Merge "Update APK sig scheme verification OWNERS" am: 1e5f1a293a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1817421

Change-Id: I763efc9f320e551ca61462699e5f7ac12f6219fc
2021-09-03 17:25:21 +00:00