Commit Graph

408 Commits

Author SHA1 Message Date
Zhen Zhang
879979651d Merge "Log storage savings info with the GlobalHibernatedApps atom" into sc-dev am: b70b810af4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15025828

Change-Id: I0ad5204e3741417f30cf035157d41cda2b7a06d5
2021-06-23 18:36:34 +00:00
Zhen Zhang
5e0446a263 Log storage savings info with the GlobalHibernatedApps atom
Retrieve the number of freed bytes from PM and store it in
GlobalLevelState when a package is globally hibernated. Reset the value
when it gets unhibernated and write it to disk to persist across device
reboot.

Bug: 188819665
Test: atest AppHibernationServiceTest
Change-Id: I187ec803776cc76c77a660e1ba2f72c2e77765f9
2021-06-21 17:56:32 -07:00
Treehugger Robot
0eeb801d32 Merge "Add OWNERS for WM proto files" am: c14325dbdc am: 2bae704d44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1738299

Change-Id: I6cf39d9e11453615e2b11962ee86be15746c31f4
2021-06-17 11:52:00 +00:00
Charles Chen
d74a3afec9 Add OWNERS for WM proto files
Bug: 190684677
Test: upload check
Change-Id: Iba1516bc1fb23ac8bf3126c42350b8ea82bfe62b
2021-06-17 16:57:30 +08:00
Joe Bolinger
fdc48a48c5 Delay starting fingerprint sensor when using multi-sensor devices.
Fix: 183951321

Test: atest com.android.server.biometrics
Test: atest com.android.systemui.biometrics
Test: manual with integration app

Change-Id: Ib1e92278d695b0ce5b6f799f51007262ade31f05
2021-05-20 18:56:31 -07:00
Chris Li
0353f53b9a Add feature id, isRootDisplayArea, isOrganized to DisplayArea dump
This is to allow us to verify DisplayArea policy in CTS

Bug: 175840704
Test: atest CtsWindowManagerDeviceTestCases:DisplayAreaTests
Change-Id: I60d9fe1ee68b38e2812feb9a818f9d4a67edc694
2021-05-13 23:54:36 -07:00
Joe Bolinger
7d19b1ef7a Add extra flags to biometrics proto for tests.
Bug: 185290945
Test: atest android.server.biometrics.fingerprint.FingerprintServiceTest#testRejectThenErrorFromForegroundActivity
Change-Id: I10cfdf0a2183643f9957b2a6f8a9448a8de858a0
2021-05-12 18:08:20 -07:00
Kweku Adams
574b4199a1 Updating proto enums.
Updating proto enums to differentiate between the internal job stop
reasons and the public stop reasons.

Bug: 138239687
Bug: 171305774
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 8
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest ContentResolverTest (all)
Test: atest CtsJobSchedulerTestCases
Test: atest CtsSyncManagerTest
Test: atest SyncManagerTest
Test: atest SyncOperationTest
Test: atest SyncRequestTest
Change-Id: I8d51c4dfb57d52e9c507437107afbad48cc9cecd
2021-04-22 09:34:41 -07:00
Haining Chen
c0bb3d46fc Merge "Add the current sensor strength into dumpsys" into sc-dev 2021-04-20 20:27:30 +00:00
Hongwei Wang
7f64b14478 Fix back stack for PiP from multi-activity Task
Details in design doc go/pip-and-back

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/g8lbXnC8ln0t54ARxfPELo
Bug: 184758170
Test: ensure back stack works for Netflix, see video
Test: atest PinnedStackTests
Test: atest RootWindowContainerTests
Change-Id: I9e2f8d0d50dd107ff30fd7afe6273d8347aac803
2021-04-14 15:00:31 -07:00
Sudheer Shanka
9576b5a2be Merge "Allow clients to register for listening to changes in capabilities." into sc-dev 2021-04-07 20:18:04 +00:00
Sudheer Shanka
ce7fc42291 Allow clients to register for listening to changes in capabilities.
Clients can register for listening to changes in procstates and if
they are only interested in knowing if the procstate crosses a certain
threshold, they can specify a "cutpoint" and they will only get
a callback if the procstate crosses that "cutpoint" but clients cannot
use this if they are also interested in changes in capabilities. So,
add a way for clients to use the "cutpoint" facility and also listen
to changes in capabilities.

