Commit Graph

8858 Commits

Author SHA1 Message Date
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
71f5b12c59 Convert BatteryUsageStats to and from XML am: d82aa7e5c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14924566

Change-Id: I3b26ea5eda912cbd933335074a417544d3ddb250
2021-06-17 17:31:10 +00:00
Dmitri Plotnikov
7cd1108de1 Add BatteryUsageStats.add(BatteryUsageStats) am: 36e0ae27a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14433337

Change-Id: I3db68694883fbf0da74c14a23bda1519ac233c39
2021-06-17 17:31:04 +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
Dmitri Plotnikov
d82aa7e5c4 Convert BatteryUsageStats to and from XML
Bug: 187223764
Test: atest FrameworksCoreTests:BatteryUsageStatsTest#testXml
Change-Id: I6aec09bfb87c1003ede1b24cce8cf474675d2448
Merged-In: I6aec09bfb87c1003ede1b24cce8cf474675d2448
(cherry picked from commit 4b8a26bcaa)
2021-06-16 22:21:05 -07:00
Dmitri Plotnikov
36e0ae27a9 Add BatteryUsageStats.add(BatteryUsageStats)
Bug: 187223764
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsTest
Change-Id: I1e5060d726fd0f4634fd658483e80a9ab02e24fb
Merged-In: I1e5060d726fd0f4634fd658483e80a9ab02e24fb
(cherry picked from commit 63d9aecdbb)
2021-06-16 22:18:09 -07:00
Soonil Nagarkar
dcbca39607 Merge "Fix bugs in LocationManagerService and AppOpsPolicy" into sc-dev am: a244ceeb2e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14924835

Change-Id: I06e1291e905d873f19da6d06522df93c9b868835
2021-06-16 15:46:36 +00:00
Soonil Nagarkar
a244ceeb2e Merge "Fix bugs in LocationManagerService and AppOpsPolicy" into sc-dev 2021-06-16 15:37:32 +00:00
TreeHugger Robot
c26031980a Merge "Make some NoCopySpans can pass to ContentCaptureService" into sc-dev am: 7063bae045
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14891918

Change-Id: I623613b6ba1dc52417db2e869199fc272d8e4f36
2021-06-15 18:53:11 +00:00
TYM Tsai
b8fe7ce3bb Make some NoCopySpans can pass to ContentCaptureService
The selection and composing spans are not parcelable. This patch makes
Content Capture can pass those metadata to the service.

Bug: 184311217
Test: atest CtsContentCaptureServiceTestCases
Test: atest FrameworksCoreTests:ContentCaptureEventTest
Change-Id: I455ee61998bfb19476f84c69b1a671113b6b6a98
2021-06-16 01:22:39 +08:00
Soonil Nagarkar
4aa42bdb17 Fix bugs in LocationManagerService and AppOpsPolicy
LocationManagerService was overwriting location source appops tag
information whenever a location provider changed state. Since multiple
location providers can correspond to the same uid/app id, this could
lead to loss of tags. This is fixed by recalculating the set of tag for
an entire app id any time a uid changes.

AppOpsPolicy had a bug where tag lists coming from different uids under
the same appid would inappropriately overwrite each other. This is fixed
by modifying the internal/external APIs to work in terms of appid rather
than uid, so that it is someone else's responsibility to ensure the
result is valid for the app id as a whole.

Also fixes a bug where LMS assumes tag listeners are added prior to any
providers. If listeners are added after some providers they will miss
updates. Fixed by always updating the listener on registration.

Bug: 190073375
Test: manual
Change-Id: Ib52d752d857b6ac3b6683186a8d1bbcb814fb798
2021-06-15 08:45:44 -07:00
Dmitri Plotnikov
78ba53c3fa Merge "Limit the number of UidBatteryConsumers included in the BatteryUsageStats atom" into sc-dev am: ab31594c96
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14948315

Change-Id: I4229490565b01e6f764683bb7d87d0d75e63c5f3
2021-06-15 00:13:20 +00:00
Dmitri Plotnikov
969e4064ac Limit the number of UidBatteryConsumers included in the BatteryUsageStats atom
Bug: 189225426
Test: atest BatteryUsageStatsProtoTests:BatteryUsageStatsPulledTest
Change-Id: Ic9866962330f0b51727e5202560d97ffac0b8980
Merged-In: Ic9866962330f0b51727e5202560d97ffac0b8980
2021-06-14 11:53:48 -07:00
Winson Chiu
cbf923cab3 Merge "Fix OverlayConfigTest minSdkVersion" into sc-dev am: feb4aed5a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14813127

Change-Id: I597de16a024eae01877acc748a0cbbefac5e70dd
2021-06-07 23:48:03 +00:00
Winson Chiu
feb4aed5a8 Merge "Fix OverlayConfigTest minSdkVersion" into sc-dev 2021-06-07 23:36:52 +00:00
Winson Chiu
74a11e5677 Merge "Add missing Resources OWNERS to FrameworksCoreTests" into sc-dev am: 44eb75f6ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14826388

