Commit Graph

20905 Commits

Author SHA1 Message Date
Ryan Mitchell
0b81d98549 Merge "Fix RRO handleConfigurationChanged race condition" into sc-dev am: 55128109d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14923667

Change-Id: I0223ae25eaccbb5357b6738e0b75df7c534a72a3
2021-06-10 19:52:00 +00:00
Ryan Mitchell
55128109d9 Merge "Fix RRO handleConfigurationChanged race condition" into sc-dev 2021-06-10 19:49:40 +00:00
Ryan Mitchell
119a7f5591 Fix RRO handleConfigurationChanged race condition
Retrieval of the system and system UI themes should be done with the
ResourcesManager lock held to ensure the theme retrieved has the new
overlays applied.

Bug: 189100984
Test: manual
Change-Id: Ibe27ec745ea5a914d3d05e393598a336d96a55e6
2021-06-10 08:41:17 -07:00
Pavel Grafov
0365d2850a Merge "Don't reset user VPN without reason" into sc-dev am: c0115519f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14717702

Change-Id: I4fb463bae9700c5e633ec10e5d6fe0090783734e
2021-06-10 15:36:37 +00:00
Pavel Grafov
c0115519f6 Merge "Don't reset user VPN without reason" into sc-dev 2021-06-10 15:31:04 +00:00
James O'Leary
dc4c3fbc4b Merge changes from topics "quantizer_improved_logic", "reintroduce_scaling_fixes" into sc-dev am: e0970984c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14802974

Change-Id: I85e5f01f2a1ca271a779ea251613dcee87dc16da
2021-06-09 22:29:34 +00:00
James O'Leary
e0970984c8 Merge changes from topics "quantizer_improved_logic", "reintroduce_scaling_fixes" into sc-dev
* changes:
  Quantize image to 128 colors instead of 5
  Quantizer improvements
  Sort colors from high count => low count
  Don't interpolate image input to quantizer
  Cache set wallpaper as PNG instead of JPEG
  Only rescale wallpaper if its > display height
2021-06-09 22:23:24 +00:00
Julia Reynolds
78cea6e7e4 Merge "Update logic about parent and convo channels" into sc-dev am: b87598c3cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14907947

Change-Id: I1022456aabdd973fac8f9617f62ae95460c3cbf7
2021-06-09 18:02:32 +00:00
James O'Leary
bf1b65be0e Quantize image to 128 colors instead of 5
Quantizing an image to five colors results in an extreme amount of
averaging of colors, leading to low chroma colors and erasing colors
from the image that the eye gravitates towards.

Coupled with a change to ensure there's still a broadly accurate signal
of a given cluster's population of the image, via summing the population
of all the clusters close to the hue of the cluster, and with proof that
having this many data points doesn't lead to instability in results,
we gain access to a much larger variety of colors. This gives room to
add heuristics to avoid 'bad' colors, as well as increase the
number of colorful colors we offer.

Bug: 189931209
Test: Test tons and tons of wallpapers over a couple days.
Change-Id: Ifc2d9393039194c151920536b9217ae9636ff0d6
2021-06-09 13:33:41 -04: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
Julia Reynolds
b87598c3cc Merge "Update logic about parent and convo channels" into sc-dev 2021-06-09 17:33:23 +00:00
Rubin Xu
6cfe624e1f Merge "Allow any apps to call DPM.isUsbDataSignalingEnabled()" into sc-dev am: b9be267361
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807577

Change-Id: I007834e3abb82662d3790fd275a57706b9747139
2021-06-09 16:13:08 +00:00
Rubin Xu
b9be267361 Merge "Allow any apps to call DPM.isUsbDataSignalingEnabled()" into sc-dev 2021-06-09 15:54:21 +00:00
James O'Leary
70cfb49c65 Sort colors from high count => low count
The colors were being sorted by population ascending, sorting by
population descending fixes a long-standing flaky test that became
a 100% reproducible failure once scaling fixes were introduced.

The test failure that caught this is CTS' WallpaperManagerTest's method
wallpaperColors_secondary. It creates a bitmap that is mostly red, with
a smaller area of blue.

Before the set of 4 CLs in this topic, when the wallpaper was downscaled
by WallpaperManager, it introduced new colors to the wallpaper due to
bilinear filtering and JPEG compression. With the new colors introduced
by scaling, the least popular color was blue enough to pass
WallpaperManagerTest's wallpaperColors_primary method, and the 2nd least
popular color was red enough to pass wallpaperColors_secondary.

