Commit Graph

12202 Commits

Author SHA1 Message Date
Lee Shombert
3e4d9f2007 Record resource access times
Bug: 246953799

Collect timing information for resource acquisition methods.  The
timing has nanosecond resolution and is collected inside the native
runtime code.  Timing values are accumulated in the runtime and are
periodically fetched and published by the java framework.  This
strategy means that normal resource methods incur a small runtime
overhead.  The longer time involved in publishing the values is
handled by an independent Java thread.

A public dumpTimers() method can be called from a dumpsys command, for
debug, but the dumpsys command is not hooked up in this commit.

No APIs are actually monitored in this commit, and the ResourceTimer
loop is not started.

Test: atest
 * androidfw_lib

Change-Id: I5995d3c6518ca2fa4c8ab9d3eb610167758c695d
2022-09-18 18:05:03 -07:00
Riddle Hsu
48d11607a9 Merge "Apply override scale from entry points on client" 2022-09-08 03:35:48 +00:00
Mayank Garg
be5a320cd9 Merge "Added check for user info is not null" am: 1206d8d742 am: 97efff4696 am: 61b941566b am: 98dd375c18 am: 799c6528f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2195236

Change-Id: I2d72689a3cc3c08f8e573cdb46d1b729b544b889
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 00:10:40 +00:00
Mayank Garg
799c6528f5 Merge "Added check for user info is not null" am: 1206d8d742 am: 97efff4696 am: 61b941566b am: 98dd375c18
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2195236

Change-Id: Ieacbb35e522b35353c96de1f162a8a71388b4b04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 00:09:07 +00:00
Mayank Garg
1206d8d742 Merge "Added check for user info is not null" 2022-09-01 22:18:45 +00:00
Mayank Garg
a833ca3056 Added check for user info is not null
Bug: 237413499
Test: atest HandlerThreadingDomainTest LocationTimeZoneProviderControllerTest LocationTimeZoneProviderTest ZoneInfoDbTimeZoneProviderEventPreProcessorTest
Change-Id: I79087a3e83a51b81568bdb6ff5540ee78b51b91a
2022-09-01 19:42:28 +00:00
Riddle Hsu
a0530caa33 Apply override scale from entry points on client
This provides a sandbox-like scaled environment on client side.

- This prevents the metrics and config from being scaled multiple
  times because the entry points are only called from server side,
  there won't have reentrancy for applying the scale.
- App's configuration callback method can get scaled config.
- If override scale is enabled, the legacy compat mode will be
  skipped. That avoids mixing different approaches of scaling.
  - Legacy compat mode is to simulate a 320dp x 480dp screen
    size with density 160 (the surface scale and config scale
    are different).
  - Override scale is to downscale the app for better performance
    (the surface scale and config scale are the same).

Bug: 238416387
Bug: 240335717
Test: atest ActivityThreadTest#testOverrideScale
Test: atest CtsWindowManagerDeviceTestCases:CompatScaleTests
Test: am compat enable DOWNSCALED $pkg
      am compat enable DOWNSCALE_50 $pkg
Change-Id: I0ddf333996f229063511273f8aeb3867c9ba8bda
2022-08-31 17:49:24 +00:00
Vali Calinescu
75de760cea Merge "Adjust aspect ratio override portrait fullscreen" 2022-08-31 11:20:11 +00:00
Cole Faust
9acf46f66f [conflict] Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567 am: 9b3a5fc03b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I5e59b8549df348c181cd3b72311798a5d7602a67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 21:03:54 +00:00
Cole Faust
9b3a5fc03b Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I7052a1f7391ed6701fe0e1036c27368609032e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 20:44:00 +00:00
Cole Faust
a1eb8cf128 Merge "Fix array-related errorprone warnings" 2022-08-30 18:03:01 +00:00
Vali Calinescu
129b816937 Adjust aspect ratio override portrait fullscreen
We're defining a new compat framework change id that restricts
the other aspect ratio overrides for devices in portrait fullscreen.

