Commit Graph

10257 Commits

Author SHA1 Message Date
TreeHugger Robot
d42a4f09c6 Merge "Improve javadoc for some vibration functions." 2022-01-31 11:25:18 +00:00
Etienne Ruffieux
fa43f240c4 Merge "Moving bt stats logging to BatteryStats." 2022-01-29 10:27:49 +00:00
Michael Wachenschwanz
288b4bc054 Merge "Collect fine grain time-in-state Modem durations" 2022-01-28 18:11:53 +00:00
Etienne Ruffieux
5166da8664 Moving bt stats logging to BatteryStats.
Tag: #feature
Bug: 211851706
Test: manual
Change-Id: I7e40b64eaa334792dd409837fb9f512714f65eec
2022-01-28 17:16:50 +00:00
TreeHugger Robot
6c84fb3d29 Merge "Include the new USAGE_CLASS_MEDIA in the UsageClass IntDef." 2022-01-28 13:20:10 +00:00
Robert Horvath
5dfac22224 Merge changes from topics "low-power-standby-api", "lps-wakelock-testapi"
* changes:
  Add API to configure LPS maintenance mode behavior
  Add TestApi to force Low Power Standby to be active
  Add TestApi wakelock flag to have system acquire wakelock
  Allowlist active voice interaction session from Low Power Standby
  Introduce Low Power Standby API and wakelock restrictions
2022-01-28 12:27:05 +00:00
Sailendra Bathi
00049d6db7 Merge changes from topic "bug209973853_ 213658045"
* changes:
  Make StorageVolume#getOwner public
  Add API getStorageVolumesIncludingSharedProfiles()
2022-01-28 04:35:11 +00:00
Robert Horvath
abb95aecf3 Add API to configure LPS maintenance mode behavior
Allow Low Power Standby to be active during doze maintenance modes.

Bug: 190822356
Test: atest LowPowerStandbyControllerTest
Change-Id: I6db6e1a37f48d63d618245f308ea1053c45fb64b
2022-01-27 23:08:32 +01:00
Robert Horvath
e57eb6d07e Add TestApi to force Low Power Standby to be active
Since Low Power Standby depends on multiple factors to activate,
including the private device configuration for the delay after the
device becomes non-interactive, having this TestApi makes testing
faster and more reliable.

Bug: 190822356
Test: atest LowPowerStandbyTest
Change-Id: I5a16083f996bd7421197b08c6632655c8c3d8c29
2022-01-27 23:08:32 +01:00
Robert Horvath
4845efb60d Add TestApi wakelock flag to have system acquire wakelock
Allows CTS tests to test power restrictions that disable wakelocks
without the system suspending (since system-wakelocks are exempt).

Bug: 190822356
Test: atest LowPowerStandbyTest
Change-Id: I91f44ae93480be992151d845175606fb66ecb127
2022-01-27 23:08:32 +01:00
Robert Horvath
287a3a7b94 Allowlist active voice interaction session from Low Power Standby
If a voice interaction session is started, then it should be allowed to
use the network & wakelocks unrestricted while it is ongoing, since it
is direct user interaction.

Bug: 190822356
Test: atest LowPowerStandbyControllerTest PowerManagerServiceTest
Test: With reference VIS: adb shell cmd voiceinteraction show
      To verify allowlist/wakelock state: adb shell dumpsys power
Change-Id: I63cd0cf2e97b574ba8fa6c6caa8f046cce2bb821
2022-01-27 23:08:32 +01:00
Robert Horvath
570645567f Introduce Low Power Standby API and wakelock restrictions
In Low Power Standby, additional restrictions are placed on apps that
are in a process state of FOREGROUND_SERVICE or less important
during standby (while the device is non-interactive):
- Wakelocks are disabled
- Network access is blocked
During doze maintenance windows the restrictions are lifted temporarily.

This change introduces the APIs for Low Power Standby, as well as
the wakelock restrictions.

This feature is targeting TVs. To prevent Low Power Standby from being
enabled on other devices, the feature is guarded by the config flag
config_lowPowerStandbySupported.