With CLs for consistent image input to quantizers, namely 2 CLs, cache
wallpaper as PNG instead of JPEG, and only rescale the wallpaper if it
is greater than the display height, the scaling/JPEG artifacts are not
introduced, which then exposes the bug that primary/secondary were the
least popular/2nd least popular colors in the image, instead of the
most popular/2nd most popular, as intended.

Bug: 188373181
Test: atest CtsAppTestCases:android.app.cts.WallpaperManagerTest
#wallpaperColors_secondary --, use helper methods to store
the bitmap after downscaling to confirm introduction of new colors
before other CLs in this topic, use go/monetstudio to confirm
quantization results from that downscaled image. Check test against
all 4 CLs, confirm test starts failing once "Only rescale wallpaper if
its > display height" CL is introduced.

Change-Id: I143f824fbd961b81604d427a0570b3a171bdeb79
2021-06-09 11:31:57 -04:00
James O'Leary
87c669d959 Don't interpolate image input to quantizer
With `false`, nearest neighbor is used during scaling, with `true`,
bilinear interpolation is used. Bilinear interpolation can introduce
colors that weren't in the original image (ex. overemphasizing red/brown
highlights in a mostly B+W image of the Mandolorian). Better to avoid
that.

Bug: 189931209
Test: Test tons and tons of wallpapers over a couple days.
Change-Id: I425f95793ca593dbbc5008ef59f4baedaea318a6
2021-06-09 11:31:57 -04:00
Julia Reynolds
99a5975af8 Update logic about parent and convo channels
To handle the case where an app sends a notification directly
to a custom channel, and to properly show priority markings
on conversation tiles

Test: atest; manually ensure convo tiles are marked as priority
Fixes: 184709662
Change-Id: I8f9b6169943da5670bc09fd16bbe692fd43d2cf6
2021-06-09 14:28:17 +00:00
Pavel Grafov
d406212ac2 Don't reset user VPN without reason
When DPM.setAlwaysOnVpn is called with package=null, it resets
any VPN configured by the user. With this change it won't happen
anymore: it will only reset VPN configuration if it was previously
configured by the admin.

If an admin actually wants to remove any user configured VPN, they
can enforce DISALLOW_CONFIG_VPN restriction which will remove any
user VPNs and will prevent the user from configuring a new one.

+ Also make sure that when the DPC removes an always-on VPN
configuration, the package loses ability to start VPN until the
user authorizes it again.

Bug: 139823667
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ia703015b4e8d7eaf156358d7eb000d6f58d32238
2021-06-09 14:22:01 +01:00
Rubin Xu
4d68ae240b Allow any apps to call DPM.isUsbDataSignalingEnabled()
This is to allow 3p apps to query the state of the policy so they
can show appropriate UX to the user in case the app's interaction
with the plugged-in USB devices is  disrupted by the admin policy.

Bug: 190024751
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I829ff84256e0288b88c11add53da312ee2bc2558
2021-06-09 10:13:21 +01:00
Tom Natan
5525ee1b6f Merge "Rename PlatformCompat#setOverridesOnReleaseBuilds to putOverridesOnReleaseBuilds." into sc-dev am: 5977f60c19
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14424456

Change-Id: I5d0223158027a0f58b194e2218a740e002ee6637
2021-06-08 18:34:57 +00:00
TreeHugger Robot
e7db415759 Merge "Preventing component spoofing during getShortcutIntent" into sc-dev am: f59889a08f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14669179

Change-Id: Ife9be96a61879c767a3dd654290160ab3ba7e399
2021-06-08 18:34:01 +00:00
Tom Natan
5977f60c19 Merge "Rename PlatformCompat#setOverridesOnReleaseBuilds to putOverridesOnReleaseBuilds." into sc-dev 2021-06-08 18:23:42 +00:00
TreeHugger Robot
f59889a08f Merge "Preventing component spoofing during getShortcutIntent" into sc-dev 2021-06-08 18:21:21 +00: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
Kholoud Mohamed
01d13bb7ee Merge "Fix security vulnerability in DPMS" into sc-dev am: 209f21d2ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14881810