Fix: 218959984
Test: As manual testing use 'adb shell am compat disable/enable OVERRIDE_MIN_ASPECT_RATIO_EXCLUDE_PORTRAIT_FULLSCREEN <package-name>'. For the unit tests run 'atest WmTests:SizeCompatTests'.
Change-Id: I84eaab4df045c93fb2c159a789852094caf9121a
2022-08-30 11:34:43 +00:00
Treehugger Robot
e9712ca91b Merge "Exclude large tests from presubmit." am: 3d8681e31d am: 9dc9fd8930 am: 5860c207c9 am: da40df7c95
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2176682

Change-Id: I56d7b99eab9acc055a6935166f962d10e6df357c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 22:35:54 +00:00
Treehugger Robot
3d8681e31d Merge "Exclude large tests from presubmit." 2022-08-29 20:52:36 +00:00
Nan Wu
21d8b0c7da Merge "Mark framework created intent as safe" 2022-08-29 18:05:26 +00:00
Cynthia Wasonga
53a2440bd9 Merge changes from topic "profile-removed-intent-and-tests"
* changes:
  Send ACTION_PROFILE_REMOVED broadcast
  Add ACTION_PROFILE_ADDED and REMOVED intents
2022-08-29 12:50:54 +00:00
Cynthia Wasonga
8aff7dc6bf Add ACTION_PROFILE_ADDED and REMOVED intents
Test: run build
Bug: 232589578
Bug: 233012185

Change-Id: Ibc8f845f91c2468a8b781f0f6a7a3d1264b0b995
2022-08-26 12:01:39 +00:00
Cole Faust
584140c83a Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ia6f216cc36ad0a5758f39fd9b34962cd4adf9d8e
2022-08-25 10:57:12 -07:00
Jeremy Meyer
a9d7326a48 Merge "Add ability to pass in a config string for FRROs" 2022-08-24 23:31:04 +00:00
Jeremy Meyer
77c8a939d6 Add ability to pass in a config string for FRROs
This enables passing them and and storing them in the .frro file but no
further.

Bug: 243066074
Test: Manual
Change-Id: I5c9723e69d175a536f9739619c6b6bf3162a5027
2022-08-24 18:44:14 +00:00
Songchun Fan
9407d10cd0 [pm] fix getPackageArchiveInfo
BUG: 243479679
Test: atest android.content.pm.cts.PackageManagerTest#testGetPackageArchiveInfo
Change-Id: I3a353c9b0f05117b233888d74a42f1ed3cf26eb8
2022-08-23 18:36:04 +00:00
Nan Wu
c51fd76dd5 Mark framework created intent as safe
Flag intent created by framework as LOCAL_FLAG_FROM_PROTECTED_COMPONENT by
calling intent.prepareToEnterProcess(true...). This is to fix false positives
of StrictMode.unsafeIntentLaunchViolation.

Bug: 181132616
Test: Manually verified a violation was not reported when a test app launched
      Intents returned from TelecomManager.createManageBlockedNumbersIntent.
      Methods marked as systemApi are not tested.
Change-Id: I7b00008dd894f1c637ab2f0a23e6cafb58bb73e5
2022-08-23 12:03:46 +00:00
Austin Borger
57b6c21a33 Merge "Revert "Add pids to AttributionSource."" 2022-08-22 17:22:01 +00:00
Austin Borger
7a8d805c63 Revert "Add pids to AttributionSource."
This reverts commit 20bcb3c4b8.

Reason for revert: Broken test (bug 243187237)

Change-Id: I2eb033ed06e2c0c56155e4848de1b399b69ffc6d
2022-08-22 00:56:14 +00:00
Adam Bookatz
3a39c41c8a Merge "Introduce UserProperties class" 2022-08-20 00:32:02 +00:00
Austin Borger
caa20c20e6 Merge "Add pids to AttributionSource." 2022-08-19 20:32:17 +00:00
Adam Bookatz
51f3320ac8 Introduce UserProperties class
Introduces a UserProperties class, which holds (potentially dynamic)
information about each user, where the (default) values depend on the
user type.
This can usually be used instead of
isManagedProfile() calls, giving fine-grained information, rather than
course-grained queries about the user type.