Change-Id: Iadd23142e6d04ea28cdfe74a317c69e5f5db6e65
2021-06-07 18:53:10 +00:00
Winson Chiu
44eb75f6ed Merge "Add missing Resources OWNERS to FrameworksCoreTests" into sc-dev 2021-06-07 18:40:52 +00:00
Sally Yuen
17a7a977ab Merge "Add AccessibilityManager#removeClient" into sc-dev am: 00d32f2d61
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14804058

Change-Id: Ib7984f8671e479ff85287110b982f0eb95d9b9ba
2021-06-04 22:45:53 +00:00
Sally Yuen
00d32f2d61 Merge "Add AccessibilityManager#removeClient" into sc-dev 2021-06-04 22:33:10 +00:00
Sally
4a41eca71b Add AccessibilityManager#removeClient
Whenever an app makes a Text toast, this gets routed through systemUI
starting from R. Two A11yManagerClients are registered with
A11yManagerService for every toast. Since clients aren't removed until
the process is killed, there are a bunch of clients from systemui
hanging around and potentially cause the system to crash.

We add a way here to explicitly unregister a client

Test: build and flash,
atest android.view.accessibility.AccessibilityManagerTest
Bug: 189010828

Change-Id: I3f71bac475b4539c7be5b328adeb0be35a0b5543
2021-06-04 20:28:26 +00:00
Wu Ahan
a8631c1486 Merge changes from topic "unlock_jank_instrument" into sc-dev am: 924618b41c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14419588

Change-Id: Ie9e92295519be25bcdbaf889d0a16cfd40075a98
2021-06-04 05:38:13 +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
Winson Chiu
6ec6b18960 Fix OverlayConfigTest minSdkVersion
With a fix to ApkLite parsing, targetSdk gets coerced to a minimum
of the minSdkVersion. And by default the build system sets the min to
the dev version, so the target would be brought up to 10000.

The test expects 21, so make the min just below that at 20.

Bug: 189988918

Test: atest com.android.internal.content.OverlayConfigTest

Change-Id: Iec7af27012c207e8cc888b6d16fc71e5e47bc73a
2021-06-03 19:55:16 +00:00
Winson
ada0d396e4 Add missing Resources OWNERS to FrameworksCoreTests
Alos moves the OverlayConfig stuff into a subpackage, so the new OWNERS
file can live there instead of the parent com.android.internal.content.

Bug: 189988918

Test: none, OWNERS

Change-Id: Iba0b1866683f96beea2df4e97ca436700fe46457
2021-06-03 12:50:38 -07:00
Song Hu
0e2a5da970 Merge "Add sharesheet logging for empty direct share row and app share prediction timeout." into sc-dev am: 2ab80e4562
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14788759

Change-Id: Iee0aa9612ec59c7f24e6c46fdc9b74c58c10d79f
2021-06-02 19:27:19 +00:00
Song Hu
2ab80e4562 Merge "Add sharesheet logging for empty direct share row and app share prediction timeout." into sc-dev 2021-06-02 19:03:16 +00:00
Song Hu
8b352b94c0 Add sharesheet logging for empty direct share row and app share
prediction timeout.

Bug: 189833783
Test: atest ChooserActivityTest & manual verification
Change-Id: Id24c6a2495b6a4f778b14028ee5ab975d88e9870
2021-06-02 09:22:44 -07:00
Lais Andrade
95c8656802 Remove non-zero amplitude validation for waveforms am: c0c482736b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14703097

Change-Id: I91effcc0155767c71fc2c5840279f7f06983b27e
2021-06-02 13:18:46 +00:00
Lais Andrade
c0c482736b Remove non-zero amplitude validation for waveforms
The validation does not exist in Android R and is causing apps to start
crashing in S.

The validation for the static API createOneShot was maintained, as it
already existed in previous releases.

Fix: 184890231
Test: VibrationEffectTest
Change-Id: I606c943a35ddd68ccacab76f0047b9a276b5cf28
2021-06-02 12:26:35 +01:00
Ahan Wu
c45abcf9db Support configuration as parameter while beginning the instrumentation
Support a custom configuration while beginning the instrumentation, also
support a custom tag for getting fine-grained CUJ in the trace.

Bug: 187495856
Test: take the trace, see the cuj section name.
Change-Id: Ife2554e0d7dbe4c01b7e4381a12a5f595e2f4364
2021-06-02 01:15:27 -08:00
Matt Casey
ade3061502 Merge "Move ScrollView scroll capture to the center" into sc-dev am: 07056eaa46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14752211

Change-Id: I408633511dd52337984df3024bcc7b688f0ac58b
2021-06-01 14:13:45 +00:00
Matt Casey
9e25d3b8b5 Move ScrollView scroll capture to the center
Avoid most floating content by centering the requested content within
the view instead of just scrolling so that it's visible.

See ag/14213766 for the corresponding RecyclerView change.

Bug: 189487659
Test: atest ScrollViewCaptureHelperTest, plus manual testing.
Change-Id: I194288cf9e568614ffd7c45b7d046a5b982829d6
2021-05-27 17:49:35 -04:00
Dmitri Plotnikov
9f4f53eca5 Merge "Fix system service power calculation when measured energy is available" into sc-dev am: 16d1188b7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14726213