Change-Id: I2b7a105b394125516bdcce470c9a5a77cd40760d
2021-06-08 13:24:24 +00:00
Kholoud Mohamed
209f21d2ae Merge "Fix security vulnerability in DPMS" into sc-dev 2021-06-08 13:17:37 +00:00
Wei Sheng Shih
b068266886 Merge "Introduce setSplashscreenStyle to specify splash screen style." into sc-dev am: 6b0741b3fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14609925

Change-Id: I87fd2e21067ba80b409c99875f219deb03267f33
2021-06-08 12:26:40 +00:00
Wei Sheng Shih
6b0741b3fe Merge "Introduce setSplashscreenStyle to specify splash screen style." into sc-dev 2021-06-08 12:16:24 +00:00
wilsonshih
72a03ff774 Introduce setSplashscreenStyle to specify splash screen style.
Provide a method ActivityOptions#setSplashscreenStyle to specify
splash screen style if needed.

If not set, the default option will be empty-style splash screen, so
without any other change, the activity launched from systemui with
ActivityOptions will become empty style splash screen.

Bug: 188023621
Bug: 189293785

Test: manual test start application from Launcher and Notification.

Change-Id: I299320db8f32fbd835c7ec0acaad3df3486a13f5
2021-06-08 12:21:27 +08:00
Chris Tate
51fdd14879 Merge "Improve test flakiness around FGS notifications" into sc-dev am: 86ed597d51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14829740

Change-Id: I656b22e791c5883ea56b3c085a6f72da0b7b124f
2021-06-07 18:18:07 +00:00
kholoud mohamed
54dc06ab99 Fix security vulnerability in DPMS
Changed DPMS#getCrossProfileCalendarPackagesForUser to always require
INTERACT_ACROSS_USERS or INTERACT_ACROSS_USERS_FULL.

Bug: 187043444
Test: N/A
Change-Id: I53300bfe2e0481df0d473cc73a85857b5603a45e
2021-06-07 16:05:20 +01:00
Christopher Tate
9396c029ac Improve test flakiness around FGS notifications
Make sure that even transient package-associated state is cleared when
the package is uninstalled, and provide a testing hook for instrumenting
global rate limits appropriately to high-rate test sequences.

Bug: 190019349
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Test: atest CtsAppTestCases:android.app.cts.NotificationManagerTest
Change-Id: Ic38157c6f21bcf09bcf74de591e41dc64f7bf0f7
2021-06-03 16:34:26 -07:00
Chris Tate
587acbbc2f Merge "Fix FGS enter/exit statslog semantics" into sc-dev am: d3a0befee4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14823656

Change-Id: I0690cb6e354fa1a6dc8a58286bc717ef6ad77b6b
2021-06-03 22:31:10 +00:00
Chris Tate
d3a0befee4 Merge "Fix FGS enter/exit statslog semantics" into sc-dev 2021-06-03 22:19:23 +00:00
Jeff DeCew
b92267e793 Merge "Fix background color (again)" into sc-dev am: 7b96af705c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14805377

Change-Id: I5397ca0f7d689c9a51af6e5be76ddfbaada7743f
2021-06-03 19:37:06 +00:00
Jeff DeCew
7b96af705c Merge "Fix background color (again)" into sc-dev 2021-06-03 19:32:50 +00:00
Jeff DeCew
f23b53f86f Merge "Notification layout fixes:" into sc-dev am: 10de71a380
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14805134

Change-Id: Ieef984e702fc3e25514f6ce012b2217ca76c874d
2021-06-03 16:32:03 +00:00
Christopher Tate
29f1852efd Fix FGS enter/exit statslog semantics
Logging wasn't quite right in the case of deferred FGS notification in
various ordering scenarios.

Bug: 189926836
Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.statsd.UidAtomTests#testForegroundServiceState
Change-Id: I650730db9e01faa90a36a73b486464ab5b179fc6
2021-06-03 09:28:07 -07:00
Jeff DeCew
10de71a380 Merge "Notification layout fixes:" into sc-dev 2021-06-03 16:16:25 +00:00
Jeff DeCew
ea4b3a56b4 Fix background color (again)
* originally fixed in ag/14189045
* regressed in ag/14140988

