Commit Graph

17073 Commits

Author SHA1 Message Date
Nikita Ioffe
83575fb0ce Merge "Rename partner-apex-allowlist to vendor-apex-allowlist" into sc-dev am: b3db287943 am: 1b6a8a8297
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15054865

Change-Id: I6d167fcf646d25e59036b7be947c1ed3d6e82609
2021-06-23 11:27:50 +00:00
Nikita Ioffe
b3db287943 Merge "Rename partner-apex-allowlist to vendor-apex-allowlist" into sc-dev 2021-06-23 10:47:38 +00:00
Bryan
81754dadee Changes to how we notify widget restore participants of new ids am: f66eab85a0 am: 31c040dcee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15002452

Change-Id: I39d1b8ff8734a971f60c49dff6f542d3d17221bf
2021-06-23 10:10:13 +00:00
Bryan
f66eab85a0 Changes to how we notify widget restore participants of new ids
As part of widget restore, we need to notify participants (hosts &
providers) of the mapping between ancestral and new widget ids.
Prior to this change, this was done at the end of system restore
and after each restore-at-install of unbundled apps.

There were two issues with this:
1) We would try to notify not-yet-installed participants at the end of
system restore and then *not* try again when they were installed.
2) We relied on PACKAGE_ADDED broadcasts to know which participants were
installed, but these are delivered asynchronously and not guaranteed
to be processed before the restoreFinished call.

After this change, we:
1) Only notify participants that are actually installed
2) Use receipt of the PACKAGE_ADDED / CHANGED broadcast to trigger
notification of any restore participants that are added or changed
*after* system restore completes.

2 is safe because by the time PackageManager sends the package
added / changed broadcasts, the app data restore has been completed,
and the app has been killed if needed.

Bug: 162057170
Test: Manual restore of Keep widget via cloud and d2d
Change-Id: I51dec33d09b62faba6d7c7daacd718a3c0682f7d
2021-06-23 09:24:09 +00:00
Ahaan Ugale
d15f7b1117 Merge changes from topics "cc-composing-update", "cc-merge-equals" into sc-dev am: 5d42257561 am: 3a318f5eff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14994799

Change-Id: I930ae5311a3b1d1aa31a23fe12e50517ecfcf017
2021-06-23 06:31:17 +00:00
Ahaan Ugale
5d42257561 Merge changes from topics "cc-composing-update", "cc-merge-equals" into sc-dev
* changes:
  ContentCapture: Don't ignore events with changed composing/selection span
  ContentCapture: Notify when Composing region changes.
2021-06-23 05:05:19 +00:00
Treehugger Robot
bdf217f091 Merge "Allow app zygote preload to retain files across fork" am: f334f4ed31 am: 5465af8413 am: cdc831bac6 am: 9a44a29d3b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393

Change-Id: Ib37b6cbbc111fc0a268bf0bfb5fa4d1cb0d8c1c9
2021-06-23 00:29:32 +00:00
Treehugger Robot
9a44a29d3b Merge "Allow app zygote preload to retain files across fork" am: f334f4ed31 am: 5465af8413 am: cdc831bac6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393

Change-Id: I6c7f12d9e48eb939ce0c5218f2b1b6ee8ee00a71
2021-06-22 23:55:06 +00:00
Dmitri Plotnikov
d26adcc55b Merge "Fix Bluetooth power accounting after a BT crash" into sc-dev am: cfc8359f34 am: 7b1b070a32
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15055646

Change-Id: Ifdd9f29f7e57e51140aa22645ab419e634b60bde
2021-06-22 21:54:15 +00:00
Mark Renouf
b6e5db818a Merge "Fixes long screenshot landscape and split window bugs" into sc-dev am: db27afd2b3 am: 1c59307803
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15066724

Change-Id: I844c4430f23fb69c5fb4d755624df439978d3e48
2021-06-22 21:51:47 +00:00
Nikita Ioffe
843ab33e4f Merge "Add sys config to handle apexes that are allowed to be updated" into sc-dev am: 23403fdc99 am: 6b4a60cc21
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14843816

Change-Id: Icf083febe554161bdd272cb22eb8445c6acd2300
2021-06-22 21:41:17 +00:00
Sergey Volnov
ee49432d51 Merge "Implement preriodic trusted process restarting for hotword detectors." into sc-dev am: 56686819a8 am: dc52e50c3d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14679832

Change-Id: I5b828f852789428d2074570ba016ea7645711a50
2021-06-22 21:39:45 +00:00
Dmitri Plotnikov
6b495754c0 Merge "Fix Bluetooth power accounting after a BT crash" into sc-dev am: cfc8359f34 am: c739df25cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15055646

