Commit Graph

12229 Commits

Author SHA1 Message Date
Matt Gilbride
01a8beee3f Merge "Add @PermissionName annotation to complement @PermissionMethod" 2022-10-04 15:41:17 +00:00
mattgilbride
af19a09a4f Add @PermissionName annotation to complement @PermissionMethod
For use by static analysis, @PermissionMethod documents
the methods in the platform that perform permission "checks" (e.g.
context.enforceCallingOrSelfPermission).

@PermissionName denotes that the annoated String is a permission name.
It is typically used to annotate the argument to a @PermissionMethod
that is the permission value.  This is consumed by static analysis, for
example when helper methods wrap @PermissionMethod calls to pass a hard
coded permission value e.g. "enforceAudioSettingsPermission".

See: go/enforcepermission-migration-design
Bug: 247537842
Test: Tested manually, ultimately will be tested in presubmit (atest
AndroidFrameworkLintCheckerTest, see b/240445172)

Change-Id: I811ae923de62046e782ec7b109a0f99483dab4b2
2022-10-03 14:59:38 +00:00
Helen Qin
20ff355163 Framework credential manager developer APIs definitions.
The CredentialManager module provides solution for developers to create
or get credential from a user that can be used to authenticate to the app.
It can potentially launch system level UI flows to collect user consent,
render a unified selector when more than one credential exists, and
perform anything else needed.

Check bug id for detailed design.

Note that this is still very early stage of productionizing the module
and proper test cases will be added subsequently when the service
gets more concrete business logic.

Bug: 246564035
CTS-Coverage-Bug: 246637346
Test: Local Build & Deployment
Change-Id: Ia5884a7f6a3908de3b8b4b29f154f98e25730bd7
2022-10-03 07:28:30 +00:00
Anna Zhuravleva
8b0ce1fbac Merge "Add HealthConnect system service scaffold." 2022-09-30 15:05:30 +00:00
Anna Zhuravleva
5bdd56de55 Add HealthConnect system service scaffold.
Setup scaffold for the Health Connect system service.
This service will provide system APIs to read and write
health data.

Bug: 249321392
CTS-Coverage-Bug: 248508112
Test: atest android.healthconnect.cts
Change-Id: I503c24a039c37d09895fc4f73a1de1a13eeb72b0
2022-09-29 16:03:25 +00:00
TreeHugger Robot
1df179f411 Merge "Introduce PreapprovalDetails class (1/n)" 2022-09-29 06:46:55 +00:00
TreeHugger Robot
fdfde64c82 Merge "Log resource api times to statsd" 2022-09-28 15:57:27 +00:00
Lee Shombert
1452bc759a Log resource api times to statsd
Bug: 246953799

Log resource api times to statsd.  Two APIs are logged:
getResourceValue() and retrieveAttributes().  Other APIs may be timed
by the runtime layer but these are not logged.

This fixes a bug in ResourceTimer.startTimer() that caused the class
to skip the first repeated publication point.

This change renames the two RecourceTimer instances in
android_util_AssetManager.cpp to "_timer" to be more explicit and to
avoid the use of the more generic "_tag".

Test: manual
Change-Id: I0c5e0906f79ff35db1e34593275b39fb7f2f179b
2022-09-27 10:47:02 -07:00
Ahaan Ugale
f531cf31c0 Merge "Add credential manager FEATURE_ constant to Package Manager Test: Manual. Built locally Bug: 248609653" 2022-09-27 15:12:03 +00:00
Matt Gilbride
f4ea4c04e6 Merge "Add @PermissionMethod annotation" 2022-09-27 14:55:21 +00:00
Jackal Guo
1840f826d3 Introduce PreapprovalDetails class (1/n)
In order to let developers to get the install approval from users
pre-download instead of post-commit for better UX, introduce the
new data class PreapprovalDetails to encapsulate all the necessary
data for the upcoming installation.

Bug: 242677131
Test: build
Test: atest CtsContentTestCases:PreapprovalDetailsTest
Change-Id: I29a364262f980d5e30c4800fa0cfb2caae8ffa79
2022-09-27 14:02:55 +08:00
Reema Bajwa
4e5c074c20 Add credential manager FEATURE_ constant to Package Manager
Test: Manual. Built locally
Bug: 248609653

Change-Id: I51e5bb298bc2683c9dd4eb6627cba889ebe3d24f
2022-09-26 19:11:23 +00:00
TreeHugger Robot
0f564cb808 Merge "10% improvement by changing FastNative to CriticalNative" 2022-09-26 10:06:33 +00:00
mattgilbride
75c72cec7f Add @PermissionMethod annotation
For use by static analysis, @PermissionMethod documents
the methods in the platform that perform permission "checks" (e.g.
context.enforceCallingOrSelfPermission).

Said methods either return in int of type @PermissionResult, or return
void and potentially throw a SecurityException.

There are currently two platform lints that care about this information.
ManualPermissionCheckDetector and PackageVisibilityDetector.

See: go/enforcepermission-migration-design
Bug: 247537842
Test: Tested manually, ultimately will be tested in presubmit (atest
AndroidFrameworkLintCheckerTest, see b/240445172)

