Commit Graph

15932 Commits

Author SHA1 Message Date
TreeHugger Robot
98dfc2a69c Merge "Implement passing the model data to the trusted process" into sc-dev 2021-03-12 02:32:22 +00:00
Treehugger Robot
6bb68aa10b Merge "Added mount to OWNERS for RecyclerView and ViewPager" am: 2273adedcd am: 62aa26cacb am: 4f3026147a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629662

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8a4a77fb4188fd44bbad910d0889521b56b64f5d
2021-03-12 00:51:32 +00:00
Treehugger Robot
4f3026147a Merge "Added mount to OWNERS for RecyclerView and ViewPager" am: 2273adedcd am: 62aa26cacb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629662

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id7b9ca5d814aa27e295c46b755af35743de5d434
2021-03-12 00:25:20 +00:00
TreeHugger Robot
cdebbc764a Merge "Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2 am: 4df29fd76a" into sc-dev 2021-03-12 00:17:58 +00:00
Lucas Dupin
0166d05722 Merge changes I561ba44b,Icaebd98e,Ic0bd4afc,Ia0f98434 into sc-dev
* changes:
  Move Wu check for max colors earlier.
  Ignore transparent pixels during WSMeans
  Fix create colors in Wu quantizer
  Fix initializing clusters with random randoms
2021-03-11 23:15:44 +00:00
TreeHugger Robot
42746017d3 Merge "Add "cmd window trace save-for-bugreport"" into sc-dev 2021-03-11 22:18:16 +00:00
George Mount
029208ebdd Added mount to OWNERS for RecyclerView and ViewPager
As requested, mount was added to OWNERS for RecyclerView
and ViewPager as changes are occasionally needed by UI
toolkit team.

Test: None
Change-Id: Ie3d49d0d5ddf092d2dd0680c6a067b2fe6b81f94
2021-03-11 21:27:55 +00:00
TreeHugger Robot
a6907d35ea Merge "End the trace section in FrameTracker#cancel if it has begun" into sc-dev 2021-03-11 19:48:59 +00:00
James O'Leary
7ef64c0787 Move Wu check for max colors earlier.
This has no impact. However, after going through the quantizers line by
line for other bug fixes, after getting a break from looking at them
in-depth for a couple weeks, it was much more readable/felt safer to
adjust mMaxColors at the top.

Bug: 182333325
Test: Verify output remains constant,
atest CtsAppTestCases:android.app.cts.WallpaperColorsTest#fromDrawableTest
passes.

Change-Id: I561ba44bca392634a956992fd946f3310aa1c8ee
2021-03-11 13:43:22 -05:00
James O'Leary
9b9276849b Ignore transparent pixels during WSMeans
The WSMeans quantizer uses starting clusters from a Wu quantizer as
starting points for an optimized Kmeans algorithm.

The first thing the quantizer does is assign pixels from the image being
quantized to those starting clusters. Either due to the image source or
downscaling, transparent pixels may be in the pixels. Filter those out:
they create misleading results, such as there being two colors in the
image, semi-transparent black and green, in a wallpaper that is solid
green by all accounts.

Fixes: 182333325
Test: atest CtsAppTestCases:android.app.cts.WallpaperColorsTest#fromDrawableTest
passes locally on sunfish. link: http://ab/I26300007868608112

Change-Id: Icaebd98eeba27d3dc59a698282dd3be03fce1bf9
2021-03-11 13:43:20 -05:00
James O'Leary
fbbb5dd5ca Fix create colors in Wu quantizer
This line is suspiciously complicated compared to other 3 ints -> int
representing color functions. This patch ensures the colors produced
have an explicitly opaque alpha channel (transparent pixels are filtered
out earlier in the quantization process), and ensures we're not
unnecessarily masking the red/green/blue channels.

Test: Add log dump to output hex for all colors created, immediately
after the Wu quantization finishes, thus isolating it from the larger
quantization process. Test a variety of wallpapers, make sure hex codes
make sense, verify that the fix holds by converting
Bug: 182333325