Change-Id: I31031ef25603b4acb7f889116c0d5c78cd558eb9
2021-06-22 21:35:00 +00:00
Dmitri Plotnikov
7b1b070a32 Merge "Fix Bluetooth power accounting after a BT crash" into sc-dev am: cfc8359f34
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15055646

Change-Id: I189d02f2a0b756953d54f8826babd895a77b5b31
2021-06-22 21:22:41 +00:00
Dmitri Plotnikov
cfc8359f34 Merge "Fix Bluetooth power accounting after a BT crash" into sc-dev 2021-06-22 21:19:55 +00:00
Mark Renouf
ef559766b8 Merge "Fixes long screenshot landscape and split window bugs" into sc-dev am: db27afd2b3 am: caa9e3d086
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15066724

Change-Id: Ia87081909846d2297e87f5af046a29d7943e7be2
2021-06-22 19:52:48 +00:00
Mark Renouf
1c59307803 Merge "Fixes long screenshot landscape and split window bugs" into sc-dev am: db27afd2b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15066724

Change-Id: I02ba1308636e9ac1b87cbb34b0177c35155370d7
2021-06-22 19:33:46 +00:00
Nikita Ioffe
d204005ac3 Rename partner-apex-allowlist to vendor-apex-allowlist
Also rename corresponding field and getter in SystemConfig.java, and add
new ALLOW_VENDOR_APEX flag to control what partitions can specify
allowed vendor APEXEs (so far: /product, /oem and /vendor).

Bug: 189274479
Test: atest FrameworksServicesTests:SystemConfigTest
Change-Id: I680090d7a1237cb95c1aa4ea3975c50d06b35fcc
2021-06-22 19:06:48 +01:00
Dmitri Plotnikov
1beb4fcdbd Fix Bluetooth power accounting after a BT crash
Bug: 191488536
Test: Use BatteryStatsViewer to take a note of BT usage time
      $ adb shell killall com.android.bluetooth
      Use BatteryStatsViewer to verify that BT usage time is going up
Change-Id: I8438f19bb4bd6365da6d582fb7347f0a2cbddc1c
2021-06-22 10:51:34 -07:00
Treehugger Robot
cdc831bac6 Merge "Allow app zygote preload to retain files across fork" am: f334f4ed31 am: 5465af8413
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393

Change-Id: I94bf3f8dd2b1d4a9f9f73689d24009bae4daed9d
2021-06-22 17:28:52 +00:00
Mark Renouf
1c996ad287 Fixes long screenshot landscape and split window bugs
Fixes incorrect view transform in ViewRenderer

The tranform was mapping to on-screen coordinates, where
in-window position is needed.

Bug: 183045126
Bug: 189289758
Bug: 189235588

Test: manual, long screenshot the bottom app in split window mode
Change-Id: Ibaa9987b229f9e8ec0a1002ee84d797ca6026fb9
2021-06-22 17:16:01 +00:00
Treehugger Robot
f334f4ed31 Merge "Allow app zygote preload to retain files across fork" 2021-06-22 15:32:40 +00:00
Nikita Ioffe
6b4a60cc21 Merge "Add sys config to handle apexes that are allowed to be updated" into sc-dev am: 23403fdc99
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14843816

Change-Id: Ia1be8595d22d4946c0b6c9af9725a23df6b46dbd
2021-06-22 15:11:11 +00:00
Sergey Volnov
dc52e50c3d Merge "Implement preriodic trusted process restarting for hotword detectors." into sc-dev am: 56686819a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14679832

Change-Id: I746f8771183b3b0bcea3746410334f94a5cdfd3e
2021-06-22 15:08:06 +00:00
TreeHugger Robot
3979ee87a8 Merge "Do not canonicalize overlay config test paths" into sc-dev am: 890daeb051
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14908371

Change-Id: Idfd0b5a0d27dbaca145454258c60cfe09faf4dc9
2021-06-22 14:59:46 +00:00
Nikita Ioffe
7cde151bb4 Merge "Add sys config to handle apexes that are allowed to be updated" into sc-dev am: 23403fdc99
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14843816

Change-Id: I011fdb4925bfe859e7b2dc573a8f30e0a67b4a10
2021-06-22 14:22:07 +00:00
Nikita Ioffe
23403fdc99 Merge "Add sys config to handle apexes that are allowed to be updated" into sc-dev 2021-06-22 14:15:41 +00:00
Sergey Volnov
90a6e6bacc Merge "Implement preriodic trusted process restarting for hotword detectors." into sc-dev am: 56686819a8 am: 952946bf67
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14679832

Change-Id: I6abb7134f755e00bd63b5bb73b61de5e51af465d
2021-06-22 13:53:17 +00:00
Sergey Volnov
c9400ce540 Merge "Implement preriodic trusted process restarting for hotword detectors." into sc-dev am: 56686819a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14679832

