Commit Graph

8547 Commits

Author SHA1 Message Date
Dmitri Plotnikov
eb2a57b807 Merge "Add SystemBatteryConsumer.getPowerConsumedByApps()" into sc-dev 2021-03-26 14:31:35 +00:00
Lais Andrade
1eba10e2a2 Merge "Implement PWLE support" into sc-dev 2021-03-26 02:01:14 +00:00
Dmitri Plotnikov
c733ef6692 Add SystemBatteryConsumer.getPowerConsumedByApps()
Also, standardize the implementations of getConsumedPower()
to consistently return the total power consumed, not the
power unattributed to apps.

Bug: 183235836
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Iaedb29b9d7afd9843b0ab871e9b8656963db11ea
2021-03-25 18:45:08 -07:00
Alison Cichowlas
d19254d3ab More WP chooser/resolver strings
Bug: 182361692
Test: atest ChooserActivityTest, ResolverActivityTest
Change-Id: I4838ca3a4c861aae3a7bfe3f2396470c3525d3b5
2021-03-25 13:25:50 +00:00
Lais Andrade
68a199f60d Implement PWLE support
Implement composePwle method and related frequency control getter
introduced to the IVibrator interface.

Bug: 167947076
Test: VibratorControllerTest and VibraionThreadTest
Change-Id: If15f47fae33bce0bcb916e84af0c6712068f3a00
2021-03-25 13:21:02 +00:00
TYM Tsai
8fe0541d85 Merge "Update the content capture text changed event merge logic" into sc-dev 2021-03-25 09:19:16 +00:00
Feng Cao
c8def0695b Update the content capture text changed event merge logic
* This is only applicable when two consecutive CC events are
  both TYPE_VIEW_TEXT_CHANGED event for the same view
* Before this change: we would merge if both events have
  non-empty text. However, if the user types fast, CC will
  not send the updates for individual word. Moreover, if the
  user adds a word and then delete it fast, CC may not capture
  the word since it'd be merged away.
* After this change, we change the criteria to consider whether
  the current text has a ComposingSpan if it's a Spannable.
  The logic is described in the code comment.

Bug: 181906241
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I08d447f557f7e48ef34c5a6241c497db3ce4c5fc
2021-03-25 13:36:28 +08:00
Alexander Dorokhine
65c4fd881e Remove deprecated methods from AppSearch APIs.
These methods were only available for dogfooder transition.
None of these methods shipped in a stable SDK.

Bug: 181887768
Bug: 183395357
Test: Build, presubmit
Change-Id: I74feebd2721208c97475df9b74f734a17a41d5e2
2021-03-24 22:14:38 -07:00
Mark Renouf
bb3a1c43c5 Merge "Enable additional scrollcapture presubmit tests" into sc-dev 2021-03-25 02:24:08 +00:00
Michael Wachenschwanz
522bb3d9cc Merge "Accumulate Mobile Radio and Gnss measured energy in BatteryStats" into sc-dev 2021-03-24 20:46:34 +00:00
Mark Renouf
9f554d2b15 Merge "Mark ViewGroupScrollCaptureTest as non-flaky" into sc-dev 2021-03-24 20:12:09 +00:00
Dmitri Plotnikov
0d1235b411 Merge "Remove references to BatterStatsHelper from BatteryUsageStatsProvider" into sc-dev 2021-03-24 18:35:48 +00:00
Mark Renouf
98faeb1e01 Enable additional scrollcapture presubmit tests
Verified 100% flake free:
    https://paste.googleplex.com/5791620432658432

Test: atest ScrollCaptureConnectionTest
Test: atest ScrollCaptureSearchResultsTest
Bug: 175830396
Change-Id: Ic14de65eaeb8a1690aa2ad4b84ef1248ace10fec
2021-03-24 17:13:48 +00:00
Alexander Dorokhine
ac945b7902 Merge "Add another executor to setSchema() for running framework migrations." into sc-dev 2021-03-24 17:04:53 +00:00
Mark Renouf
6c716b38da Mark ViewGroupScrollCaptureTest as non-flaky
Allows these tests to run in presubmit
Verified 100% flake-free:
   https://paste.googleplex.com/6331441450319872

