Commit Graph

16324 Commits

Author SHA1 Message Date
Joe Bolinger
aa910853fb Merge "Fix crash when BiometricPrompt requests swipe pattern and talk back is enabled." into sc-dev 2021-06-23 21:25:03 +00:00
Nate Myren
3e51f7cabd Merge "Create Attribution Chains in HistoricalOps" into sc-dev 2021-06-23 21:23:19 +00:00
Dmitri Plotnikov
fb1dc9e3db Merge "Deprecate BatteryStatsHelper and BatterySipper" into sc-dev 2021-06-23 20:16:26 +00:00
Nate Myren
fd49debdc0 Create Attribution Chains in HistoricalOps
Add a historical flag to signify that attribution chains should be
assembled. Assemble the chains, filter out middle nodes, and attach the
last visible node to the start as a proxy info

Bug: 158792096
Test: manual
Change-Id: I8fbd8f438c62b28fd90039440e86224c624dea79
2021-06-23 12:12:15 -07:00
TreeHugger Robot
8890ec0d54 Merge "Remove Intent.ACSD from KEYCODE_SEARCH action in-app" into sc-dev 2021-06-23 18:16:15 +00:00
Dmitri Plotnikov
5be4b3e526 Deprecate BatteryStatsHelper and BatterySipper
Remaining clients of BatteryStatsHelper and BatterySipper should switch
over to BatteryStatsManager.getBatteryUsageStats()

Bug: 191877985
Test: N/A
Change-Id: Icb55e574a3d91bc6bef716e6724b352ef3d426b3
2021-06-23 10:17:00 -07:00
Jeff DeCew
ccb14ac813 Merge "Don't crash the notification bind if the icon fails to resolve." into sc-dev 2021-06-23 14:26:09 +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
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
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
cfc8359f34 Merge "Fix Bluetooth power accounting after a BT crash" into sc-dev 2021-06-22 21:19:55 +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
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
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
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
Joe Bolinger
a16f4f21b2 Fix crash when BiometricPrompt requests swipe pattern and talk back is enabled.
The view id can be Integer.MAX_VALUE, which causes the crash.

Fix: 185164902
Test: manual
Change-Id: Id51357f4cfa52cdd27d7dbd235fbd154b1031624
2021-06-21 15:51:05 -07:00
Jeff DeCew
adf5e468d1 Don't crash the notification bind if the icon fails to resolve.
Bug: 189924598
Test: reproduce the bug and notice that instead of an empty collapsed state, you get everything except the icon.
Change-Id: Ibc4bebf0bbf42192ce70b748f98725e312fa54b8
2021-06-18 16:58:44 -04: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
Bernardo Rufino
836cbc6693 Remove Intent.ACSD from KEYCODE_SEARCH action in-app
Apps can't close system dialogs anymore due to abuse. If we branch to
launching the assistant, VoiceInteractionSession has the power to close
system dialogs (besides I suspect this code-path is unused).

Bug: 191131805
Test: In-app, adb shell input keycode KEYCODE_SEARCH, verify no crash
Change-Id: I2ef20e0a0d9f05c26747e4dfca5bdb6ec7bd1c1f
2021-06-18 14:32:20 +01: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
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
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
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
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
cac7ab9c5c Merge "Make inline suggestions tooltip is not magnified" into sc-dev 2021-06-15 21:22:09 +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
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
7c6032d0ed Merge "Fix jank trigger name on non-english locales" into sc-dev 2021-06-14 13:28:03 +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
TreeHugger Robot
dfbde545f3 Merge "Hotword: Propagate the DSP DetectedResult." into sc-dev 2021-06-09 22:32:37 +00:00
TYM Tsai
0a496a2aa0 Make inline suggestions tooltip is not magnified
Because the tooltip is part of suggestions on keyboard, it should be the
same as keyboard that is not magnified by the accessibility magnifier
when the magnifier is full screen mode.

Bug: 183462449
Test: Manual
Test: atest CtsAutoFillServiceTestCases
Change-Id: I3cfd84357b556a85c2788776d3966cf94d4a981d
2021-06-10 02:16:19 +08:00
Marcin Oczeretko
f98fd1a7c8 Fix jank trigger name on non-english locales
Specify en-us locale when calling string.format to generate the trigger name.

Bug: b/190614325
Test: build
Change-Id: I9f83dd0d7cacafa683884d2551f48ac3cc19ac89
2021-06-09 19:02:28 +01:00
James O'Leary
d1bc261d8d Quantizer improvements
The original versions of these quantizers landed a couple months back,
and they were fine. Since then, we've had several opportunities to
iterate on them. This change lands improvements from those iterations.
TL;DR: 18% faster, big bug fix to WSMeans, code is cleaner (hopefully)