Change-Id: I867de8428dafcebbc880596850b810c2da7191e8
2021-06-22 13:42:51 +00:00
Sergey Volnov
56686819a8 Merge "Implement preriodic trusted process restarting for hotword detectors." into sc-dev 2021-06-22 13:33:08 +00:00
Nikita Ioffe
637be99afd Add sys config to handle apexes that are allowed to be updated
Unlike staged installer check, we can't check if given APEX package is
allowed to be updated at session creation time, since we don't have
knowledge of the package being installed yet. Instead, the check is
implemented in PackageInstallerSession#handleInstall.

Like staged install check, allowed apex update check has similar
exemptions (adb is allowed to update any APEX,
`adb shell pm --bypass-allowed-apex-update-check` makes next install
session bypass the check).

In order to implement these exemptions, a new
INSTALL_DISABLE_ALLOWED_APEX_UPDATE_CHECK flag that can only be set by
system is added. PackageInstallerSession will skip the APEX update
checks if INSTALL_DISABLE_ALLOWED_APEX_UPDATE_CHECK is set.

Bug: 189274479
Test: atest CtsStagedInstallHostTestCases
Test: atest GtsStagedInstallHostTestCases
Test: atest FrameworksServicesTests:SystemConfigTest
Change-Id: I22921a3ac4d43011b565733d7a7183e5cdb4fe80
Merged-In: I22921a3ac4d43011b565733d7a7183e5cdb4fe80
(cherry picked from commit aafaaec0d5)
2021-06-22 13:39:41 +01:00
Sergey Volnov
1b2b909a16 Implement preriodic trusted process restarting for hotword detectors.
Bug: 188892570
Test: 1) adb shell cmd voiceinteraction restart-detection
2) Tried locally with restarting every 30 seconds, verified everything
works
3) adb shell ps | grep <test_package_name> - shows:

u0_a221       3328  1026 14501612 69208 0                   0 R com.google.th
u0_i9002      9049  1026 14448104 53860 0                   0 S com.google.th:com.google.th.SampleHotwordDetectionService:hotword_detector_3

Change-Id: I9f08943212c20b83da35c18df56460eaedbbf8f0
2021-06-22 12:43:08 +01:00
TreeHugger Robot
890daeb051 Merge "Do not canonicalize overlay config test paths" into sc-dev 2021-06-21 23:07:21 +00:00
Nikita Ioffe
2655740ff6 Merge "Add sys config to handle apexes that are allowed to be updated" 2021-06-21 19:19:05 +00:00
TreeHugger Robot
dc9e7b9bfa Merge "Revert "Revert "Release cblocks back to the free pool""" into sc-dev am: cc265a58de am: 81a2e619d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807907

Change-Id: I9ec7223b9283b182aa367217bbc9e14db83212f5
2021-06-21 11:59:06 +00:00
TreeHugger Robot
81a2e619d2 Merge "Revert "Revert "Release cblocks back to the free pool""" into sc-dev am: cc265a58de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807907

Change-Id: Ia9572192125ee78bf0ac9c93a5c2abe74d1f2c36
2021-06-21 11:50:23 +00:00
TreeHugger Robot
6430a5d2c0 Merge "Revert "Revert "Release cblocks back to the free pool""" into sc-dev am: cc265a58de am: 3f0a8dd54b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807907

Change-Id: I874d30dfc049d5c8a1e1fdc5873890c7566ae965
2021-06-18 17:46:03 +00:00
TreeHugger Robot
3b75c63a94 Merge "Revert "Revert "Release cblocks back to the free pool""" into sc-dev am: cc265a58de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807907

Change-Id: Id0f7bc5af60d5faa5c1cf04c09db2cd3775769e4
2021-06-18 17:32:37 +00:00
TreeHugger Robot
cc265a58de Merge "Revert "Revert "Release cblocks back to the free pool""" into sc-dev 2021-06-18 17:28:19 +00:00
Nikita Ioffe
aafaaec0d5 Add sys config to handle apexes that are allowed to be updated
Unlike staged installer check, we can't check if given APEX package is
allowed to be updated at session creation time, since we don't have
knowledge of the package being installed yet. Instead, the check is
implemented in PackageInstallerSession#handleInstall.

Like staged install check, allowed apex update check has similar
exemptions (adb is allowed to update any APEX,
`adb shell pm --bypass-allowed-apex-update-check` makes next install
session bypass the check).

In order to implement these exemptions, a new
INSTALL_DISABLE_ALLOWED_APEX_UPDATE_CHECK flag that can only be set by
system is added. PackageInstallerSession will skip the APEX update
checks if INSTALL_DISABLE_ALLOWED_APEX_UPDATE_CHECK is set.