Bug: 190822356
Test: atest LowPowerStandbyControllerTest PowerManagerServiceTest
Ignore-AOSP-First: New permission only added internally for now.
Change-Id: Ia40f8a0fc4b366860af58ad76c988f93a5d41936
2022-01-27 23:08:26 +01:00
Dmitri Plotnikov
3bf8cdd5ef Merge "Optimize retrieval of attributed power by process state" 2022-01-27 21:49:00 +00:00
Simon Bowden
424dfc5c19 Include the new USAGE_CLASS_MEDIA in the UsageClass IntDef.
Bug: 207477604
Test: presubmit
Change-Id: I860a5ce3e3978c1936dd0cfad7f25dcc40aebaa1
2022-01-27 17:54:36 +00:00
Simon Bowden
03a52de384 Improve javadoc for some vibration functions.
This is only clarifying existing behavior. Focused on clarifying
what it means to not support an effect, as well as ambiguity in
descriptions of VibrationAttributes.

Test: presubmits, comments only
Change-Id: I7ab5d488d72a386aa2786fdaeb93fef55aaed71d
2022-01-27 17:20:39 +00:00
Yasin Kilicdere
189b76c231 Merge "Add APIs to UserManager for getting remaining user/profile counts." 2022-01-27 16:27:24 +00:00
Treehugger Robot
7a9eed7a6c Merge "Revert "Changing readParcelable and readSerializable's method signatures."" am: de1df073cb am: c75c2e1818 am: 50f0139d43 am: 41285faf9a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960781

Change-Id: I158b6db9798b98c6b668d42b19c9a136b138e038
2022-01-27 13:58:11 +00:00
Treehugger Robot
41285faf9a Merge "Revert "Changing readParcelable and readSerializable's method signatures."" am: de1df073cb am: c75c2e1818 am: 50f0139d43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960781

Change-Id: I0b6fba539144748868f739c5ad5a6661fec11868
2022-01-27 13:45:37 +00:00
Treehugger Robot
50f0139d43 Merge "Revert "Changing readParcelable and readSerializable's method signatures."" am: de1df073cb am: c75c2e1818
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960781

Change-Id: I106956bce8783a8f8719b80bf5885f1b7d48f241
2022-01-27 13:34:25 +00:00
Treehugger Robot
de1df073cb Merge "Revert "Changing readParcelable and readSerializable's method signatures."" 2022-01-27 12:52:47 +00:00
Dmitri Plotnikov
425fbd777e Merge "Add BatteryUsageStats.getDischargeDurationMs" 2022-01-27 02:27:01 +00:00
Hans Boehm
1350cb73d7 Merge "Prefer WeakReference.refersTo() to get()" am: 63e3c2c709 am: aca7bb4b9f am: a2e1dc8b9a am: db7bb39fb9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956816

Change-Id: I8f190ce1b3c9fc97a4efd8f3d90178db6ab362da
2022-01-27 01:18:15 +00:00
Hans Boehm
db7bb39fb9 Merge "Prefer WeakReference.refersTo() to get()" am: 63e3c2c709 am: aca7bb4b9f am: a2e1dc8b9a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956816

Change-Id: I449eec7c2bc21bfa5c7909a4508fbf899a59040d
2022-01-27 01:01:31 +00:00
Hans Boehm
a2e1dc8b9a Merge "Prefer WeakReference.refersTo() to get()" am: 63e3c2c709 am: aca7bb4b9f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956816

Change-Id: I626a291208a3063b93cdd0ef1de131162cc916cb
2022-01-27 00:50:30 +00:00
Dmitri Plotnikov
df174313c8 Optimize retrieval of attributed power by process state
Bug: 191921016
Test: atest FrameworksCoreTests:BatteryStatsTests
Change-Id: I4672737cd4dfa6c60a702d0478c99e695eb699a1
2022-01-26 16:28:15 -08:00
Hans Boehm
63e3c2c709 Merge "Prefer WeakReference.refersTo() to get()" 2022-01-27 00:22:02 +00:00
Dmitri Plotnikov
2fccc3a6bf Merge "Allow requesting BatteryUsageStats for specific power components" 2022-01-27 00:11:17 +00:00
TreeHugger Robot
596e34d6ab Merge "Update PowerManager class docs." 2022-01-26 22:23:16 +00:00
Michael Wachenschwanz
a4d057d791 Collect fine grain time-in-state Modem durations
Break down active modem time on a per Radio Access Technology, per
Frequency Range (for NR only), and per signal strength granularity.

