Commit Graph

21337 Commits

Author SHA1 Message Date
Calin Juravle
aca6042027 Merge "Register the DexLoadReporter before creating the main class loader" am: 6fe0c8ea30 am: 0bd0d7e053 am: b6e7f8aa77 am: ae2ff8415d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1735263

Change-Id: I93208cdf18f44a5f7b3d36a388da23ef3469661a
2021-06-14 19:20:32 +00:00
Calin Juravle
ae2ff8415d Merge "Register the DexLoadReporter before creating the main class loader" am: 6fe0c8ea30 am: 0bd0d7e053 am: b6e7f8aa77
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1735263

Change-Id: Id1a3679d8c9158360e91e31a6bb81b6c05e79b1e
2021-06-14 18:25:16 +00:00
Calin Juravle
b6e7f8aa77 Merge "Register the DexLoadReporter before creating the main class loader" am: 6fe0c8ea30 am: 0bd0d7e053
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1735263

Change-Id: I4d42d5b4721354a8f98ba0e24f69a72be0066290
2021-06-14 18:06:55 +00:00
Les Lee
8517b85f11 Merge "Fix: query TYPE_WIFI usage with empty string" am: d9905a0e64 am: e0c2f2d5d7 am: 5ac7901f25 am: 2c550f7da4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1727620

Change-Id: Iddad476ef8258ffc7c4ab24510f9b1851aeb46e8
2021-06-14 17:27:49 +00:00
Les Lee
2c550f7da4 Merge "Fix: query TYPE_WIFI usage with empty string" am: d9905a0e64 am: e0c2f2d5d7 am: 5ac7901f25
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1727620

Change-Id: I68c6412ee562c620612932cd03466a894953c8e8
2021-06-14 17:20:27 +00:00
Les Lee
5ac7901f25 Merge "Fix: query TYPE_WIFI usage with empty string" am: d9905a0e64 am: e0c2f2d5d7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1727620

Change-Id: Ia869e47edec33397ccac5ec97fddf633fc9b8ab7
2021-06-14 16:59:57 +00:00
Calin Juravle
6fe0c8ea30 Merge "Register the DexLoadReporter before creating the main class loader" 2021-06-14 16:51:03 +00:00
Calin Juravle
875888eff3 Register the DexLoadReporter before creating the main class loader
We used to register the DexLoadReporter after the main class loader
was created. That was done to avoid superfluous reports of the app's
primary apks (since we already know about them).

However that also means that if the app would start as an isolated
process we would miss this signal in the DexManager.

Make sure we get signals for isolated processes by registering the
reporter before we create the main class loader.

Test: manual, using chrome and maps go
adb shell cmd package compile -m speed-profile com.android.chrome
adb shell am start -n \
com.google.android.apps.mapslite/com.google.maps.lite.twa.MapsLiteTwaLauncherActivity
adb shell dumpsys package dexopt
(confirm that chrome is used by an isolated process)
adb shell cmd package compile -m speed-profile com.android.chrome
(confirm that chrome is speed compiled - or verify, based on the device
setting)

Bug: 163018062
Change-Id: I5d683ae85b3973cc2011dd33b4cb14837b18005f
2021-06-14 14:31:57 +00:00
Kholoud Mohamed
fd2f02e94d Merge "Fix security vulnerability in DPMS" into sc-dev am: 58d0a17836 am: 4dd90319ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14919135

Change-Id: I1523f5a849b8bbaa38ba7b6e3ec11c2a25c616a1
2021-06-14 09:45:27 +00:00
Kholoud Mohamed
6a21602ec7 Merge "Fix security vulnerability in DPMS" into sc-dev am: 58d0a17836 am: 3f00212c91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14919135

Change-Id: I3c0473ac546b74818dd0b1a27f5b6b3b8f76ee92
2021-06-14 09:45:06 +00:00
Kholoud Mohamed
4dd90319ad Merge "Fix security vulnerability in DPMS" into sc-dev am: 58d0a17836
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14919135

Change-Id: I177845b6dbdde307752cd0af5b84bfc1b5a5e768
2021-06-14 09:29:46 +00:00
Kholoud Mohamed
013e3748c3 Merge "Fix security vulnerability in DPMS" into sc-dev am: 58d0a17836
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14919135

Change-Id: Ia405b5ed58d9eca1d4b8431f5adc52d565e6a1c3
2021-06-14 09:29:00 +00:00
Kholoud Mohamed
58d0a17836 Merge "Fix security vulnerability in DPMS" into sc-dev 2021-06-14 09:11:57 +00:00
Erik Wolsheimer
6ad299b76f Merge "Store whether attribution tag is valid separate from bypass" into sc-dev am: 6d3212e617 am: 225ca7c7e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14955197

Change-Id: I7e5544d92f0e3218f8e3bfec2c6758dae0f5a815
2021-06-13 03:45:52 +00:00
Erik Wolsheimer
1bce43f04e Merge "Store whether attribution tag is valid separate from bypass" into sc-dev am: 6d3212e617 am: 188e1736d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14955197

Change-Id: Id30836eeadb6dab07f5e22e2e34da34ec80f4309
2021-06-13 03:39:38 +00:00
Erik Wolsheimer
b6467b2670 Merge "Store whether attribution tag is valid separate from bypass" into sc-dev am: 6d3212e617
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14955197