Bug: 189274479
Test: atest CtsStagedInstallHostTestCases
Test: atest GtsStagedInstallHostTestCases
Test: atest FrameworksServicesTests:SystemConfigTest
Change-Id: I22921a3ac4d43011b565733d7a7183e5cdb4fe80
2021-06-18 18:12:08 +01:00
Egor Pasko
ed10978de1 Allow app zygote preload to retain files across fork
The bug proposes to 'move' the /proc/self/fd/ readlink/stat/etc checks
performed by the FileDescriptorAllowlist from before-fork to an earlier
stage.

The original aim was to allow the app zygote Preload hook to open
ashmem/memfd read-only regions to save more RAM (around 5MiB on aarch64)
via sharing more across processes. Potentially other files/sockets can
be opened - the app zygote takes responsibility of managing file
descriptor access controls across its own processes. App Zygote Preload
does not run 3rd party code.

Unfortunately a straightforward move of the checks to
just-before-preload has disadvantages:
* opens more codepaths for potential accidental misuse (the zygote
  accepts commands between preload and fork, there are valid usecases
  for extending these commands)
* this way FileDescriptorAllowlist would need to support more file
  descriptor types (sockets and maybe pipes), which is not needed now
  because these FDs are closed right before forking

The solution proposed here is to:
1. Determine the set of file descriptors open before preload
2. Run the preload hook
3. Determine FDs opened by the hook and allow them to remain open across
   fork
4. Hypothetical new attempts to preload (if ever supported) will not
   affect the allowed FDs - the preload will be able to toss its own FDs
   the way it wants, but not open the new-new ones

Bug: 184808875
Test: Manual: unreleased Chrome patch: while in app zygote preload,
      create ashmem region, passes it to 'untrusted_app' (=browser
      process), and call mmap(2) on it.
Change-Id: Ie302eabca83a0e4f409cb131e4308b73e5f6a580
2021-06-18 17:06:11 +02:00
Jason Hsu
a925474f4a Merge "Add the log for new supported accessibility button type 'Accessibility Floating Menu'" into sc-dev am: 72679b768a am: b6d925786c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14779652

Change-Id: Ia1d6e15a741e91c8f97e40104e59b4b675d84d5a
2021-06-18 02:41:55 +00:00
Jason Hsu
8cffdbb02a Merge "Add the log for new supported accessibility button type 'Accessibility Floating Menu'" into sc-dev am: 72679b768a am: 2841c508f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14779652

Change-Id: Iee4e5511e060f25ac31759e94ee5044f1fadf6a2
2021-06-18 02:34:23 +00:00
Jason Hsu
f01e33f152 Merge "Add the log for new supported accessibility button type 'Accessibility Floating Menu'" into sc-dev am: 72679b768a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14779652

Change-Id: Idfbf45595b36ffe1d3328f7327012d8e1bc69696
2021-06-18 02:33:14 +00:00
Jason Hsu
2841c508f5 Merge "Add the log for new supported accessibility button type 'Accessibility Floating Menu'" into sc-dev am: 72679b768a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14779652

Change-Id: I11c5f4ad01900286a5589ca849faecf28e4ae3f3
2021-06-18 02:32:36 +00:00
Jason Hsu
72679b768a Merge "Add the log for new supported accessibility button type 'Accessibility Floating Menu'" into sc-dev 2021-06-18 02:10:28 +00:00
TreeHugger Robot
fc3b8d1481 Merge "Fix emphasized button drawable to avoid ripple shape glitch." into sc-dev am: fee0ac2158 am: b0c2138ec9 am: 6fa7920841
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15017990

Change-Id: Ia2a76d07beae40c6f4f7fb3142fd4aa81253f6b6
2021-06-17 22:01:08 +00:00
TreeHugger Robot
6fa7920841 Merge "Fix emphasized button drawable to avoid ripple shape glitch." into sc-dev am: fee0ac2158 am: b0c2138ec9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15017990

Change-Id: Ic1fb2bb52680c9a72e24277c7d5867726541ac53
2021-06-17 21:57:19 +00:00
TreeHugger Robot
b0c2138ec9 Merge "Fix emphasized button drawable to avoid ripple shape glitch." into sc-dev am: fee0ac2158
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15017990

Change-Id: I72ff141203838d83375258e075f6a2b2ce05f889
2021-06-17 21:52:13 +00:00
TreeHugger Robot
6f623845f1 Merge "Fix emphasized button drawable to avoid ripple shape glitch." into sc-dev am: fee0ac2158
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15017990

Change-Id: If71b9f5d555e6ff24b58217fe24100a0851b0fc1
2021-06-17 21:52:02 +00:00