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
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
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
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
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
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
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
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
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)
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
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
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
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
This enables passing them and and storing them in the .frro file but no
further.
Bug: 243066074
Test: Manual
Change-Id: I5c9723e69d175a536f9739619c6b6bf3162a5027
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