Change-Id: I0b0456218c6b53348f5c2951e9c65e5b76e974c1
2021-05-26 20:59:24 +00:00
Dmitri Plotnikov
16d1188b7d Merge "Fix system service power calculation when measured energy is available" into sc-dev 2021-05-26 20:48:55 +00:00
Adam Bookatz
e6eb812d39 Merge "BatteryUsageStats - use bus end time" into sc-dev am: fdf919fbd5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14720951

Change-Id: I5b959441b3385cce1f9fb24a55e6ddadd671d56c
2021-05-26 17:23:45 +00:00
Adam Bookatz
fdf919fbd5 Merge "BatteryUsageStats - use bus end time" into sc-dev 2021-05-26 17:19:47 +00:00
Tiger Huang
588c95e77e Merge "Flush the animation if it is canceled" into sc-dev am: ea428b55e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14640272

Change-Id: I5463a8450d455f0a36e4c7e885473bfc4a7bbf69
2021-05-26 11:05:35 +00:00
Jeff DeCew
4e19c0f201 Merge "Resolve Notification.Colors once, instead of lazily." into sc-dev am: f294d0ba5f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14140988

Change-Id: Icaeb16f0e3fbb114c4de551e75adaa948c312ce6
2021-05-26 11:05:23 +00:00
Alison Cichowlas
ea34067bc5 Merge "Set RESULT_OK on exit via copy button." into sc-dev am: 7014d28df9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14670950

Change-Id: Idae04072caf9961880d522c22c23410475ee539f
2021-05-26 11:03:24 +00:00
Galia Peycheva
a9514793e1 Merge "Add TunnelModeStateListener in java+jni" into sc-dev am: ee1219ac1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14340805

Change-Id: I48454975fef2e53568aa7a8fbce08ce53f58c6ce
2021-05-26 10:54:14 +00:00
Dmitri Plotnikov
1643f794d0 Fix system service power calculation when measured energy is available
Bug: 188930285
Test: atest FrameworksCoreTests:SystemServicePowerCalculatorTest
Change-Id: Ic48bd627b8458cde18f812eb63cbc1e37496326d
2021-05-25 18:26:38 -07:00
Adam Bookatz
c86b4777e0 BatteryUsageStats - use bus end time
Now that BUS contains an end time and a duration, use
those in the atom instead of estimating them from
the clock time that the request was made.

Bug: 187223764
Test: atest BatteryUsageStatsProtoTests
Change-Id: Ie69d42bfd19c3a0055e96a25ac33c16c0f7d1a3f
2021-05-25 10:27:29 -07:00
Tiger Huang
ea428b55e7 Merge "Flush the animation if it is canceled" into sc-dev 2021-05-25 17:12:16 +00:00
Jeff DeCew
f294d0ba5f Merge "Resolve Notification.Colors once, instead of lazily." into sc-dev 2021-05-25 16:44:59 +00:00
Alison Cichowlas
7014d28df9 Merge "Set RESULT_OK on exit via copy button." into sc-dev 2021-05-25 15:04:25 +00:00
Jeff DeCew
cab7d8e011 Resolve Notification.Colors once, instead of lazily.
* Instead of resolving colors as-needed, resolve the entire palette potentially used by the notification at the start.
* Centralize color logic and palette storage into Notification.Colors for easier unit testing.
* Adds unit tests for the Notification.Colors, including validating color contrast ratios for various colors.
* Fix a bug with ColorContrastUtil where the luminosity for dark/light font cutoff was 0.5, which resulted in a max contrast ratio of 1.9 for some colors.  Now contrast ratios of 4.5:1 can be achieved for all colors.
* Removes a few of the color accessors in Notification.Builder which were infrequently used, and replaces them with direct use of Notification.Colors.
* Notification specific colors (primary, secondary, default) have only been used by colorized notifications for a few months.  Remove the dark mode overrides of these, ensuring that colorized notifications have the same exact appearance in light and dark themes.
* Replace the use of the "default" color with the "secondary text color"; this practically only affects the alerted bell icon, is more consistent, and reduces complexity.

Fixes: 187881776
Test: manual
Test: atest android.app.NotificationTest
Change-Id: Ib8840d04093094c324d8bdce5b2e84c93a94db8d
2021-05-25 09:57:11 -04:00
Tiger Huang
1ce223481a Flush the animation if it is canceled
The issue was that: if navigation bar is requested to show while a
controller is playing an animation of hiding both status bar and
navigation bar, the animation will be canceled and will stay in an
intermediate state, and then, another controller will play an animation
of showing navigation bar. At the end, status bar will stay visible but
it should be invisible.

This CL fast-forwards the insets animation to the end state if it is
canceled.

Fix: 185459811
Test: Steps in the bug.
Change-Id: Id6ae321b6c153ed1d7155afd6111b193ac9c045c
2021-05-25 13:39:49 +00:00
Galia Peycheva
ee1219ac1d Merge "Add TunnelModeStateListener in java+jni" into sc-dev 2021-05-25 12:05:42 +00:00