Bug: 175830396
Test: atest --rerun-until-failure 10 ViewGroupScrollCaptureTest
Change-Id: Ibf278c929f331f9ac6a9ba0630f3f375f4f21b7c
2021-03-24 16:11:26 +00:00
Alison Cichowlas
edfb697d6b Merge "Update strings - chooser/resolver WP strings." into sc-dev 2021-03-24 15:22:26 +00:00
Charles Chen
b26733e23a Merge "Add OWNERS for ComponentCallbacksController" am: 4eca6d0c5c am: 06b102a70d am: 0d35481d52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642179

Change-Id: Ie69644a729f2f535366f5e9997bff2c9d58ec782
2021-03-24 11:55:37 +00:00
Charles Chen
d5e2fc35e3 Merge "Introduce WindowContextController" into sc-dev 2021-03-24 09:42:51 +00:00
Alexander Dorokhine
ff9b4dfc5e Add another executor to setSchema() for running framework migrations.
The advice to add a second executor is based on API council guidance,
who do not recommend reusing the callback executor.

The executor is not yet used but will be used once schema migration is
implemented in framework.

Bug: 183177268
Test: Builds
Change-Id: Ic6735e696bc868884adffddd1433a198a005cad6
2021-03-24 01:57:45 -07:00
Charles Chen
1e76f995bf Merge "Move WindowContext module to window package" into sc-dev 2021-03-24 07:45:41 +00:00
Charles Chen
9c614d10b8 Introduce WindowContextController
This CL extracts the logic which is going to share with
WindowProviderService. It is also the preparation to introduce
WindowProviderService.

Bug: 159767464
Test: atest WindowContextControllerTest

Change-Id: Ib5a4cc8d7853bb01bde1081af091d1069865e3a0
2021-03-24 11:26:52 +08:00
Charles Chen
f48ece4875 Move WindowContext module to window package
In this way, we can clarify the owners and it is easier to maintain.
Also refactor to move WindowContext creation logic to ContextImpl.

Test: atest WindowContext WindowContextTests WindowContextPolicyTests
Bug: 159767464
Bug: 152193787

Change-Id: I78432aa18aa97e001f5a9a04321109e456fd137b
2021-03-24 11:26:50 +08:00
Dmitri Plotnikov
b8b58ebd2f Remove references to BatterStatsHelper from BatteryUsageStatsProvider
Also, add BatteryUsageStatsQuery.getMaxStatsAge() to allow throttling
of battery stats sync.

Bug: 174186345
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: I097c6b9575422837a522cf313a320e83221cdfab
2021-03-23 19:29:11 -07:00
Michael Wachenschwanz
27959e75dc Accumulate Mobile Radio and Gnss measured energy in BatteryStats
Enabled querying and processing Mobile Radio and Gnss energy consumption
in BatteryStatsExternal.
Attribute and accumulate their power deltas in BatteryStatsImpl
Utilize measured power data in MobileRadioPowerCalculator and
GnssPowerCaluclulator.

Bug: 174818228
Test: atest GnssPowerCalculatorTest
Test: atest MobileRadioPowerCalculatorTest
Test: BatteryStatsExternalWorkerTest
Change-Id: If062033ff3c8cff20842be2cd92b04f6cb981366
2021-03-23 18:40:35 -07:00
Alison Cichowlas
f1f6c4ac7e Update strings - chooser/resolver WP strings.
Test: manual verification of string update, atest ChooserActivityTest
Bug: 182361692
Change-Id: I6ec45c5ae2a9877bb2114243589a0da0247bed95
2021-03-23 16:06:14 -04:00
Tim Van Patten
f9c119884a Merge "GameManagerService: Restrict get/set Game Mode to Games" into sc-dev 2021-03-23 19:33:07 +00:00
TreeHugger Robot
14278aecfd Merge "Introduce vibrator frequency mapping." into sc-dev 2021-03-23 19:11:07 +00:00
Dmitri Plotnikov
f2dca81569 Merge "Change getStatsStartRealtime to getStatsStartTimestamp" into sc-dev 2021-03-23 17:29:38 +00:00
Flavio Fiszman
5785c5c68f Merge "Show messages count in People Tile" into sc-dev 2021-03-23 16:42:53 +00:00
Lais Andrade
e574d3bbe8 Introduce vibrator frequency mapping.
Introduce frequency data to VibratorInfo and a transformation for
VibrationEffect that maps relative frequency and amplitude values to the
device absolute values.