Bug: 177641226
Test: atest services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
Test: atest services/tests/servicestests/src/com/android/server/am/UidObserverControllerTest.java
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I1198e602ca81382975500b10f930dacfd16919e3
2021-04-05 10:55:57 -07:00
Haining Chen
03ecc2d4b7 Add the current sensor strength into dumpsys
Bug: 169730503

Test: atest com.android.server.biometrics
Test: atest com.android.systemui.biometrics
Change-Id: I67529fc65fb712ff7231f4aa063cb0d84aabd701
2021-04-01 14:05:27 -07:00
Zhen Zhang
131f53fdf4 Persist user-agnostic lastTimeAnyComponentUsed in disk
Persist the user-agnostic lastTimeAnyComponentUsed usage stats in disk.

Bug: 183462940
Test: atest UsageStatsServiceTest
Test: atest UserStatsPersistenceTest
Test: atest CtsUsageStatsTestCases:UsageStatsTest

Change-Id: Ibe946f8e9fd9fa7d9ba546da67a6040c00e0f9ea
2021-03-31 11:27:26 -07:00
Sean Stout
00dcff88e8 Merge "Enable per-DisplayGroup timeouts" into sc-dev 2021-03-24 21:46:38 +00:00
Sean Stout
072eb8de7b Enable per-DisplayGroup timeouts
DisplayGroups may now timeout individually from one another.

Bug: 175764389
Test: manual - check timeout behavior on multi-DisplayGroup device
Change-Id: I842939d3048e1eb16790a131c83e1b2ac1ac4f47
2021-03-24 16:21:33 +00:00
TreeHugger Robot
9db9a56c7e Merge "Introduce WaveformBuilder to VibrationEffect" into sc-dev 2021-03-23 14:32:56 +00:00
TreeHugger Robot
11d5b29d7c Merge "Introduce VibrationEffectSegment" into sc-dev 2021-03-23 08:52:21 +00:00
Kevin Chyn
7d11db35c9 2/n: Add UserAwareBiometricScheduler
Bug: 181984005
Test: atest com.android.server.biometrics
Change-Id: I67beecf1aee2631856da3541ca1e0d158050ac65
2021-03-22 20:51:26 -07:00
Lais Andrade
601a944e45 Introduce WaveformBuilder to VibrationEffect
Create a new parcelable RampSegment and introduce
VibrationEffect.startWaveform() method that returns a
WaveformBuilder that allows creating step/ramp waveforms that
changes amplitude and frequency of the effect.

Implementations of VibrationThread and InputManagerService for now just
ignore the new segments and keep existing behavior.

Bug: 167947076
Test: VibrationEffectTest
Change-Id: Ibac895b63196e779457efc297f1f5497a7814ae9
2021-03-18 18:06:45 +00:00
Lais Andrade
bd992109e0 Introduce VibrationEffectSegment
Create a new parcelable VibrationEffectSegment in the new package
android.os.vibrator, together with three concrete implementations for
the segment types: step, prebaked and primitive.

Remove all implementations of VibrationEffect to allow composition of
any effects, represented now by the concrete type VibrationEffect that
holds a list of segments.

Bug: 167947076
Test: VibrationEffectTest
Change-Id: I79c99e29f436ed77558af764f55633bb4636e034
2021-03-18 11:03:45 +00:00
Kevin Chyn
42968075d6 Biometric time-based resetLockout for multi-biometric devices
On devices with multiple sensors, lockout should be reset whenever
any strong sensor authenticates.

Bug: 163058911
Test: atest CtsBiometricsTestCases

Change-Id: I4bcdc0279cdaa444e59cf0fac6645d9a67e7d11d
2021-03-17 21:45:42 -07:00
Zhen Zhang
23f7206dbc Create component used metrics in UsageStats
Created a new metrics called mLastTimeComponentUsed in UsageStats.
It is persisted and loaded as other metrics.

Bug: 175829712
Test: core/tests/coretests/src/android/app/usage/UsageStatsTest
Test: cts/UsageStatsTest
Test: UsageStatsDatabaseTest
Test: UsageStatsServiceTest
Test: UsageStatsPersistenceTest
Change-Id: I10cf5c40cf5955246a6a04e96ac0352b4ed29acd
2021-03-15 14:24:08 -07:00
tomnatan
c3cb0cb12b WM: Add in_size_compat_mode to ActivityRecord proto
In addition, rename in_size_compat_mode in WindowState proto to
has_compat_scale for clarity.

