Commit Graph

12392 Commits

Author SHA1 Message Date
Sanjana Sunil
46bb3e8a55 Add a mainline-accessible API to kill an app on sandbox death
This API can be accessed by mainline modules to kill a specific app
process when its associated sandbox dies. It takes in the IBinder value
of the corresponding IApplicationThread of the app to kill it.

REASON_DEPENDENCY_DIED and SUBREASON_SDK_SANDBOX_DIED are used in the
emitted AppProcessDied atom.

Bug: 261558210
Test: atest SdkSandboxLifecycleHostTest
Test: m statsd && statsd_testdrive 373 emits an atom with
SUBREASON_SDK_SANDBOX_DIED

Change-Id: Id37023eabaa5f734bb67bee07a0f779c355cc100
2022-12-20 13:07:19 +00:00
Ashish Kumar Gaurav
22487777e9 Merge "Added logging of cases where getType is called without readPermission using westworld atom" 2022-12-09 19:52:32 +00:00
Ashish Kumar
0ac7f42201 Added logging of cases where getType is called without readPermission using westworld atom
Test: Manual test using statsd_testdrive

Bug: b/260556486

AMC review doc: https://eldar.corp.google.com/assessments/7185522/drafts/683536140?jsmode=du

Change-Id: Iedd317d1226672d7b6086d6d3cff5c9efa9b8d8f
2022-12-09 16:41:09 +00:00
Seth Moore
690554e0d6 Merge "Add remote_provisioning system service" am: 222a476ac5 am: 9430c5fed0 am: d6405bf424
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263722

Change-Id: I09e0681e2c980a148dc265e15f58beda67515214
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 16:39:21 +00:00
Seth Moore
d6405bf424 Merge "Add remote_provisioning system service" am: 222a476ac5 am: 9430c5fed0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263722

Change-Id: Id71268d27836111005aa1678c180c4a9081363a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 16:11:30 +00:00
Seth Moore
9430c5fed0 Merge "Add remote_provisioning system service" am: 222a476ac5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263722

Change-Id: If44dd0e853f47267f37656ef0095894294e140cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 15:49:00 +00:00
Faye Yan
f3b8521bd1 Merge "Create a new permission flag 'module' to grant permission for APKs in APEX." 2022-12-08 05:12:06 +00:00
TreeHugger Robot
dca85cd154 Merge "Add SelfTargeting test plan" 2022-12-08 03:51:20 +00:00
fayey
1bfb93f40c Create a new permission flag 'module' to grant permission for APKs in APEX.
Verification in ag/20661169 and ag/20666093.

Test: atest CtsPermission2TestCases

bug: 241823178
Change-Id: I8a05e1eb38f41a1d875d18120cada9cecdb860f3
2022-12-07 22:27:39 +00:00
TreeHugger Robot
71548300e3 Merge "Update documentation of FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS" 2022-12-07 17:39:47 +00:00
Seth Moore
0277b66f9e Add remote_provisioning system service
This service is callable by system components like keystore2. This
service calls into a mainline module API to do all the work for remote
provisioning.

Also include new OWNERS for the RemoteProvisioning implementation.

Bug: 254112668
Test: Locally modify keystore to call the new service
Change-Id: I6708d0b415798c78a4d66f279589d9def552ae78
2022-12-06 17:30:26 -08:00
Chun-Wei Wang
852ed0b811 Merge "Let the client specify the thread to run the callback" 2022-12-07 01:01:01 +00:00
Ajinkya Chalke
0e4781c59b Merge "Adds new actions to enable notes integration." 2022-12-06 16:37:03 +00:00
Ajinkya Chalke
728a4fe834 Adds new actions to enable notes integration.
- Added 1 new intent action to launch notes app on lock screen and when
  unlocked.
- Added a new boolean extra to inform notes app whether to show UI that
  supports using a stylus.