Change-Id: Ia21ba748eab37b532b591edb2599bb78ea0c8c9d
2022-09-25 23:56:26 +00:00
Treehugger Robot
e1a71c0b76 Merge "Expand ownership to all package manager owners" am: b63b381eb1 am: f069df3de6 am: ddd4db1ab9 am: df0e997103 am: d740ad1baa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2227757

Change-Id: I6d5c21d1628f6be1bea718898844188e516685a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-23 07:25:40 +00:00
Treehugger Robot
d740ad1baa Merge "Expand ownership to all package manager owners" am: b63b381eb1 am: f069df3de6 am: ddd4db1ab9 am: df0e997103
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2227757

Change-Id: I9fc6b812cafe09d75cbf52f171f54e4b2409b955
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 20:13:44 +00:00
Patrick Baumann
0ef37c52ee Expand ownership to all package manager owners
Change-Id: I8608cd42f3fb737831f022b1e9ad6ea600eb9b2f
2022-09-22 16:05:06 +00:00
Pedro Loureiro
0b0d664ca6 Merge "Revert framework-res splits from apexes" 2022-09-22 09:52:59 +00:00
felkachang
3b589c8f90 10% improvement by changing FastNative to CriticalNative
This patch change native APIs from @FastNative to @CriticalNative.
From the benchmark, it gets 10% improvement.

The CriticalNative requires the native function can't access JNIEnv
and any jobject. nativeGetAttributeIndex can't apply CriticalNative
because it needs JNIEnv to transform Java String.

This patches move the 16 APIs from FastNative to CriticalNative.
* 11 APIs check the null document and throw NPE in native layer. They
  are change to return ERROR_NULL_DOCUMENT and throw NPE in java
  layer.
* 5 APIs just remove JNIEnv and jobject parameters.
  * nativeGetNamespace
  * nativeGetName
  * nativeGetText
  * nativeGetStyleAttribute
  * nativeGetSourceResId

Reference: ag/19992907
Bug: 173709508

Test: # for FastNative
     atest --iterations 20 \
       CorePerfTests:android.content.res.XmlBlockBenchmark \
       2>&1 > fn20.txt
Test: # for CriticalNative
     atest --iterations 20 \
       CorePerfTests:android.content.res.XmlBlockBenchmark \
       2>&1 > cn20.txt
Test: http://b/issues/173709508#comment2

Change-Id: I43ccd1177fa86df5cd4d432119cbd06d370e82d8
2022-09-22 12:44:13 +08:00
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
Pedro Loureiro
ad7bf54043 Revert framework-res splits from apexes
Test: presubmit

Bug: 195732042
Change-Id: I64f1640f72b18dcbda43be5a673872fd6c12ab7e
2022-09-16 17:10:42 +00:00
Songchun Fan
1a32d6ed68 Merge "[pm] fix getPackageArchiveInfo" into tm-qpr-dev am: 9d198ade93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19734691

Change-Id: I612ec1b9490d4ba39ece795d735b1073dacac3aa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-13 16:47:46 +00:00
Songchun Fan
9d198ade93 Merge "[pm] fix getPackageArchiveInfo" into tm-qpr-dev 2022-09-13 16:43:45 +00:00
Songchun Fan
0079f9bcb4 [pm] fix getPackageArchiveInfo
BUG: 243479679
Test: atest android.content.pm.cts.PackageManagerTest#testGetPackageArchiveInfo
Change-Id: I3a353c9b0f05117b233888d74a42f1ed3cf26eb8
(cherry picked from commit 9407d10cd0)
Merged-In: I3a353c9b0f05117b233888d74a42f1ed3cf26eb8
2022-09-13 16:43:25 +00:00
Riddle Hsu
48d11607a9 Merge "Apply override scale from entry points on client" 2022-09-08 03:35:48 +00:00
TreeHugger Robot
1d9daf50c3 Merge "Added check for user info is not null" into tm-qpr-dev 2022-09-07 04:23:04 +00:00
Mayank Garg
0ad4f80cbb Added check for user info is not null
user's actual state might have changed by the time the broadcast is
received, so added a null check.

Bug: 237413499
Test: atest HandlerThreadingDomainTest LocationTimeZoneProviderControllerTest LocationTimeZoneProviderTest ZoneInfoDbTimeZoneProviderEventPreProcessorTest

Change-Id: I79087a3e83a51b81568bdb6ff5540ee78b51b91a
Merged-In: Ieacbb35e522b35353c96de1f162a8a71388b4b04
(cherry pick from commit 799c6528f5)
2022-09-07 03:59:14 +00:00
Vali Calinescu
7b083780be Merge "Adjust aspect ratio override portrait fullscreen" into tm-qpr-dev am: 5ba309cce6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19641194

Change-Id: Iccca3b8cad845f31b8a1fe8afb9e283bb39a1f53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 11:11:12 +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
0c66bf2399 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
Merged-In: I84eaab4df045c93fb2c159a789852094caf9121a
2022-08-31 11:20:50 +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