Bug: 185920837
Test: post conversation notifications, and look at badge or face pile background; should match notification background
Change-Id: I8ef77901ed9d43eccf89dcc1f3905f0dbb38851f
2021-06-03 11:18:35 -04:00
Jeff DeCew
604c074dbe Notification layout fixes:
* "Headerless" notifications no longer capped at 88dp.  This allows DecoratedCustomViewStyle content to be sized larger than 48dp, but all that sizing is now controlled by the max heights for the entire notification, which is enforced by the ExpandableNotificationRow, rather than the layout.
* Reduce the max heads up height to 136dp (down by 7dp).  For standard headerless templates, this won't have any effect, because they would never get that tall.  For HUNs with decorated custom content this reduces the custom content area to 96dp without actions (to match RVC) and 56dp with actions (up slightly from 48dp in RVC).
* Fixed a bug where the snooze button would be bound when viewType=NORMAL, which only affected messaging style, and was hiding a layout bug if the snooze setting was enabled.
* Fixed a bug with the action margin on messaging notifications appearing in the collapsed state and causing oversized notifications.

Fixes: 189937886
Test: significant manual testing with notify and notify2, especially with HUNs
Change-Id: I775a0bb29944922581d01f237dbbc5580ced00c4
2021-06-02 20:23:59 -04:00
Svetoslav Ganov
94893b35e0 Merge "Switch media fw permissions checks to AttributionSource" into sc-dev am: 1028eb2f62
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14664152

Change-Id: I1403b08f25c663715fd0a99a40f484a4e7ecf410
2021-06-02 23:19:16 +00:00
Svetoslav Ganov
1028eb2f62 Merge "Switch media fw permissions checks to AttributionSource" into sc-dev 2021-06-02 23:07:22 +00:00
Jon Spivack
8dbc1f9bd6 Merge "Allow AssistDataRequester to fetch AssistContent without AssistStructure" into sc-dev am: dd934371ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14738871

Change-Id: Ia98ecaf808feff0bec2a502e6348d19f60982746
2021-06-02 17:36:45 +00:00
Jon Spivack
dd934371ae Merge "Allow AssistDataRequester to fetch AssistContent without AssistStructure" into sc-dev 2021-06-02 17:08:47 +00:00
Mady Mellor
7f0dc6f537 Merge "Remove doc saying setSuppressNotification requires being in foreground" into sc-dev am: 81cac3a9f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14791581

Change-Id: I6a498b1f289aff6fbfe80ecd1aadd30a73a1fb97
2021-06-02 16:52:42 +00:00
Mady Mellor
81cac3a9f1 Merge "Remove doc saying setSuppressNotification requires being in foreground" into sc-dev 2021-06-02 16:18:19 +00:00
Jay Sullivan
46b1e92c4f Merge "Fix intermittent async noteOps" into sc-dev am: c2650e0440
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14602086

Change-Id: I111b7ed09ad9a91ac1bb0399f2fc041751612918
2021-06-02 01:10:11 +00:00
Jay Sullivan
c2650e0440 Merge "Fix intermittent async noteOps" into sc-dev 2021-06-02 00:42:31 +00:00
Svet Ganov
2eebf92965 Switch media fw permissions checks to AttributionSource
Attribution source is the abstraction to capture the data
flows for private data across apps. Checking permissions
for an attribution source does this for all apps in the
chain that would receive the data as well as the relevant
app ops are checked/noted/started as needed.

Teach speech recognition service about attribution
chains. If an implementation does nothing the OS
would enforce permisisons and do blame as always.
This apporach leads to double blaming and doesn't
support attribition chains where app calls into
the default recognizer which calls into the on
device recognizer (this nests recursively). If the
implementer takes advantage of the attribution chain
mechanims the permissions for the entire chain are
checked at mic access time and all apps are blamed
only once.

Fixed a few bugs around finishing ops for attribution
chains. Also ensured that any app death in a started
attribution chain would lead to finishing the op for
this app

bug: 158792096

Test: (added tests for speech reco)
      atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases
      atest CtsAppOpsTestCases
      atest CtsAppOps2TestCases

Merged-In: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4

Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
2021-06-01 23:43:29 +00:00
Mady Mellor
c0a3fa5ffe Merge "Re-add checks for mutable intents on bubbles" into sc-dev am: f8218030bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14792011

Change-Id: Ibc1f94b5c03fe067befbdcce60832ab7d20ccdf3
2021-06-01 23:27:32 +00:00