Change-Id: Ic0bd4afcd095845e00eb6d10d05aab336266d6c3
2021-03-11 12:30:23 -05:00
James O'Leary
2a75b45bff Fix initializing clusters with random randoms
During the quantization process, an instance of a Quantizer is created.
When quantization is run, the Quantizer may need to create starting
points that are random. To keep results stable, meaning multiple runs of
a quantizer output the same results, those starting points must
be created using a Random with the same starting seed. Without
specifying a starting seed, or if an instance of Random is reused across
runs, the random starting points will vary across quantizer runs.

With this patch, the Random used to create starting points is no longer
used across multiple runs (i.e. it isn't a static variable anymore).
Additionally, a starting seed is specified.

Test: Add log dumps after the quantization process. Verify that results
from Kmeans remain consistent as long as the input is consistent.
Bug: 182333325

Change-Id: Ia0f984349b7885ae1b44536aaa1b286a28e50587
2021-03-11 12:30:12 -05:00
Marcin Oczeretko
de541b0e4a Merge "Rename LatencyTracker config flags to follow the convention" into sc-dev 2021-03-11 12:59:46 +00:00
Rafal Slawik
3798c06eaa Merge "Track surfaceflinger CPU usage" into sc-dev 2021-03-11 11:25:32 +00:00
Ahan Wu
517a46d989 End the trace section in FrameTracker#cancel if it has begun
We didn't end the trace section in FrameTracker#cancel if the end
vsync id equals to the begin vsync id which is not an invalid value.
This cl fixes above problem.

Bug: 181683700
Test: atest FrameworksCoreTests:InteractionJankMonitorTest
FrameworksCoreTests: FrameTrackerTest --iteration 10
Change-Id: I6280e9b1e9b949cb6f144217ed78d21ec46eafd5
2021-03-11 18:59:31 +08:00
Oli Lan
4ecda9575d Merge "Set source package when copying from share sheet." into sc-dev 2021-03-11 10:06:42 +00:00
Yohei Yukawa
96a51f9971 Add "cmd window trace save-for-bugreport"
This CL reworks our previous CL [1], which enabled "adb bugreport" to
include wintrace tracing files into bugreport.

In the previous CL there was a side-effect that wintrace tracing files
are saved not only when "adb bugreport" is executed but also when the
following command is manually executed.

  adb shell dumpsys window --dump-priority CRITICAL --proto

This is because we used the combination of
  --dump-priority CRITICAL
and
  --proto
as a signal that it's coming from "adb bugreport", but strictly
speaking it's not necessarily true.

Instead of relying on such a heuristic, this CL introduces a claer and
dedicated command as follows.

  adb shell cmd window tracing save-for-bugreport

With this, we can let "adb bugreport" trigger the above command to
make the behavior more understandable and maintainable.  Note that
this command is no-op when winscope is not running.

See the corresponding CL for frameworks/native [2] about how it's
triggered from "adb bugreport".

Our main motivation of this consolidation is to use the same pattern
for IME tracing, where we accidentally introduced Bug 177462676 while
attempting to save IME tracing data while running "adb bugreport" [3].

 [1]: I102bc4afab5efff361633d75c09af1df4a11812e
      9e2604688d
 [2]: I8be9dee9aa36c2b085596d58e418f8613d874500
      95305b3ba7bf18bc7ed3a07c67f84b1c2f4586f4
 [3]: Ie87eb8423e2bb70f28c330983d45b95e2e07062d
      ac24994aaa

Bug: 177462676
Test: Manually done as follows.
  1. adb shell cmd window tracing start
  2. adb logcat -d -s WindowTracing:*
       Make sure wintrace is not yet running
  3. adb shell dumpsys window \
         --dump-priority CRITICAL --proto > /dev/null
  4. adb logcat -d -s WindowTracing:*
       Make sure wintrace has not been stopped.
  5. adb shell cmd window tracing save-for-bugreport
  6. adb logcat -d -s WindowTracing:*
       Make sure wintrace was stopped then restarted.
  7. adb root && adb shell ls /data/misc/wmtrace/ -al
       Make sure wintrace files are saved.
Test: Manually done as follows.
  1. adb logcat -d -s WindowTracing:*
       Make sure wintrace is not yet running
  2. adb logcat -d -s WindowTracing:*
       Make sure there is no additional message
  3. adb shell cmd window tracing start
  4. adb logcat -d -s WindowTracing:*
       Make sure wintrace is running
  5. adb bugreport bugreport.zip
  6. adb logcat -d -s WindowTracing:*
       Make sure wintrace stopped then restarted.
  7. unzip -v bugreport.zip | grep wm_trace.pb
       Make sure "wm_trace.pb" is included.
  8. unzip -v bugreport.zip | grep wm_log.pb
       Make sure "wm_log.pb" is included.
Change-Id: I887ae6941b4844a606675b447f67ecee88d7f192
2021-03-10 15:54:41 -08:00
Victor Hsieh
f4305279e5 Merge "Move VerityUtils from services.jar to core.jar" into sc-dev 2021-03-10 23:10:25 +00:00
Jeff DeCew
364576c7e0 Merge "Flow text around the large icon." into sc-dev 2021-03-10 22:19:22 +00:00
Taran Singh
dd7874a401 Merge "Avoid IME restart for configChanges" into sc-dev 2021-03-10 19:15:23 +00:00
Beth Thibodeau
5b1beb3963 Merge "Remove screenrecord flag code from global actions" into sc-dev 2021-03-10 17:10:00 +00:00
Jeff DeCew
cdf6b6b4c9 Flow text around the large icon.
This is only necessary when a notification is posted without a title.

Fixes: 177976174
Test: Manual inspection of various staes.
Change-Id: I15fdc31e1557b7e5d6fb99e410f4bf37d6734ac4
2021-03-10 10:34:58 -05:00
TreeHugger Robot
8b7a902791 Merge "Remove phone number from the "new" CallStateListener." into sc-dev 2021-03-10 13:40:13 +00:00
Rafal Slawik
b34a60113d Track surfaceflinger CPU usage
Use the same approach that is used to track system server thread group
CPU usage: KernelSingleProcessCpuThreadReader which uses the eBPF
time_in_state program to record CPU usage for selected pids and tids.

Test: cmd stats pull-source 10098
Test: atest CpuStatsTests
Bug: 181232205
Change-Id: I84d46409547f92e410fd3b4f8b8ccb823bcee98b
2021-03-10 13:18:01 +00:00
Taran Singh
9a2eed9f49 Avoid IME restart for configChanges
Handle onConfigurationChanged() in order to prevent restarting
InputMethodService everytime. We introduce a new API attribute
"configChanges" in InputMethod(attrs.xml) which when declared
by IME, will be responsible for handling mentioned
configuration changes.

This CL re-introduces [1] with fix: Use new Configuration instance for
IMS#mLastKnownConfig

[1] Iff88b768c6b06cf5cf1fe9e97ee97f8f78e6f0bd

Bug: 167948419
Test: atest InputMethodServiceTest
    Manually:
      1. Patch Ie91e7a8e06b80864ef9409031e8543858552d70d to use dual
         display area.
      2. Open applications with editors on both display areas.
      3. Attach a debug point for IMS#onConfigurationChanged().
      4. Make sure IMS#resetStateForNewConfiguration() is not called
         when IME moves between these two identical DisplayAreas

Change-Id: Ib94fddadb0dae648cf73a4c1642e51edebd19f50
2021-03-10 08:22:42 +00:00
Wu Ahan
a2397bacb2 Merge "Always remove the observers in cancel to avoid object leakage" into sc-dev 2021-03-10 05:50:03 +00:00
Jing Ji
2b2e73d1d6 Merge "Clone the CallStat objects/lists before dispatching it to the listener" into sc-dev 2021-03-10 02:16:46 +00:00
Jeff Sharkey
e394c59a75 Merge "Wait for installd to start to perform dexopt operation" am: 3f0f0b686a am: ee20cc3ca1 am: d2cd30f2cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615847

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I01a6b4f516ee1e74707babc10e5846d5cbfb61fe
2021-03-10 00:53:43 +00:00
Jeff Sharkey
d2cd30f2cc Merge "Wait for installd to start to perform dexopt operation" am: 3f0f0b686a am: ee20cc3ca1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615847

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b80a78b7e017e7c8bce69d856b321de6dc9357d
2021-03-10 00:05:37 +00:00
Jeff Sharkey
3f0f0b686a Merge "Wait for installd to start to perform dexopt operation" 2021-03-09 23:01:37 +00:00
Dmitri Plotnikov
f0a755448b Merge "Prevent crash when power profile has incorrect freq counts" into sc-dev 2021-03-09 18:44:29 +00:00
Ahan Wu
032d7a0b53 Always remove the observers in cancel to avoid object leakage
We didn't remove the observers if the cancel invocation came from end(),
this caused leakage of FrameTracker, so we always remove the observers
no matter where the cancel invocation comes from.

Bug: 181683700
Test: atest FrameworksCoreTests:InteractionJankMonitorTest
FrameworksCoreTests: FrameTrackerTest
Change-Id: Ia03ebc3b579257dd387eaa1be65b9d22e7b7bf91
2021-03-09 18:15:43 +00:00
Oli Lan
c312e2fbea Set source package when copying from share sheet.
This uses a new system API to attribute the source package when copying
to clipboard from the share sheet.

This is needed because in S users will see a toast message saying
"<app> pasted from <source>" when an app accesses clipboard. Without
this change, any copy originating from the share sheet results in
"<app> pasted from Android System" rather than the app that is the
actual source of the data.

Bug: 180577866
Test: Manual, share via share sheet and paste in another app;
observe "<app> pasted from <source app>"

Change-Id: Id1c0afcf6e775868febc7c8ab5b44dbacccacfa2
2021-03-09 13:45:31 +00:00
lpeter
9a75f1c529 Implement passing the model data to the trusted process
In this patch, we change the behavior to trigger the hotword
detection service when the interactor application calls the
new "createAlwaysOnHotwordDetector" function. The system will
also pass the read-only data(Ex : model data) back to hotword
detection service by using the share memory when the service
is initialized.

So the interactor application can use the new function with
share memory to pass the model data back to hotword detection
service.

Bug: 176938619
Test: atest CtsVoiceInteractionTestCases
Change-Id: I753988691725c9d962be25c92d60ec66a3812394
2021-03-09 20:20:27 +08:00
Treehugger Robot
d4e1a70921 Merge "Add final qualifier in LocationPermissionChecker" am: b002b20492 am: 50843debeb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1618842

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I60de5561418ac24a1210dec2d4ecaf16d1779518
2021-03-09 08:26:17 +00:00
Treehugger Robot
b002b20492 Merge "Add final qualifier in LocationPermissionChecker" 2021-03-09 07:58:14 +00:00
Dmitri Plotnikov
2d0ff3d3bd Prevent crash when power profile has incorrect freq counts
Bug: 179750543
Test: build and launch Settings
Change-Id: I9ede5caf0001deff0067eabd9520af9d315ac95f
2021-03-08 20:17:48 -08:00
Tyler Gunn
95674c6cd1 Remove phone number from the "new" CallStateListener.
When the legacy PhoneStateListener was migrated to the new
TelephonyCallback class, the onCallStateChanged listener was copied over
as is.  This CL removes the phone number parameter from the new listener.
Under the hood, both the old PhoneStateListener and the new one use the
same IPhoneStateListener.aidl file, so the onCallStateChanged method for
the legacy listener is changed to onLegacyCallStateListener.

Test: See CTS test CL; added a bunch of CTS tests for this.
Fixes: 165831812
Change-Id: Ia67968b5235954b606c6bd2890cc6f46c468e041
2021-03-08 16:02:41 -08:00
Michael Wachenschwanz
b95b1a2eff Merge changes from topic "cpuEnergyAttribution" into sc-dev
* changes:
  Accumulate charge instead of energy in BatteryStatsImpl
  Accumulate and attribute measured Cpu energy in BatteryStats
2021-03-08 23:46:08 +00:00
Mady Mellor
e15c6dd81a Merge changes from topic "mm_setSuppress" into sc-dev
* changes:
  SysUI changes for setSuppressBubble
  Track locusId visibility in ShellTaskOrganizer
  Add locus id to ActivityRecord / TaskInfo
  Bubble API: suppress bubble
2021-03-08 21:27:36 +00:00
Jing Ji
9caf734d3a Clone the CallStat objects/lists before dispatching it to the listener
As these objects/lists could be mutated after being dispatched.

Bug: 181193693
Test: atest BatteryStatsBinderCallStatsTest BinderCallsStatsTest
Change-Id: I9de44e734acc7313d03ee616aa5e2f0a01da7cf3
2021-03-08 12:35:20 -08:00
Michael Wachenschwanz
68b8157e4e Accumulate charge instead of energy in BatteryStatsImpl
Track battery voltage along side the measured energy to calculate
battery charge consumption per EnergyConsumer. This better represents
a consumer's impact on battery. Also change numerous variable/method
names from energy units to charge units.

Bug: 180079165
Fixes: 173765509
Test: atest FrameworksCoreTests:com.android.internal.power.MeasuredEnergyStatsTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsNoteTest
Test: atest ScreenPowerCalculatorTest
Test: atest FrameworksServicesTests:com.android.server.am.MeasuredEnergySnapshotTest

Change-Id: I5e727cebf1252cc7b1645a53282de2281c68ae85
2021-03-08 11:53:59 -08:00
Siarhei Vishniakou
6387cdfb91 Merge "Pass actual present time to ViewRootImpl" into sc-dev 2021-03-08 19:44:12 +00:00
Dmitri Plotnikov
32a183264b Merge "Add batteryTimeRemaining and chargeTimeRemaining to BatteryUsageStats" into sc-dev 2021-03-06 01:56:32 +00:00
Jeff Sharkey
bb107f0d53 Merge "Add per-file OWNERS for ChargeCalculators" am: e191d88136 am: 7526d5687c am: 77229abe61
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1621724

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3cfbb9ce3f4257cc676d24bcd0cb71b07279e56b
2021-03-05 22:36:55 +00:00
Jeff Sharkey
77229abe61 Merge "Add per-file OWNERS for ChargeCalculators" am: e191d88136 am: 7526d5687c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1621724

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib8b1efe14f542d922614121c4f9b1ffd4f2a61a6
2021-03-05 22:11:10 +00:00
Dmitri Plotnikov
cf2929ffe9 Add batteryTimeRemaining and chargeTimeRemaining to BatteryUsageStats
Bug: 158137862
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryChargeCalculatorTest
Change-Id: I247a593de242a2864eef16b7c9ea956209f60cbe
2021-03-05 13:57:47 -08:00
Siarhei Vishniakou
f0cf18d3ed Pass actual present time to ViewRootImpl
To measure end-to-end touch latency, we need to report the actual
present time to ViewRootImpl. ViewRootImpl, in turn, will report this
information to InputDispatcher. Finally, InputDispatcher will combine
all known information for a specific input event, and will report this
data to westworld.

In another patch, we will add a new call, 'reportLatencyInfo', to
InputPublisher. This call will allow the app to send this latency data
to InputDispatcher.

Bug: 169866723
Test: printed the input event present times inside ViewRootImpl
Change-Id: Ibd3a2cfeb1a340eb15cd2165071df1f8589634af
2021-03-05 21:42:32 +00:00
Jeff Sharkey
c5d9327df2 Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2 am: 4df29fd76a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iab3982e777395a9579505ad90b143c3b6c04b6f3
2021-03-05 20:16:00 +00:00
Dmitri Plotnikov
266ce1a1f0 Add per-file OWNERS for ChargeCalculators
Test: N/A
Change-Id: I0fd382a25afafcfb9476d35897ec8295f0293053
2021-03-05 10:04:07 -08:00