Test: atest CtsWindowManagerDeviceTestCases:CompatScaleTests
Bug: 181878559
Change-Id: I0d6844be3f138fdc16a22497346e789d93af7396
2021-03-11 15:38:18 +00:00
Hui Yu
a7f8eaa171 callingUid needs to be passed from AMS to DeviceIdleController.
callingUid is the UID of the app who added the temp-allowlist entry, it
needs to be passed from AMS to DeviceIdleController.

The callingUid will go into Westworld metric
ForegroundServiceStateChanged.

Bug: 171305836
Test: Observe the callingUid while grepping for "tempAllowListReason" in adb logcat, it should be a non-zero value.
BYPASS_INCLUSIVE_LANGUAGE_REASON=Existing public API.

Change-Id: I19f5cf8f72d5fbfb3fd6caefe6978e75d4c1a801
2021-03-05 10:06:23 -08:00
TreeHugger Robot
cf82f60caf Merge "Remove frozen bounds of activity and task" into sc-dev 2021-03-03 13:06:56 +00:00
Hui Yu
3d96c757a5 Merge "Log the temp allowlist reason/duration at FGS start." into sc-dev 2021-02-26 01:21:13 +00:00
Thierry Strudel
d27ed1bd48 Merge "PowerStats: adjust time since boot to epoch before writing to disk" into sc-dev 2021-02-25 21:29:45 +00:00
Thierry Strudel
721bb44733 PowerStats: adjust time since boot to epoch before writing to disk
Data stored to disk are extracted into an incident report for timeseries
visualization which shows walltime and may span multiple reboot sessions
so storing walltime is better suited than relative time since device boot.

Bug: 179712445
Tests: atest FrameworksServicesTests:PowerStatsServiceTest
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Change-Id: I5ae8e2fe22f1ab9ea960e5be8fef4e9fb1cc10f0
2021-02-25 10:38:01 -08:00
Riddle Hsu
52642a88f6 Remove frozen bounds of activity and task
Since unifying of hierarchy, the configuration of Activity and
windows are updated together. There won't be temporal inconsistent
bounds any more.
History commit: 0429f35

Also remove the update of override config even there are no changes.
Because performDisplayOverrideConfigUpdate was changed to not always
call setNewDisplayOverrideConfiguration for years. So the original
purpose of the change is gone.
History commit: c646717

Bug: 159103089
Bug: 163976519
Test: CtsWindowManagerDeviceTestCases
Change-Id: Ie5711ab4bcff7bf572cf6410df9bc8aaa5688e11
2021-02-25 20:15:19 +08:00
Louis Chang
09f52aa440 Merge "Rename Stack to Task related terms (7/n)" into sc-dev 2021-02-25 04:58:24 +00:00
Louis Chang
7efc57797c Rename Stack to Task related terms (7/n)
- Renaming PinnedStack to PinnedTask
- Renaming DockedStack to DockedTask

Bug: 157876447
Test: presubmit
Change-Id: I51c10564647ed0d46eddc0c51a1ee06eef897e43
2021-02-25 04:57:26 +00:00
Hui Yu
bd7619635d Log the temp allowlist reason/duration at FGS start.
There are four ways a package can be temp allowlisted:
1. Calling BroadcastOptions#setTemporaryAppWhitelistDuration() to
allowlist a BroadcastReceiver, this is a SystemApi.
2. Calling ActivityManagerService#setPendingIntentWhitelistDuration()
to allowlist a PendingIntent, this is not an API, it is an internal method.
3. Calling PowerWhitelistManager#whitelistAppTemporarily() to allowlist
a package, this is a SystemApi.
4. DeviceIdleController.addPowerSaveTempWhitelistApp(), this is an
internal method.

Also the package can be permanently allowlsited in
 ActivityManagerService#mDeviceIdleExceptIdleAllowlist.

Move the BG-FGS-launch reasonCode from ActiveService.java to
PowerWhitelistManager.java. Define a list of temp allowlist reasonCode
in addition to the BG-FGS-launch reasonCode. The reasonCode is passed
around in DeviceIdleController and ActivityManagerService, it will be
used in statsd FGS metric.

At FGS start, check all above allowlists and record the reasonCode/reason/duration in
ServiceRecord#mInfoTempAllowListReason field.

If mInfoTempAllowListReason is not null, log the reasonCode/reason/duration in "Background started FGS" log
message, with key "tempAllowListReason".

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java
Reboot device, observe all "tempAllowListReason" listed above in logcat.
BYPASS_INCLUSIVE_LANGUAGE_REASON=existing APIs