- QuantizerMap indexes an image's pixels, 'unique-ing' them by reducing
the pixel array to a map with keys of colors, and values of population.
This allows other quantizers to operate much more quickly: instead of
working on each pixel individually, they're able to operate in bulk.
- QuantizerWu uses flat arrays instead of 3D arrays and is more
understandable IMHO.
- QuantizerWsmeans has speed improvements, most importantly, it has a
big bug fix. When a Kmeans-based quantizer algo starts, it must first
assign the pixels to any one of the starting clusters. The original
implementation decided what cluster to assign a pixel to by finding the
cluster closest to the pixel. However, the algo terminates if no pixels
moved after one iteration of the algorithm, and since the pixels were
already in the cluster closest to them, the algo would immediately
terminate before it actually figured out where the cluster moved to
after pixels were assigned to it, and had a chance to move pixels around
based on that.
- Funnily enough, even though this _should_ mean Wsmeans got a lot
slower since it has to do more iterations, it is actually 16% faster

Additionally, during review of this CL:
An accidental dependency on iteration order of a Set was introduced,
causing inconsistent initialization of the mPoints array, creating
inconsistent results from the quantizer.

Removing the dependency on hashes of float[], and avoiding Maps
altogether, removes a dependency on hash codes of pointers that existed
during review, making it easier to have verifiable consistency across
iterations. This also improves speed slightly, from 55 ms to 39 ms
(tested on sunfish, first 9 wallpapers in Landscapes, City Scapes, and
Art categories, and averaged)

Bug: 189931209
Test: ran performance tests with VariationalKMeansQuantizer,
the previous Celebi = Wu + Wsmeans quantizer, and the new Celebi =
new Wu + new Wsmeans quantizers, over 100 iterations. Wu speed is
roughly the same, Wsmeans is 18%. Verified quantizer output is stable
for the same input pixels, run 100,000 times for each of two wallpapers.
Change-Id: I3324d29860c098ea1fd602b8d4197837e732f4f1
2021-06-09 13:33:41 -04:00
Tiger Huang
7be2a4c964 Defer dispatching insets to app if its window frame will be changed soon
If the frames of insets source window and the frame of an app window
are changed in the same layout pass, we should dispatch the insets
calculated from the new insets source frames and the new app window
frame. So when the app frame is not up-to-date, we defer dispatching
insets to the app.

Fix: 160732586
Test: Add logs to check if we dispatch the correct insets to apps while
      rotating the display.
Change-Id: Ic9e71d8eabde51067b740b35404ae7c9b68228d7
2021-06-09 15:52:39 +08:00
Ahaan Ugale
603ea83bd7 Hotword: Propagate the DSP DetectedResult.
Fix: 190572818
Test: atest CtsVoiceInteractionTestCases
Change-Id: I8a109f6540cf8c342b827464ccc2beabd99d1b9c
2021-06-08 23:33:47 -07:00
Ryan Mitchell
b063594188 Do not canonicalize overlay config test paths
Some devices may not have certain partitions available and the
OverlayConfigTests use hardcoded paths to test OverlayConfig
functionality. This change ensures that the temporary directory
created to test OverlayConfig has all of the partitions defined in
PackagePartitions#SYSTEM_PARTITIONS within it.

Bug: 190469357
Bug: 187020117
Bug: 187020675
Test: atest OverlayConfigTest
Change-Id: I511e24b7ccfe82e6e89ceea7107457439793ef77
Merged-In: I511e24b7ccfe82e6e89ceea7107457439793ef77
2021-06-08 15:33:03 -07:00
tomnatan
1752194766 Rename PlatformCompat#setOverridesOnReleaseBuilds to putOverridesOnReleaseBuilds.
Bug: 190495884
Test: atest FrameworksServicesTests:PlatformCompatTest
Change-Id: I0b84732b5639b199f11b50b993ed3da4b3df1eda
2021-06-08 15:45:16 +00:00
Wu Ahan
924618b41c Merge changes from topic "unlock_jank_instrument" into sc-dev
* changes:
  Instrument jank and latency of the unlock animation of lockscreen
  Support configuration as parameter while beginning the instrumentation
2021-06-04 04:19:38 +00:00
Joe Bolinger
896ac3e18f Merge "Fix feedback and animations for face to fingerprint fallback authentication." into sc-dev 2021-06-04 00:12:40 +00:00