Bug: 202413770
Test: atest BatteryStatsNoteTest

Change-Id: I299dc008ff1b370885601a9afbd8154dfd1082e5
2022-01-26 13:28:38 -08:00
Dmitri Plotnikov
035fba8e31 Allow requesting BatteryUsageStats for specific power components
Bug: 216393849
Test: atest FrameworksCoreTests:BatteryUsageStatsProviderTest
Change-Id: I8db1f41c42929ab2cfc5c64dc0c1fce74ca19896
2022-01-26 08:41:28 -08:00
Michael Wright
f2d038adbe Update PowerManager class docs.
They generally refer to the Wakelock API, but PowerManager controls more
than that these days.

Bug: 216373630
Test: compiles
Change-Id: I117460292b0da8563fbc249e7e2e27671eaf0da5
2022-01-26 13:47:26 +00:00
Adrian Roos
20bf0159c6 Revert "Changing readParcelable and readSerializable's method signatures."
This reverts commit 9c4045f7c9.

Reason for revert: API council feedback

Bug: 210800751
Change-Id: I2ebcc0a94aad393e75a6aaf2addc333eb7fa437f
2022-01-26 12:18:23 +00:00
TreeHugger Robot
2d67d49500 Merge "Make VibrationEffect.WaveformBuilder public" 2022-01-26 12:04:23 +00:00
Philip Junker
330417cfc1 Merge "Move logic from dreamDisplayGroupNoUpdateLocked into PowerGroup." 2022-01-26 09:58:29 +00:00
Philip Junker
f4fa114cb8 Move logic from dreamDisplayGroupNoUpdateLocked into PowerGroup.
Add onWakefulnessChangedCallback which is called whenever the wakefulness of a PowerGroup changes.
Set the wakefulness for a new PowerGroup to WAKEFULNESS_AWAKE instead of the current global wakefulness. This way the newly added PowerGroup will not directly go to sleep if the device happens to be asleep.
Introduce per power group lastWakeTime and lastSleepTime.
Rename setGlobalWakefulnessLocked() to
updateGlobalWakefulnessLocked(), getGlobalWakefulnessLocked() to recalculateGlobalWakefulnessLocked() and getWakefulnessLocked() to getGlobalWakefulnessLocked().
Rename dreamDisplayGroupNoUpdateLocked() to dreamPowerGroupLocked().
Rename sleepDisplayGroupNoUpdateLocked() to dozePowerGroupLocked().
Rename reallySleepDisplayGroupNoUpdateLocked() to sleepPowerGroupLocked().
Rename wakeDisplayGroupNoUpdateLocked() to wakePowerGroupLocked().

Test: atest FrameworksServicesTests:PowerManagerServiceTest
Bug: 200653844
Change-Id: Ic90f3b0c116e8e9db7df730f1500c0e8b99fe677
2022-01-26 09:54:45 +00:00
Wesley Wang
c0401b62b8 BatteryManager support dock charging 2/2
Bug: 194012532
Test: manually, local test with kernel patch
Change-Id: I1ce467844bb7657c1412b8958fe4d4b0961576e8
2022-01-26 02:06:54 +00:00
Adam Bookatz
60dcd3a282 Merge "SystemService post-completed user event" 2022-01-25 21:16:55 +00:00
Michael Wright
764fae2661 Merge "Clean-up some warnings and docs bugs in PowerManager" 2022-01-25 19:01:20 +00:00
Lais Andrade
3c3dcac46d Make VibrationEffect.WaveformBuilder public
Update WaveformBuilder to have a single method that adds transitions to
new sets of vibration attributes for a fixed duration. The parameters
are represented by a new type VibrationEffect.VibrationParameter, and
have two concrete types now: amplitude and frequency.

Update VibrationEffect.Composition API to add effects and repeating
effects, removing the repeat index parameter from WaveformBuilder.

