* 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
Allow Low Power Standby to be active during doze maintenance modes.
Bug: 190822356
Test: atest LowPowerStandbyControllerTest
Change-Id: I6db6e1a37f48d63d618245f308ea1053c45fb64b
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
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
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
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
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
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
They generally refer to the Wakelock API, but PowerManager controls more
than that these days.
Bug: 216373630
Test: compiles
Change-Id: I117460292b0da8563fbc249e7e2e27671eaf0da5
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
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
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
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
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
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
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