Change-Id: Ieb52d95aae3258817a67734c093cb12fc78a81fd
CTS-Coverage-Bug: 181160445
2021-02-24 22:02:09 +00:00
Sergey Nikolaienkov
b0ad9cd284 Add compat info to WindowManager proto dump
Bug: 168419799
Test: atest CtsWindowManagerDeviceTestCases:CompatScaleTests
Change-Id: Idc321d5f1376a32b2b1b34b1a099cf12d96c943d
2021-02-23 08:09:05 +00:00
Lais Andrade
43bf46112c Clean up after VibratorManager feature introduced
- Move VibratorManagerService to com.android.server.vibrator and make
all other classes there package-private;
- Add some missing haptics-related files to OWNERS files;
- Remove some unused methods;
- Delegate CombinedVibrationEffect to input devices, instead of only
delegating VibrationEffect effects;
- Move vibratorservice.proto to vibrator folder and add missing fields;
- Mark large VibrationThread tests with @LargeTest;

Fix: 131311651
Fix: 177805090
Test: VibratorManagerServiceTest
Change-Id: Ic747190b70b2f45ac7671eb01f8f05cf66d3a96c
2021-02-12 14:45:58 +00:00
TreeHugger Robot
208c4707e8 Merge "Log energy consumer result attribution data" into sc-dev 2021-02-04 23:07:39 +00:00
Treehugger Robot
52dd967078 Merge changes If58d648d,Iec51a349 am: de246e1658 am: f5075fb162 am: a6de64a7b6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566903

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaa608d60c0e4623ea1ef2a8020f2c131e7495411
2021-02-04 21:50:55 +00:00
Mat Bevilacqua
3bf7191228 Log energy consumer result attribution data
Bug: 175723658
Test: atest FrameworksServicesTests:PowerStatsServiceTest
Change-Id: I4d0dccd440b02a35e086b08e31b1bf1f087f61e3
2021-02-03 19:48:58 -08:00
Kevin Han
dba83c49dd Add persistence for app hibernation states
Persist hibernation states to disk. This CL persists the user-level
and global hibernation states to disk.

Bug: 175829330
Test: atest AppHibernationServiceTest
Test: atest HibernationStateDiskStoreTest
Change-Id: If58d648d720bed1693b9346c4d0e85074daec931
2021-02-03 18:17:25 -08:00
TreeHugger Robot
b87b87cf75 Merge "Add subsystem name field to Channel" into sc-dev 2021-01-28 21:36:10 +00:00
Mat Bevilacqua
1e271f59e0 Add subsystem name field to Channel
Bug: 178115561
Test: atest FrameworksServicesTests:PowerStatsServiceTest
Change-Id: I864d9ff729534d81a1f7a89c860a78d659ccc1b2
2021-01-27 18:08:58 -08:00
Louis Chang
5dc6029d31 Merge "Prevent set intent on non-leaf tasks" into sc-dev 2021-01-28 01:16:08 +00:00
Alan Stokes
dfebe6bd9b Clean up BLOCK_ACTIVITY_STARTS_AFTER_HOME_FLAG.
This flag was only introduced to allow teamfood testing of the change
to use background activity launch blocking instead of delaying app
launches after app switching protection is engaged. The flag has been
on everywhere for 2 weeks (ag/176961146) without problems and is no
longer needed.

This CL went in three stages:

- Change getBalAppSwitchesProtectionEnabled() in
  ActivityTaskManagerService to always return true.

- Inline the function (and selected others) into call sites and then
  eliminate the resulting dead code - done as a serious of automatic
  refactorings to minimise the risk of human error.

- Delete unit tests for code that no longer exists.

Apart from deleting the use of the flag I believe this CL is a pure
refactoring with no new behavior changes.

The end result is we eliminate quite a lot of code - especially
PendingActivityLaunch and all uses of it.

Test: atest BackgroundActivityLauncherTest
Test: atest ActivityStarterTests (both of them)
Test: manual
Bug: 176961146
Bug: 159433730
Change-Id: I01625843f67b00e5901833cff99aec16c1287a0c
Merged-In: I01625843f67b00e5901833cff99aec16c1287a0c
Exempt-From-Owner-Approval: proto change approved on main branch
(cherry picked from commit 5897ecc699)
2021-01-27 11:29:32 +00:00
Louis Chang
f666e494af Prevent set intent on non-leaf tasks
The root task was created with null intent, but the intent,
resize mode and other information were updated from child tasks,
which sets the split-screen-secondary root task to unresizeable.