The transformation also clips amplitude values to the device bandwidth
map provided.

Pending implementation of chaining composed waveforms and sending PWLE
primitives to the HAL.

Bug: 167947076
Test: DeviceVibrationEffectAdapterTest
Change-Id: Ie7505a1c0f50bb7d907b0752c02987f258316874
2021-03-23 15:28:10 +00:00
TreeHugger Robot
9db9a56c7e Merge "Introduce WaveformBuilder to VibrationEffect" into sc-dev 2021-03-23 14:32:56 +00:00
Jeff Sharkey
9f5392e8b7 Merge changes from topic "nearby-bluetooth-permission-group" into sc-dev
* changes:
  Request new Bluetooth runtime permissions.
  Default grants for "Nearby devices" permission.
  Add BLUETOOTH_SCAN and BLUETOOTH_CONNECT app ops
  Split new NEARBY_DEVICES permissions
  Define new NEARBY_DEVICES permission group
2021-03-23 12:56:30 +00:00
Flavio Fiszman
87eec50482 Show messages count in People Tile
Change-Id: I85b262dda92227cbea2672d9725bda163a5bb42a
Test: manual
Bug: 183382000
2021-03-23 11:25:29 +00:00
TreeHugger Robot
11d5b29d7c Merge "Introduce VibrationEffectSegment" into sc-dev 2021-03-23 08:52:21 +00:00
Dmitri Plotnikov
a5ceb34339 Change getStatsStartRealtime to getStatsStartTimestamp
The implementation is now based on BatteryStats.getStartClockTime

Bug: 183434301
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsTest

Change-Id: I55184f981b2583b184d859788837443e58eccb6c
2021-03-22 22:56:39 -07:00
Jeff DeCew
2a12cfadb4 Merge "New MediaStyle template:" into sc-dev 2021-03-23 02:14:06 +00:00
Adam Bookatz
6b8c61c8fc Merge "SparseDoubleArray" into sc-dev 2021-03-22 21:45:29 +00:00
Jeff Sharkey
7b14b87647 Request new Bluetooth runtime permissions.
An upcoming platform change is introducing a new "Nearby devices"
runtime permission which contains the new BLUETOOTH_CONNECT and
BLUETOOTH_SCAN permissions.

We have logic in place to use <split-permission> to translate the
older BLUETOOTH and BLUETOOTH_ADMIN permissions into these new
runtime permissions, but modern apps will need to pivot to
requesting them directly as part of targeting Android S.

This change requests both the old and new permissions to avoid
breakage while the new permission enforcement is being phased in.

Bug: 181813006
Test: atest CtsPermission2TestCases
Test: atest CtsPermission3TestCases
Test: atest CtsStatsdAtomHostTestCases
Change-Id: I39f45e7d22d132d44c84017cd98e6d9e98533c7f
2021-03-22 15:34:05 -06:00
Jeff DeCew
ff165814e1 New MediaStyle template:
* Remove all media-specific color extraction and colorization logic
* Remove all 'large icon' gradienting logic
* Simplify base (headerless) style to use a LinearLayout instead of tweaking margins
* Make compact media layout a tweak of the base (headerless) layout
* Make big_media layout a tweak of the big_base layout
* Fix an unnecessary swooping animation that happened on expand
* Ensure RTL layout also works

