Commit Graph

16553 Commits

Author SHA1 Message Date
Bryan
a4e18d2aa2 Changes to how we notify widget restore participants of new ids am: f66eab85a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15002452

Change-Id: I89ad9a21fb6c8839452d9d07f525500067886f0a
2021-06-23 09:50:41 +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
751c2669b9 Merge changes from topics "cc-composing-update", "cc-merge-equals" into sc-dev am: 5d42257561
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14994799

Change-Id: I434f301111da3011860f1d4197c8e4afacc251f8
2021-06-23 05:41:43 +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
Dmitri Plotnikov
04e4cc4a0b 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: I36d69b2eeda31c7e81d012ab0401b2cdb547bba3
2021-06-22 21:21:40 +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
70e09b660c 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: Ibb3617c3512eb4a4c362350d5949797aa5c485ad
2021-06-22 19:34:44 +00: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
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
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
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
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
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
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
TreeHugger Robot
fee0ac2158 Merge "Fix emphasized button drawable to avoid ripple shape glitch." into sc-dev 2021-06-17 21:39:07 +00:00
Jeff DeCew
5eeb0d554b Fix emphasized button drawable to avoid ripple shape glitch.
Fixes: 191001646
Test: tap a button in the alarm notification
Change-Id: I3d8f77f96dc799bc36a44104874514c9320d11ce
2021-06-17 15:57:47 -04:00
Dmitri Plotnikov
beae43aceb Merge changes from topic "battery_usage_stats_before_reset" into sc-dev am: 4f3d2e64cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14924713

Change-Id: Ie054d644b69cf16d661c39900c609e239eb0b190
2021-06-17 17:31:24 +00:00
Dmitri Plotnikov
376aed6bba Add BatteryUsageStatsQuery parameters: time range am: c24fb81627
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14922773

Change-Id: I8c31a2ced556edda35c10d1a61c882a762daa4a7
2021-06-17 17:31:20 +00:00
Dmitri Plotnikov
672745dd06 Implement BatteryUsageStatsStore am: f7e7d084ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14922032

Change-Id: I4c1bca3f65b56e34187a8a47acdde65ee6c399ad
2021-06-17 17:31:17 +00:00
Dmitri Plotnikov
4f3d2e64cd Merge changes from topic "battery_usage_stats_before_reset" into sc-dev
* changes:
  Implement battery_usage_stats_before_reset pull atom
  Add BatteryUsageStatsQuery parameters: time range
  Implement BatteryUsageStatsStore
  Convert BatteryUsageStats to and from XML
  Add BatteryUsageStats.add(BatteryUsageStats)
2021-06-17 17:23:00 +00:00
jasonwshsu
eb304bd341 Add the log for new supported accessibility button type 'Accessibility Floating Menu'
* Logs the atom AccessibilityShortcutReported in westworld

Bug: 189860801
Test: make statsd_testdrive && statsd_testdrive 266
Change-Id: I4e5814cb6a1d877af540e278de5ffa398d6d0351
2021-06-17 16:16:07 +00:00
Fiona Campbell
97f24b694e Merge "Fix memory leak in BrightnessSynchronizer" into sc-dev am: d77459a21f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14551803

Change-Id: I71749d5e0aefcbac60f112952e889fe5f6783759
2021-06-17 13:54:36 +00:00
Fiona Campbell
d77459a21f Merge "Fix memory leak in BrightnessSynchronizer" into sc-dev 2021-06-17 13:41:45 +00:00
Dmitri Plotnikov
5ee2f6caac Implement battery_usage_stats_before_reset pull atom
Bug: 187223764
Test: m statsd_testdrive; statsd_testdrive 10111
Change-Id: I3c27deb57672d962f1029219b50d21d784c997b7
Merged-In: I3c27deb57672d962f1029219b50d21d784c997b7
(cherry picked from commit 0d25efa419)
2021-06-17 05:24:48 +00:00
Dmitri Plotnikov
c24fb81627 Add BatteryUsageStatsQuery parameters: time range
Bug: 187223764
Test: atest FrameworksCoreTests:BatteryUsageStatsProviderTest
Change-Id: If370360695a3f0327f07457abac1fd02164864e1
Merged-In: If370360695a3f0327f07457abac1fd02164864e1
(cherry picked from commit 6ea400b27c)
2021-06-17 05:24:37 +00:00
Dmitri Plotnikov
f7e7d084ee Implement BatteryUsageStatsStore
Bug: 187223764
Test: atest FrameworksCoreTests:BatteryUsageStatsStoreTest