The system copies this object before delivering it to any callers,
filtering the properties by the permissions held by the caller.

The object can be parsed from XML, which is used for both persisting a
user's properties to disk, as well as for reading in the default
properties for each user type.

Bug: 235065648
Bug: 237399048
Bug: 170249807
Bug: 234439331

Test: atest UserManagerServiceUserPropertiesTest
Test: atest android.multiuser.cts.UserManagerTest
Test: atest com.android.server.pm.UserManagerTest
Test: atest UserManagerServiceUserTypeTest

Change-Id: If37480abafa784ce197b482103b6537a60fe2653
2022-08-19 10:59:30 -07:00
Austin Borger
20bcb3c4b8 Add pids to AttributionSource.
The cameraserver has a need for attributing connect calls to particular
processes. This patch introduces pids as a property of an
AttributionSource.

Test: Smoke test on cuttlefish
Bug: 190657833
Bug: 199526514
Change-Id: I6cdffed62447bbb741290dd9c2e5937254d02e3c
2022-08-15 16:59:53 -07:00
Massimo Carli
e454f1f4cc Merge "Per-app config for split screen aspect ratio" into tm-qpr-dev am: fe7a283daf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19136311

Change-Id: Id1f4405ec9f3fd9856756c241dd9128b0e30ef24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 14:47:22 +00:00
Massimo Carli
33cfc1579d Merge "Per-app config for split screen aspect ratio" 2022-08-12 17:32:52 +00:00
Sarup Dalwani
7da331c78e Merge "Making add and clear CPIF apis as TestApis" 2022-08-09 12:51:41 +00:00
TreeHugger Robot
75c305bdc2 Merge "Revert "Update ContentProvider to use the AM trace tag."" 2022-08-09 00:19:46 +00:00
Varun Shah
6e6f3862ff Revert "Update ContentProvider to use the AM trace tag."
This reverts commit f3f9b7ca95.

Reason for revert: b/240776812 regression

Change-Id: Ieb78fcfd631412b994054b66f6d753d13edf5a8c
2022-08-08 17:22:12 +00:00
Louis Chang
02705976b9 Merge "Reverting the Intent package-equivalent component checks" 2022-08-08 08:42:54 +00:00
Jay Sullivan
cf0115463c Merge "Add REQUESTED_PERMISSION_IMPLICIT flag" 2022-08-06 01:27:44 +00:00
Lucas Henneman
adbe824324 Exclude large tests from presubmit.
Bug: 222555677
Test: N/A
Merged-In: Ib19a2096a97367b37b3a22033ec2001693f23bff
Change-Id: I9ea72fd69a4771231b2342c50423cb1461d9ea09
2022-08-05 18:19:24 +00:00
Massimo Carli
209d86a426 Per-app config for split screen aspect ratio
We're defining a new compat framework change id that indicates whether a
given app should use the split screen aspect ratio.

Test: As manual testing use 'adb shell am compat disable/enable 208648326 <package-name>'. For the unit tests run 'atest WmTests:SizeCompatTests'.

Fixes: 208648326

Change-Id: I0232d6d98b10e546b840c08ffbf6e7be9c465965
2022-08-05 11:29:13 +00:00
Louis Chang
40cc579cd3 Reverting the Intent package-equivalent component checks
The commit 9c5a330 skips package checks if the package-equivalent
components are set. However, it could also result in inconsistent
behavior on #filterHashCode.

Fixing the original issue from the intent itself instead.

Bug: 64108432
Bug: 64789334
Test: atest TaskTests
Change-Id: I18c717e29072df91fb19eddbddc78153a28f9563
2022-08-05 10:17:24 +00:00
Louis Chang
f9c6e7b7fb Merge "Avoid configuration not updated after reasonable configuration changes" 2022-08-04 09:45:56 +00:00
Massimo Carli
4f1e391a83 Per-app config for split screen aspect ratio
We're defining a new compat framework change id that indicates whether a
given app should use the split screen aspect ratio.