Remove delay parameter from Composition in favor of a new method
addOffPeriod to make it less ambiguous when the delay is played in the
composition.

Bug: 203785430
Test: VibrationEffectTest
Change-Id: I40cbfaff2de3231378da7db6a2bc5c9252e6d8f8
2022-01-25 18:40:24 +00:00
sailendrabathi
1f3815022d Make StorageVolume#getOwner public
Make StorageVolume#getOwner accessible to apps so
that if we have an API that can return volumes
from multiple users (like b/209973853), then the
caller should also be able to figure out which
user each volume belongs to.

Bug: 213658045
Test: atest
AppCloningHostTest#testGetStorageVolumesIncludingSharedProfiles

Change-Id: I8d1ccc621a8808f6f072d147888869013192494b
2022-01-25 16:17:49 +00:00
sailendrabathi
7aeeb34152 Add API getStorageVolumesIncludingSharedProfiles()
The existing getStorageVolumes() does not include storage volumes that
belong to another user with which the calling user shares media with.
Added getStorageVolumesIncludingSharedProfiles() to fix this.

StorageManagerService uses the onUnlockUser method to find which users
share media between them and stores these users as key-value pairs.
This is used when getStorageVolumesIncludingSharedProfiles() is called.

Bug: 209973853
Test: atest
AppCloningHostTest#testGetStorageVolumesIncludingSharedProfiles

Change-Id: Ia554623391505e637cfed904c4b5fc358818d981
2022-01-25 12:33:10 +00:00
TreeHugger Robot
e21406e972 Merge "Renamed removeUserOrSetEphemeral completely" 2022-01-25 05:26:56 +00:00
Adam Bookatz
69444e10e8 SystemService post-completed user event
Introduces a new SystemService stage that indicates that user events
(user-switch, user-starting, user-unlocked) have completed. This can be
used by services for non-urgent tasks that must be completed after the
event in question, but can be delayed until later.

As long as they happen close enough in time, only a single event will be
sent (per user) which will contain information about all the
onUser-completion events it represents.

TODO: Also trigger the call when the user-switch UX has completed
(rather than waiting for the hard-coded delay). First we need to find an
appropriate signal for "switch UX is complete".

Test: atest UserControllerTest
Test: manual confirmation using VoiceInteractionManagerService
Bug: 197344658
Change-Id: Id8e6ce8e9c46f86d48d0a76085123c0c3dd1f2ea
2022-01-24 19:41:24 -08:00
Wenhao Wang
8707290b4b Merge "Add logcat service to track logd access" 2022-01-24 23:01:38 +00:00
Yasin Kilicdere
e7a1b7b9f0 Add APIs to UserManager for getting remaining user/profile counts.
Add UM.getRemainingCreatableUserCount(userType) method as a system API.
Add UM.getRemainingCreatableProfileCount(userType, allowedToRemoveOne) method as a system API.

Bug: 208842920
Bug: 142482943
Test: atest android.multiuser.cts.UserManagerTest

Change-Id: I286fe10b2c8448aeb03ee6c791d415ef62f50451
2022-01-24 21:59:07 +00:00
Lais Andrade
b5ac864874 Merge "Use linear interpolator in VibratorInfo bandwidth curve" 2022-01-24 20:09:04 +00:00
Lais Andrade
0caffbfc38 Merge "Create VibratorFrequencyProfile in Vibrator API." 2022-01-24 20:08:18 +00:00
Roopa Sattiraju
c5399ffe76 Merge "Initialize FrameworkInitializer for Bluetooth" 2022-01-24 19:31:20 +00:00
Dmitri Plotnikov
5f9c679caf Add BatteryUsageStats.getDischargeDurationMs
This method returns the total amount of time the battery was
discharging during the current battery session.

Also, fixing time units used in BatteryStats tests: they are
supposed to be microseconds, not milliseconds.

Bug: 214407774
Test: atest FrameworksCoreTests:BatteryChargeCalculatorTest
Change-Id: I5b64a6bd8a577b558b90cb60a1db8c3774121921
2022-01-24 11:03:53 -08:00
Kholoud Mohamed
35216e0275 Merge "Allow updating enterprise strings in the framework" 2022-01-24 15:09:02 +00:00