Change-Id: I76343eccc841fe097596ab14d02a39b487658704
2021-06-13 03:29:09 +00:00
Erik Wolsheimer
188e1736d3 Merge "Store whether attribution tag is valid separate from bypass" into sc-dev am: 6d3212e617
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14955197

Change-Id: I4e57121d58d758838849043cb91a818cd2444bf9
2021-06-13 03:28:17 +00:00
Erik Wolsheimer
947cb752b8 Store whether attribution tag is valid separate from bypass
Bug: 189484870
Bug: 190073375
Test: Manual
Change-Id: Iccc0e887d28c837a8ef4099af611794590af25c5
2021-06-12 16:36:57 -07:00
Les Lee
6a358bf024 Fix: query TYPE_WIFI usage with empty string
Starting with API level 31, the subscriberId is applicable
for the wifi network. Considering applications may use
null or an empty string as subscriberId (for instance, cts),
frameworks create MATCH_WIFI_WILDCARD NetworkTemplate when querying
wifi network with null or an empty string which is the behavior before
API level 31.

Bug: 188915450
Test: atest -c NetworkStatsManagerTest

Change-Id: I084b69903f8ba7a6225b312560752e8508938714
2021-06-11 18:14:50 +08:00
Ryan Mitchell
564eb292d5 Merge "Fix RRO handleConfigurationChanged race condition" into sc-dev am: 55128109d9 am: 7feeebf128
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14923667

Change-Id: I89ffc921ddd85a2f033757b0b2bae019f2343ce1
2021-06-10 20:05:15 +00:00
Ryan Mitchell
f56db3a0c5 Merge "Fix RRO handleConfigurationChanged race condition" into sc-dev am: 55128109d9 am: 03a41e3520
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14923667

Change-Id: I6a6f17c94ad4799b12eda73259e182d45e67cabd
2021-06-10 20:04:52 +00:00
Ryan Mitchell
7feeebf128 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: Ic3d6aee13bdf09cbff6bb74bab70071268fdbe50
2021-06-10 19:52:55 +00:00
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
Pavel Grafov
b620951b84 Merge "Don't reset user VPN without reason" into sc-dev am: c0115519f6 am: f74b5d16c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14717702

Change-Id: I1b8e37af88cd7ec00b7e084e85eaea019e0fd11e
2021-06-10 16:02:44 +00:00
Pavel Grafov
1b660860f6 Merge "Don't reset user VPN without reason" into sc-dev am: c0115519f6 am: b45b862d36
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14717702

Change-Id: Idc5548383f2d9819f999c1452ac05da6c0afa13d
2021-06-10 16:01:22 +00:00
Pavel Grafov
b45b862d36 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: Ic2ebf54458f7f5cf5e500093e150756231073a11
2021-06-10 15:45:18 +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
kholoud mohamed
342fd83483 Fix security vulnerability in DPMS
Changed DPMS#isPackageAllowedToAccessCalendarForUser to always require
INTERACT_ACROSS_USERS/_FULL permission if called for a different uid
than the calling uid.

Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Bug: 187043716
Change-Id: I230bbffbdf97c251c8a40add097b3b4254d39452
2021-06-10 13:49:25 +00:00
James O'Leary
5b0e67fbb8 Merge changes from topics "quantizer_improved_logic", "reintroduce_scaling_fixes" into sc-dev am: e0970984c8 am: 4084659caf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14802974

Change-Id: I763d6a33675981abad0654f0443e1dffbd84e598
2021-06-09 23:03:57 +00:00
James O'Leary
af6abee8ce Merge changes from topics "quantizer_improved_logic", "reintroduce_scaling_fixes" into sc-dev am: e0970984c8 am: d30dca1080
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14802974

Change-Id: Iee86fe9d7b0ec23d32f7eb62cb529c5f541260a3
2021-06-09 23:03:39 +00:00
James O'Leary
4084659caf 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: I99e2facf17062876ac1501384ddb9dbbd26a3ef8
2021-06-09 22:30:49 +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
a232e7b4dd Merge "Update logic about parent and convo channels" into sc-dev am: b87598c3cc am: 78cea6e7e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14907947

Change-Id: Id922623d7035e52c96530d47c6905531edab37ea
2021-06-09 18:49:26 +00:00
Julia Reynolds
42d4e33dde Merge "Update logic about parent and convo channels" into sc-dev am: b87598c3cc am: 5cc7e146e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14907947

Change-Id: I05bb2a1a93cd55d25b4eb75a528b7ea061ce1fae
2021-06-09 18:45:26 +00:00
Julia Reynolds
8c497473a0 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: Idb384f25f51a07c352b3c77df43edd20c20868bb
2021-06-09 18:04:04 +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
95135c3af0 Merge "Allow any apps to call DPM.isUsbDataSignalingEnabled()" into sc-dev am: b9be267361 am: f5e14b993e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807577

Change-Id: Ie788633511a973e9baa11dcda92e8c0c38e10625
2021-06-09 16:16:24 +00:00
Rubin Xu
3221b1b8d2 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: I68969e2b7b7131dd35474d2f4a9dae4164d8461a
2021-06-09 16:15:20 +00:00
Rubin Xu
c332a07ec3 Merge "Allow any apps to call DPM.isUsbDataSignalingEnabled()" into sc-dev am: b9be267361 am: 6cfe624e1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807577

Change-Id: I31ec9ba61675925ded6cd9b2bc051ca321f918ec
2021-06-09 16:15:07 +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