Test: As manual testing use 'adb shell am compat disable/enable 208648326 <package-name>'. For the unit tests run 'atest WmTests:SizeCompatTests'.

Fixes: 208648326

Change-Id: I0232d6d98b10e546b840c08ffbf6e7be9c465965
Merged-In: I0232d6d98b10e546b840c08ffbf6e7be9c465965
2022-08-03 15:51:32 +00:00
TreeHugger Robot
d3466f390a Merge "Fix the bug where the added field into the toString implementation does not have a corresponding %s formatting." into tm-qpr-dev am: 4d334f4534
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19293060

Change-Id: I24b0c68816b567eef8affae285b5c79698a57c72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 02:33:01 +00:00
TreeHugger Robot
4d334f4534 Merge "Fix the bug where the added field into the toString implementation does not have a corresponding %s formatting." into tm-qpr-dev 2022-08-03 02:16:08 +00:00
Sarup Dalwani
d06acf698e Making add and clear CPIF apis as TestApis
Making addCrossProfileIntentFilter and clearCrossProfileIntentFilters as
TestApis so that we can write CTS device side test cases to emulate
behaviour used by 3P apps or profile owners. This is to ensure that no
malicious user can add/remove filters by following access control rules.

Bug: 238019465
Test: atest CtsAppCloningDeviceTestCases
Change-Id: I4084826cbc63b1afc5569bd310be694b11202aee
2022-08-02 17:49:56 +00:00
Lee Shombert
48900f8201 Merge "Increase the size of selected binder caches" 2022-08-02 17:08:47 +00:00
Lee Shombert
28f3934a25 Increase the size of selected binder caches
Bug: 237309566

The maximum size of selected binder caches is increased to avoid
overflow.  The overflow was found in a partner bug report.

The maximum size does not affect memory consumption until the cache
hits the limit, so caches that were not overflowing before will not
see increased memory consumption.  Also, the caches that are affected
by this change are either static (one per process) or exist in just a
few intances per process, so the total memory impact is small.

Note that most of the overflows occurred in vendor processes.

Test: atest
 * android.app.ApplicationPackageManagerTest
 * com.android.server.pm.PackageManagerTests
 * com.android.server.pm.PackageManagerServiceTest
 * com.android.server.compat.PlatformCompatTest
 * com.android.server.compat.CompatConfigTest
 * android.app.compat.CompatChangesTest
 * PlatformCompatGating

Change-Id: I7f60ad9008bf894d6cb967ce1a54ab33af650efc
2022-07-29 17:09:49 -07:00
TreeHugger Robot
bd8b0fcd00 Merge "Update ContentProvider to use the AM trace tag." 2022-07-29 19:35:13 +00:00
Varun Shah
f3f9b7ca95 Update ContentProvider to use the AM trace tag.
Fixes: 240405950
Test: m & verify trace tag
Change-Id: If0cb0b6a4a590836149b53284f584779303a7000
2022-07-29 10:51:29 -07:00
Tiger Huang
ae9d2aa672 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d am: 3995c4d303
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: Ic48b954694b8d6cafce8b421dcbcd94f63793acc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:47:33 +00:00
Tiger Huang
3995c4d303 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: If3a51277578c31ba2c0e8c75341b33cd1f5cd9ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:23:15 +00:00
Ömer Yaveroğlu
1d502c375b Fix the bug where the added field into the toString implementation does
not have a corresponding %s formatting.

Bug: 239134974
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Test: atest services/tests/servicestests/src/com/android/server/integrity
Change-Id: Ib9c3ecadfc5a823cd4fcd44237b25900f86b4e5c
Merged-In: Ib9c3ecadfc5a823cd4fcd44237b25900f86b4e5c
2022-07-27 09:26:46 +00:00