Fixes: 172652345
Test: manual testing w/ updated notify2
Change-Id: I11c1494c0ac32aaf3e9d2010560cc8f1d8c50037
2021-03-22 11:13:08 -04:00
Song Hu
64515ec80b Surface DS targets as per their own score and ranking, remove customized ranking logic (max shortcuts count limit per app, app share adjustment).
This is guarded by the flag  "apply_sharing_app_limits_in_sysui".

Bug: 182146792
Test: verify on local phone
Test: atest ChooserActivityTest
Change-Id: Ic03395343432015400f37299e5748932d2bd9eaa
Merged-In: Ic03395343432015400f37299e5748932d2bd9eaa
(cherry picked from commit d001e08b92)
2021-03-22 13:09:13 +00:00
Charles Chen
b661dcbda6 Merge "Enable to listen to WindowContext's config changes" into sc-dev 2021-03-22 12:28:02 +00:00
Adrian Roos
07f3583061 Merge "IME Insets: Remove obsolete applyImeVisibility call" into sc-dev 2021-03-22 08:38:04 +00:00
Adam Bookatz
8bcb4c9219 SparseDoubleArray
Introduces a SparseDoubleArray class.
It is based on a SparseLongArray, storing the double values
in the bits of the long in the SparseLongArray.

This is a hidden class.
Not all long-term desired features of SparseDoubleArray
have necessarily been implemented here; only the ones needed
right now have been written.

Bug: 182845832
Test: atest BatteryStatsTests
Test: atest FrameworksCoreTests:android.util.SparseDoubleArrayTest
Change-Id: Id68b22328f2660839e2005990766d99140b00c16
2021-03-19 17:31:56 -07:00
Dmitri Plotnikov
31c3622909 Merge "Fix and re-enable BstatsCpuTimesValidationTest" into sc-dev 2021-03-19 22:40:02 +00:00
Dmitri Plotnikov
9e5cf848fc Fix and re-enable BstatsCpuTimesValidationTest
Thanks to jji@ for identifying the cause and the fix.

Bug: 180015146
Test: atest FrameworksCoreTests:com.android.internal.os.BstatsCpuTimesValidationTest
BYPASS_INCLUSIVE_LANGUAGE_REASON=Using a legacy command, cmd deviceidle whitelist

Change-Id: I1dd2402719d5ae7752300b72a5afe3740ac7498a
2021-03-19 14:11:10 -07:00
TreeHugger Robot
c3acebab45 Merge "Add eventMask to DM.registerDisplayListener" into sc-dev 2021-03-19 17:39:54 +00:00
Adrian Roos
142218b1f9 IME Insets: Remove obsolete applyImeVisibility call
Test: atest InsetsControllerTest ImeInsetsSourceConsumerTest
Bug: 167947407
Change-Id: I8abb210eb20a17f5dfd6d071c57838afb9deb263
2021-03-19 17:12:26 +00:00
Marin Shalamanov
204eba6cdc Add eventMask to DM.registerDisplayListener
Add a new parameter to DisplayManager.registDisplayListener
which clients can use to specify in which events
they are interested.

Test: atest DisplayManagerServiceTest
      atest DisplayManagerGlobalTest

Bug: 171240622
Change-Id: Icc71bdd9ddb390bc5406b298a557c84194a53c00
2021-03-19 16:15:11 +01:00
Charles Chen
0783811428 Enable to listen to WindowContext's config changes
This CL overrides registerComponentCallbacks for
WindowContext. Users can use below code snippet
to listen to Configuration changes.
```
Context windowContext = context.createWindowContext(
        display, ...);
windowContext.registerComponentCallbacks(
        new ComponentCallbacks() {
            @Override
            public void onConfigurationChanged(
                    Configuration newConfig) {
                    // Do Something
                }
        });
```

Bug: 181134729
Test: atest WindowContextTests
Test: atest ComponentCallbacksControllerTest

Change-Id: Iff46607bae3c942a96b64dcc97708f3a8c33f23a
2021-03-19 21:56:35 +08:00
TreeHugger Robot
3f6e6e2ef8 Merge "Fix and re-enable BatteryStatsCpuTimesTest" into sc-dev 2021-03-18 23:56:00 +00:00