Bug: 170801863
Test: presubmit
Change-Id: I57458c05c4c579d78894869c0590788d17912bc3
2021-01-27 08:26:07 +00:00
Benjamin Schwartz
3bf626d1cb Merge changes from topic "energyconsumer"
* changes:
  Update BatteryExternalStatsWorker to use the new EnergyConsumerType
  Update to new version of PowerStats HAL 2.0
2021-01-26 04:35:19 +00:00
Mat Bevilacqua
6058dc2190 Update to new version of PowerStats HAL 2.0
Bug: 178048034
Test: atest FrameworksServicesTests:PowerStatsServiceTest
Change-Id: I714d2037a3576a3f6f89211d64ccf88cefa51abf
2021-01-25 17:09:05 -08:00
Hai Zhang
0b4f1718f8 Move role into module.
These changes have to be in this CL together because:

- Code in service-permission depends on IRoleManager in
framework-permission, so the APIs in framework-permission and the code
in service-permission need to be moved together.

- The changes to service-permission build rules doesn't make sense
without the code moved in, so they have to be together as well.

Other details:

- framework-annotations: Several annotations are added into
framework-annoatations. Since the discussion with API council seems to
allow user IDs in system server in-process APIs, @UserIdInt and
@AppIdInt is added. @MainThread and @AnyThread is added since
@WorkerThread is already added. @CallSuper is added since @CheckResult
is also already added and they are similar in terms of category of
functionality.

- framework-permission-s-shared-srcs: 3 classes (and 2 AIDL files)
from framework is copied as shared source files and jarjared for
framework-permission, and an additional 3 is added for
service-permission as service-permission-shared-srcs. Similar to
framework-wifi and service-wifi, the 3 classes in framework-permission
is also available to service-permission by the stub library
framework-permission-pre-jarjar, and the other 3 classes used only for
service-permission is included separately to minimize our impact on
classes loaded into boot classpath. framework-permission and
service-permission shares the same jarjar rules to make sure the
classes remain available, and for the same reason framework-permission
cannot be shrank during any optimization.

- framework-permission-s-shared: A java_library target for
framework-permission-shared-srcs is created to make sure that the
public classes won't be counted as APIs, as it would be if directly
included as srcs for framework-permission
java_sdk_library. service-permission-shared is the same thing for
service-permission.

- framework-permission-s: A new java_sdk_library target created to be
loaded into bootclasspath by Android S+.

- Dumpsys Protobuf: The dumpsys protobuf
file (rolemanagerservice.proto) is moved into the module, and both the
platform (incident.proto) and the module uses protoc-gen-javastream to
generate the Java classes from it. This should be fine since it's a
"source level inclusion", and we jarjar the generated classes in our
module to avoid conflict with platform copies.

Bug: 158736025
Test: manual
Test: device boots, default apps can be changed successfully.
Change-Id: I1914774f631e51d0c587a7e527a1c9bc05ee1595
2021-01-24 12:55:16 -08:00
Kevin Chyn
7a707810e7 9/n: Add BiometricScheduler proto dump
1) Adds biometrics.proto definition for BaseClientMonitor subtypes
2) Adds BiometricScheduler proto dump

When dumping the scheduler, the caller may request for the recent
operation queue to be cleared after dumping or not.

Note that we don't need BiometricScheduler.Operation#STATE_*
in the dump, since (for now) we just want to know what operations
have been run.

We can always add additional state, success/failure, etc in the
future if needed.

Bug: 159667191
Test: atest com.android.server.biometrics
Test: atest CtsBiometricsTestCases
Change-Id: I7d2350f00aaeef03ab7d74013b476af053240320
2021-01-21 16:59:59 -08:00
Hui Yu
19b558678d DeviceIdleController updates AMS with temp allowlist type.
1. add a "type" parameter to AMS.updateDeviceIdleTempWhitelist() which is
called by DeviceIdleController.
2. The default temp allowlist type is TEMPORARY_WHITELIST_TYPE_FOREGROUND_SERVICE_ALLOWED
which allows BG-FGS launch.
3. AMS.tempWhitelistUidLocked() already has a type parameter. Other API
to add temp allowlist can also add type parameter other than the
default.

Bug: 175244558.
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java

Change-Id: Ib42c445c15966bd260964782a7254ed2a7ffa405
2021-01-19 10:01:12 -08:00
Kevin Chyn
83010aa483 Merge "Add biometric modality to dumpsys" 2021-01-13 01:49:43 +00:00