Change-Id: I66bbb173f402e795c900ccf3bc82b8fb210142a4
Merged-In: I66bbb173f402e795c900ccf3bc82b8fb210142a4
(cherry picked from commit 2a0460f701)
2021-06-17 05:24:24 +00:00
Ahaan Ugale
fb12492de7 ContentCapture: Notify when Composing region changes.
Sending the notification from the InputConnection layer reduces the
number of events that are handled (merged) by ContentCapture. We are
also able to handle composing span being removed; at the TextView layer,
we cannot do that as we don't know if the composing span will be added
back, which happens on typing).

Bug: 184311217
Test: manual - append chars, delete chars, replace text, move cursor to
 composing text, move cursor to remove composing span, drag cursor
Test: atest android.contentcaptureservice.cts.LoginActivityTest
Change-Id: I0e9d153cf7ba2734f38cb1b6044eb7b670fb34ad
2021-06-16 10:47:59 -07:00
TreeHugger Robot
8b164133d0 Merge changes from topic "cuj-sysui-launches" into sc-dev am: b538b60ea6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14965045

Change-Id: I26803319f43b8d88ac4511e65f622871f80dc431
2021-06-16 16:49:58 +00:00
TreeHugger Robot
b538b60ea6 Merge changes from topic "cuj-sysui-launches" into sc-dev
* changes:
  Instrument SysUI app launches
  Add SysUI app launches CUJ to InteractionJankMonitor
2021-06-16 16:45:48 +00:00
Jordan Demeulenaere
00b6fa549d Add SysUI app launches CUJ to InteractionJankMonitor
Bug: 191002773
Test: make build
Change-Id: I9e3e72c5d0d242ca0a7b562be80f1d243fbb5704
2021-06-16 15:26:42 +02:00
TreeHugger Robot
a17a93ccea Merge "Make inline suggestions tooltip is not magnified" into sc-dev am: cac7ab9c5c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14514105

Change-Id: I5ed34a3dacd098be66e030143e8fc4af41292bca
2021-06-15 21:37:19 +00:00
TreeHugger Robot
cac7ab9c5c Merge "Make inline suggestions tooltip is not magnified" into sc-dev 2021-06-15 21:22:09 +00:00
TreeHugger Robot
dfc69a5021 Merge "Add BatteryUsageStatsProtoTests to presubmit" into sc-dev am: 0a9650dcde
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14971175

Change-Id: I911b98ffe7a8ac94491509e60bd34a05e3cdb7e2
2021-06-15 18:19:02 +00:00
Fiona Campbell
37427762b3 Fix memory leak in BrightnessSynchronizer
Previously, a queue would be written to, a lot more often than items
were removed from it. This caused it to grow massively.

This cl changes the way that the synchronizer works, updating both
values when needed and avoiding potential race conditions.

It's relevant to note that mDisplayManager.setBrightness will only change the value if it is different, but Settings.System.putIntForUser will set it regardless, therefore causing a second "int changed" message to be sent.

Bug: 177523959
Test: manual
Test: loop this command: adb shell settings put system screen_brightness \
$((RANDOM%100))
Test: loop this command: adb shell settings put system \
screen_brightness_float 0.$((RANDOM%100))

Change-Id: I6cafb48c204ce5245c4450a6098473e06c334667
2021-06-15 16:13:04 +01:00
Xin Li
48e70ad8bc DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Merged-In: I81c036a8484d14683db9450b55bd379c7a728d73
Change-Id: I71fe9744d88740a8d95235ddb4c8ab91881473ce
2021-06-14 22:01:46 -07:00
Dmitri Plotnikov
b2baae41c2 Add BatteryUsageStatsProtoTests to presubmit
Bug: 189221904
Test: atest --test-mapping frameworks/base/core/java/android/os
Test: atest --test-mapping frameworks/base/core/java/com/android/internal/os
Change-Id: Id279e899a19c81726cabb5e134a199bb3c367475
2021-06-14 18:56:55 -07:00
Marcin Oczeretko
1e09c2fbda Merge "Fix jank trigger name on non-english locales" into sc-dev am: 7c6032d0ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14920937

Change-Id: Ifbd58f49cba8c298255fc701c8242cc35ea00c44
2021-06-14 13:42:50 +00:00
Marcin Oczeretko
7c6032d0ed Merge "Fix jank trigger name on non-english locales" into sc-dev 2021-06-14 13:28:03 +00:00
Tiger Huang
4586f92923 Merge "Defer dispatching insets to app if its window frame will be changed soon" into sc-dev am: 50ae7cbf1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881021

Change-Id: Ifba48a864d7090a46cb300df2ecb567eedc619de
2021-06-10 08:12:08 +00:00
Tiger Huang
50ae7cbf1b Merge "Defer dispatching insets to app if its window frame will be changed soon" into sc-dev 2021-06-10 07:55:53 +00:00