Test: run build
Bug: 251200619
Fixes: 251200619
Change-Id: Icd351c7da14cb70637615b85f3f25640aeb37206
2022-12-06 16:15:25 +00:00
felkachang
06aa20724a Add SelfTargeting test plan
This patch adds a trigger. The trigger is triggered when someone
changes the followin files
* core/java/android/content/om/*
* core/java/com/android/internal/content/om/*
* core/jni/*Overlay*

The trigger triggers the following tests to run.
* SelfTargetingOverlayDeviceTests
* CtsContentTestCases
    * android.content.om.cts
    * android.content.res.loader.cts

Bug: 205919743
Test: atest --collect-tests-only -p \
      frameworks/base/core/java/android/content/om/
Test: atest --collect-tests-only -p \
      frameworks/base/core/java/com/android/internal/content/om/
Test: atest --collect-tests-only -p \
      frameworks/base/core/jni
Change-Id: I6018d5806c93b7b0a87331a95e144a6ab45c068c
2022-12-06 14:52:10 +00:00
JW Wang
92c56b1b2f Let the client specify the thread to run the callback
Per
https://g3doc.corp.google.com/company/teams/android-api-council/guidelines/index.md?cl=head#provide-executor

Bug: 235306967
Test: atest CtsStagedInstallHostTestCases
Change-Id: I3c86e33288275e480073a963da42f809624f9932
2022-12-06 14:29:01 +08:00
Jing Ji
6621b2b5cb Merge "Add foreground service type "fileManagement"" 2022-12-06 04:44:31 +00:00
Jing Ji
b6528779cb Merge "Include CtsAppFgsTestCases and CtsShortFgsTestCases in presubmit" 2022-12-05 21:07:19 +00:00
Winson Chiu
2a27fab69a Merge "Force notify overlay paths on package replaced due to system update uninstall" 2022-12-05 17:14:39 +00:00
Jing Ji
85632c8485 Include CtsAppFgsTestCases and CtsShortFgsTestCases in presubmit
Bug: 254662522
Bug: 246792057
Test: treehugger
Change-Id: I9878debf94549f53713bf158773768aed73ab09f
2022-12-02 13:48:57 -08:00
Mary Xia
c82e25e13c Rename targetsDisplayCategory to requiredDisplayCategory based on feedback to avoid confusion with lunch target and
specify activity needs a particular display category.

RESOURCES_FINALIZATION=attribute rename
Test: atest PackageParserTest
Bug: 260161954
Change-Id: I882da1efe8c2dd6837eaab4566d4f15d2762b757
2022-12-02 20:45:51 +00:00
Yasin Kilicdere
bd3b879b2d Merge "Defer sending broadcasts to when the user switch is complete." 2022-12-02 15:51:41 +00:00
Jing Ji
8ef80d302e Add foreground service type "fileManagement"
Bug: 254662338
Bug: 246792057
Test: atest CtsAppFgsTestCases
Change-Id: Iea7310fce15783e287435cf8d29ab7439cce43d8
2022-12-01 23:32:08 -08:00
Tyler Freeman
bae1102a51 fix(non linear font scaling): fix crash with certain negative SP values
The crash was due to some old logic that was looking for near matches.
Now we only return exact matches, and let the interpolation deal with
near matches.

Add test to make sure it doesn't crash at any value passed in.

Test: atest FrameworksCoreTests:android.content.res.FontScaleConverterTest

Bug: b/260984829

Change-Id: Ic90d1c5b48862e4f78b90be5926c9ce6d468acf9
2022-12-01 17:05:32 -08:00
Yasin Kilicdere
3430907152 Defer sending broadcasts to when the user switch is complete.
Send the following broadcasts after a user switch is complete,
instead of while the switch is happening.
* ACTION_USER_BACKGROUND
* ACTION_USER_FOREGROUND
* ACTION_USER_SWITCHED

Otherwise managing these broadcasts occupy system_server process and
make the user switch longer than it could be.

If a code should be run while the user switch is happening, in other
words while the screen is frozen, (because possibly they move things
around on the screen), they should register a UserSwitchObserver and
override its onUserSwitching method. Then when they are done, they
should call reply.sendResult(null); on the provided reply parameter.

Bug: 257437695
Test: atest FrameworksServicesTests:UserControllerTest
Change-Id: I7b8662600b45459cd83653ac6f15e73335903262
2022-12-01 19:37:21 +00:00
TreeHugger Robot
329bb092dc Merge "Add a new function in ResourcesProvider for SelfTargeting" 2022-12-01 11:29:35 +00:00
TreeHugger Robot
f7aaff3232 Merge "Unhide the "SHORT_SERVICE" FGS type." 2022-12-01 08:05:18 +00:00
felkachang
212f61cf58 Add a new function in ResourcesProvider for SelfTargeting
This patch adds a new function to load a SelfTargeting overlay to be
a ResourcesProvider instance. If the app wants to overlay itself’s
resources, the first step is to call this new function to get a
ResourcesProvider instance and then add the ResourcesProvider in a
ResourcesLoader instance.
* ResourcesProvider#loadOverlay

Test: atest \
          OverlayHostTests \
          OverlayDeviceTests \
          SelfTargetingOverlayDeviceTests \
          OverlayRemountedTest \
          FrameworksServicesTests:com.android.server.om \
          CtsContentTestCases:android.content.om.cts \
          CtsContentTestCases:android.content.res.loader.cts \
          idmap2_tests

Bug: 205919743
Change-Id: Id54da44a54ee6cbc685ad486d1bf69ef388c33ae
2022-12-01 06:13:44 +00:00
felkachang
ec915c669c Add overlay management functions into OverlayManager
Self-Targeting apps can manage the overlays by the following classes.
* OverlayManager
* OverlayManagerTransaction

For OverlayManager, it provides 2 functions for the app.
* Start a overlay manager transaction
      OverlayManager#beginTransaction()
* List the registered overlays
      OverlayManager#getOverlayInfosForTarget(targetPackage).

For OverlayManagerTransaction, it provides 3 functions for the app.
* register a FabricatedOverlay
      OverlayManagerTransaction#registerFabricatedOverlay
* unregister a FabricatedOverlay
      OverlayManagerTransaction#unregisterFabricatedOverlay
* commit the transaction
      OverlayManagerTransaction#commit

Test: atest \
          OverlayHostTests \
          OverlayDeviceTests \
          SelfTargetingOverlayDeviceTests \
          OverlayRemountedTest \
          FrameworksServicesTests:com.android.server.om \
          CtsContentTestCases:android.content.om.cts \
          idmap2_tests

Bug: 205919743
Change-Id: I3b0b60a30689b3d033f96cfcf02e2f67b480f207
2022-12-01 00:23:36 +00:00
Yurii Zubrytskyi
505d514184 Merge changes I94af279b,Id6e0e49d
* changes:
  Optimize filter/alias rebuilding in AssetManager2
  Make ApkAssets::IsUpToDate() @CriticalNative
2022-11-30 18:44:16 +00:00
Makoto Onuki
53f8439da4 Unhide the "SHORT_SERVICE" FGS type.
Bug: 257270313
cts-coverage-bug: 260748204
Test: manual test with a test app.
Change-Id: I2e40b26a971c777971c28fb733ef9e72766c04c7
2022-11-30 10:01:31 -08:00
Felka Chang
1b8935ae7b Merge "Add self-targeting constructor in FabaricatedOverlay" 2022-11-30 12:20:15 +00:00
Chun-Wei Wang
28b621620b Merge "Install constraints API" 2022-11-30 11:22:22 +00:00
Yurii Zubrytskyi
fbdfba51b3 Make ApkAssets::IsUpToDate() @CriticalNative
This function keeps being called hundreds times per second

Bug: 237583012
Test: Build + boot + UTs

Change-Id: Id6e0e49d561e0c81f6960a5fd77b2076892bd339
2022-11-30 01:00:34 -08:00
felkachang
f661351bad Add self-targeting constructor in FabaricatedOverlay
When the app wants to overlay its resource in runtime, it’s a
SelfTargeting scenario. This patch adds a new builder
constructor in FabaricatedOverlay for SelfTargeting.  It's
 `Builder(@NonNull String overlayName, @NonNull String targetPackage)`.

The app needs to pass 2  parameters.
* the overlay name
* target package to be overlaid

This patch also marks the nullability and checks the arguments of
`setResourceValue` and it needs related CTS tests to verify the
nullability.
* setResourceValue

Test: atest \
          OverlayHostTests \
          OverlayDeviceTests \
          SelfTargetingOverlayDeviceTests \
          OverlayRemountedTest \
          FrameworksServicesTests:com.android.server.om \
          CtsContentTestCases:android.content.om.cts \
          idmap2_tests

Bug: 205919743
Change-Id: Ie8e2de13076c9d28bbcf7ee52deab91114f7ec57
2022-11-30 13:08:13 +08:00
TreeHugger Robot
966144cc5e Merge "Let self-targeting apps be able access OverlayManager" 2022-11-30 01:59:19 +00:00
William Loh
fe266d0918 Merge "Add API to skip application enable in install flow" 2022-11-30 01:31:05 +00:00
Nick Kovacs
29bc594ae0 Merge "Enforce min installable target sdk version" 2022-11-30 00:11:00 +00:00
Tyler Freeman
7f0fb8234f Merge "feat(non linear font scaling)!: add FontScaleConverter for non-linear font scaling." 2022-11-29 23:43:18 +00:00
Tyler Freeman
5f7036df71 feat(non linear font scaling)!: add FontScaleConverter for non-linear font scaling.
Non-linear font scaling is meant to improve readability at larger font
scales: larger fonts will scale up more slowly than smaller fonts, so we
don't get ridiculously huge fonts that don't fit on the screen.

The thinking here is that large fonts are already big enough to read,
but we still want to scale them slightly to preserve the visual
hierarchy when compared to smaller fonts.

The FontScaleConverter converts SP dimensions to DP, to be used in
TypedValue.applyDimension() which will affect most TextViews and font
sizes automatically.

For now, all the lookup tables are hardcoded. A follow-up CL will make
them configurable via XML. The hardcoded arrays also default to a linear
curve, as to not break any tests. The non-linear curve will come in a
follow-up CL, to make it easier to roll-back if requested.

Also included is some Javascript to generate the hardcoded arrays, which
can later be manually tweaked and optimized.

Test: unit, CTS, and manual:
1. Run `adb shell settings put system font_scale 2.0`
2. Check different apps to see if they are readable.

Bug: b/237558231

Change-Id: I17d67252bf31f55e57e1f3e8a0f638770e6d2cfd
2022-11-29 12:09:02 -08:00
Nick Kovacs
ee536b9dcf Enforce min installable target sdk version
This change will block the installation (but not the execution)
of apps that do not meet the minimum target sdk version.

The intention is to improve security and privacy by blocking low
target sdk apps as malware can target older sdk versions to avoid
the enforcement of new API behavior.

This change is fenced off by a feature flag. The plan is to
progressively ramp up the min_installable_target_sdk version
up to version 23 for Android U.

Bug: 237321649
Test: adb shell device_config put package_manager_service MinInstallableTargetSdk__install_block_enabled true
Test: adb shell device_config put package_manager_service MinInstallableTargetSdk__min_installable_target_sdk 5
Test: adb install com.senecacreeksoftware.simpletip-3.apk (this app uses
target sdk 4)
Test: adb shell device_config put package_manager_service
MinInstallableTargetSdk__min_installable_target_sdk 6
Test: adb install com.senecacreeksoftware.simpletip-3.apk
Test: adb shell device_config put package_manager_service
MinInstallableTargetSdk__min_installable_target_sdk 23
Test: Attempted side load install via files app
Test: Attempted install from Play Store of low target sdk app

Change-Id: Id86c65d088b62b0a9b36734c14fbf919fa458e32
2022-11-29 18:21:15 +00:00
Jing Ji
813816a4cc Merge "Add health connect permissions to FGS type "health"" 2022-11-29 17:14:44 +00:00
felkachang
1cbf6fbbb4 Let self-targeting apps be able access OverlayManager
Self-targeting apps can't get an OverlayManager instance without the
system privilege.  This patch makes sure that the self-targeting
application can get an OverlayManager instance via Context.

```
OverlayManager overlayManager =
         context.getSystemService(OverlayManager.class);
```

In order to make the self-targeting feature compatible in the future,
this patch adds SELF_TARGETING_OVERLAY compatibility feature.

Test: atest \
          OverlayHostTests \
          OverlayDeviceTests \
          SelfTargetingOverlayDeviceTests \
          OverlayRemountedTest \
          FrameworksServicesTests:com.android.server.om \
          CtsContentTestCases:android.content.om.cts \
          idmap2_tests

Bug: 205919743
Change-Id: Ib0b619a2a54e22d31e6c14bf700e421688b6f506
2022-11-30 00:49:42 +08:00
Jean-Michel Trivi
2e1f2cea27 Merge "AudioDeviceVolumeManager and VolumeInfo API changes" into tm-qpr-dev am: dcb2710560
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20568529

Change-Id: I75590a39b1102b57c9ee834ac9137273e5b88dbf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-28 22:39:15 +00:00
Matt Gilbride
8e7404af95 Merge "Add parameters to @PermissionMethod" 2022-11-28 20:07:34 +00:00
Jean-Michel Trivi
7ec3e24816 AudioDeviceVolumeManager and VolumeInfo API changes
Context service name for accessing AudioDeviceVolume manager.
Add support in VolumeInfo to know whether it carries an explicit
  mute/unmute information (vs just default value of isMuted()).

Bug: 244326361
Test: atest android.media.audio.cts.AudioDeviceVolumeManagerTest
Test: atest android.media.audio.cts.VolumeInfoTest
Change-Id: Id718fbd7e0d5795ac480d9188faad4a70fba9808
Merged-In: Id718fbd7e0d5795ac480d9188faad4a70fba9808
2022-11-25 20:48:06 +00:00
Nikita Ioffe
952b771899 Merge "Register managers provided by the com.android.virt APEX" am: a8d89abdad am: aab7551889
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2304136

Change-Id: I1666cb79ba28e8ccdbb5ece1eff34cd30f9bc1c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-25 18:45:20 +00:00
Nikita Ioffe
aab7551889 Merge "Register managers provided by the com.android.virt APEX" am: a8d89abdad
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2304136

Change-Id: Ieeeed9d0e6332c4e22da4c6fec6ec1ddbd9c5f29
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-25 18:20:32 +00:00
Nikita Ioffe
ea76ae6fee Register managers provided by the com.android.virt APEX
This allows apps to retrieve an instance of VirtualMachineManager via
Context.getSystemService() API.

Bug: 249093790
Test: builds
Test: atest --test-mapping packages/modules/Virtualization:avf-presubmit
Change-Id: I488c275343753f2a3af6270cbad2ab02f33f203f
Merged-In: I488c275343753f2a3af6270cbad2ab02f33f203f
(cherry picked from commit 167b913ad4)
2022-11-25 16:02:52 +00:00
Nikita Ioffe
d063f91638 Merge "Register managers provided by the com.android.virt APEX" 2022-11-25 14:51:56 +00:00