Commit Graph

17529 Commits

Author SHA1 Message Date
Fabian Kozynski
c511e019f0 Make API one-way
Convert the return values to values that will be returned through the
callback. Separate the ranges by SUCCESS of the request or ERROR.

Test: CTS tests
Fixes: 199829900
Change-Id: If32083e52ed87a79953c952bbaadd8d977e0226c
2021-10-05 10:25:29 -04:00
Li Li
00b3cd7379 Freezer: don't skip processes with file locks
To prevent deadlock, freezer had to skip all processes holding any file
locks. As SQLite is using exclusive locks, a lot of applications won't
be frozen. The new logic will detect the lock dependencies and only
unfreeze the processes that block others.

This patch also adds a rewind() function to ProcFileReader class so that
ProcLocksReader doesn't open/close procfs nodes and create new instance
each time /proc/locks is parsed.

Bug: 176927978
Test: atest ProcFileReaderTest
Test: atest ProcLocksReaderTest
Test: verified processes with file locks could be frozen
Test: verified processes with blocking file locks were unfrozen
Change-Id: Ic2c89e6dcc9ee186840731c911be2aa3247b1352
2021-09-30 22:11:21 -07:00
Pedro Loureiro
19a969e52c Merge "Parse new xml attributes used for updatable shared libraries" 2021-09-30 18:21:14 +00:00
TreeHugger Robot
b479f7a48a Merge "Add multi-user jank monitoring" into sc-v2-dev am: 89f022ac99 am: e10d87b485
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15891027

Change-Id: Ie1f093096383dc96a1dc9921c5f13ef77bad73d3
2021-09-29 22:59:19 +00:00
TreeHugger Robot
e10d87b485 Merge "Add multi-user jank monitoring" into sc-v2-dev am: 89f022ac99
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15891027

Change-Id: I8f5811c0f3d625c13422a9bcb050295bf7789368
2021-09-29 22:42:20 +00:00
TreeHugger Robot
89f022ac99 Merge "Add multi-user jank monitoring" into sc-v2-dev 2021-09-29 22:31:47 +00:00
Lucas Dupin
71d3f5bb9e Add multi-user jank monitoring
Created CUJ for monitoring jank when switching users, including guest
users, but excluding the "Add User" user journey.

Bug: 200160966
Test: switch users manually, look at logs
Test: atest KeyguardUpdateMonitorTest
Test: atest UserSwitcherControllerTest
Change-Id: I5570133a1f96a58d39a8f053f9f480cdaada8df1
2021-09-29 10:26:26 -07:00
Pedro Loureiro
70da334f7b Parse new xml attributes used for updatable shared libraries
Attributes added to the `library` tag used in AndroidManifest.xml.
They allow to easily and transparently include/exclude a library from
apps for compatibility purposes.

Bug: 191978330
Test: atest com.android.server.pm.parsing.library.ApexSharedLibraryUpdaterTest com.android.server.systemconfig.SystemConfigTest
Change-Id: Ibdde742a05fd670a9aaee5ee77ae25b9c0801f53
2021-09-29 09:47:15 +00:00
TreeHugger Robot
dad2a6fd9f Merge "Zero out WiFi duration and power if ControllerActivityCounter is null" into sc-qpr1-dev am: c410f29893 am: bfe149f2ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15934611

Change-Id: I19fdba5bffb025cb61f4de03fe8cf78c3b7c479b
2021-09-29 00:54:20 +00:00
TreeHugger Robot
bfe149f2ed Merge "Zero out WiFi duration and power if ControllerActivityCounter is null" into sc-qpr1-dev am: c410f29893
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15934611

Change-Id: Iee9dbf00b4568400c319a348587018bfa3e6fb77
2021-09-29 00:43:25 +00:00
TreeHugger Robot
7f541b72f7 Merge "Zero out WiFi duration and power if ControllerActivityCounter is null" into sc-qpr1-dev am: c410f29893
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15934611

Change-Id: I94e7ba1c4e69ed2140ca49f4542c08e0bbd72573
2021-09-29 00:43:17 +00:00
TreeHugger Robot
dddbf380e5 Merge "[NGA v2] Reliable Visible Activity Lookup" into sc-v2-dev am: 80fcbc8fe0 am: 347557e905
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15810445

Change-Id: I4a5b0c551343984de6124a497f7b24dd750c5aca
2021-09-28 18:16:17 +00:00
TreeHugger Robot
347557e905 Merge "[NGA v2] Reliable Visible Activity Lookup" into sc-v2-dev am: 80fcbc8fe0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15810445

Change-Id: Ibfce3c573e7cc136226599500e438527a1565075
2021-09-28 18:02:38 +00:00
Dmitri Plotnikov
fb10be47c9 Zero out WiFi duration and power if ControllerActivityCounter is null
Bug: 200346841
Test: atest FrameworksCoreTests:WifiPowerCalculatorTest
Change-Id: I087e3b60c277c1d1a63b6c06e60ffcbe95224668
(cherry picked from commit 199f93ac3b)
2021-09-28 17:20:34 +00:00
Dmitri Plotnikov
df8954c97b Merge "Use LongArrayMultiStateCounter for proc-in-state time counting" 2021-09-28 17:19:46 +00:00
lpeter
918ea9940f [NGA v2] Reliable Visible Activity Lookup
To enable more voice-oriented in-app user journeys, Google Assistant
needs to access more information regarding the visible activities
via the Voice Interaction Session. Thus, we provide the APIs to receive
the changed visible activities in Voice Interaction Session.

Bug: 178244510
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Change-Id: I019d09fee8105ae1eadbc76803f46fd8b1948f6b
2021-09-28 17:06:49 +08:00
TreeHugger Robot
a6c6fdb0d2 Merge "Zero out WiFi duration and power if ControllerActivityCounter is null" 2021-09-28 03:41:52 +00:00
Dmitri Plotnikov
199f93ac3b Zero out WiFi duration and power if ControllerActivityCounter is null
Bug: 200346841
Test: atest FrameworksCoreTests:WifiPowerCalculatorTest
Change-Id: I087e3b60c277c1d1a63b6c06e60ffcbe95224668
2021-09-27 17:50:16 -07:00
Dmitri Plotnikov
2464cfb9d0 Use LongArrayMultiStateCounter for proc-in-state time counting
The acquisition of eBPF's per-UID time-in-state data is now done
in the native code, directly integrating with the native layer
of LongArrayMultiStateCounter.

Bug: 197162116
Test: atest FrameworksCoreTests:BatteryStatsImplTest
      atest FrameworksCoreTests:BstatsCpuTimesValidationTest
      atest FrameworksCoreTests:LongArrayMultiStateCounterTest
      atest FrameworksCoreTests:KernelSingleUidTimeReaderTest

Change-Id: I1fdc747f272ecc0c35c51db39e442aac67d1b24c
2021-09-27 17:42:13 -07:00
Varun Shah
991929b9fb Merge "Dismiss the suspend dialog if conditions have been modified." into sc-qpr1-dev am: 912d89451a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15853562

Change-Id: Id9539465fac375a4c2953aff19d6b3e5a880375a
2021-09-27 16:10:57 +00:00
Rhed Jao
5b39a5111d Merge "Dump overlay configurations to the bugreport" 2021-09-27 02:19:51 +00:00
TreeHugger Robot
a401999f85 Merge "Check custom component names before aggregating BatteryUsageStats snapshots" into sc-qpr1-dev am: 0ef5152b17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15872124

Change-Id: I453c8cda7d7d6ab29facc35acd1d6ab84f6ee5fa
2021-09-25 02:17:20 +00:00
Dmitri Plotnikov
5375fe32cb Drop per-app measured energy when an OTA changes the set of energy components am: 50348e3120
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15857253

Change-Id: Ib7813a74c1c4c12d1827d8a07f6caaa8dd4de65b
2021-09-25 02:11:05 +00:00
TreeHugger Robot
cae5560e88 Merge "Create XML parser only once." 2021-09-24 23:22:13 +00:00
Varun Shah
153651ed3e Merge "Dismiss the suspend dialog if conditions have been modified." into sc-qpr1-dev am: 912d89451a am: 12c61b00c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15853562

Change-Id: Iff94defece97ede092c6236da4833b7b3907e955
2021-09-24 18:20:29 +00:00
Varun Shah
12c61b00c0 Merge "Dismiss the suspend dialog if conditions have been modified." into sc-qpr1-dev am: 912d89451a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15853562

Change-Id: Ieead99da9e0ed20b30b9add94c8003ae69ef9424
2021-09-24 18:07:21 +00:00
Varun Shah
912d89451a Merge "Dismiss the suspend dialog if conditions have been modified." into sc-qpr1-dev 2021-09-24 17:54:45 +00:00
TreeHugger Robot
085b3212ed Merge "Show nearby share as normal app target and in first item always" 2021-09-24 14:33:14 +00:00
Zhen Zhang
8077327624 Show nearby share as normal app target and in first item always
Show nearby share as a normal app target instead of action button. And
always put it as the first item in App prediction Row. The change is
gaurded by lowRamDevice flag and experiment flag. by default, there is
no change to current behavior. One needs to run command 'adb shell
device_config put systemui is_nearby_share_first_target_in_ranked_app true' on
Android Go devices to see the effect.

Bug: 197241083
Test: atest ResolverListControllerTest
Test: atest AbstractResolverComparatorTest
Test: atest ResolverActivityTest
Test: atest ChooserActivityTest (no new failure)

Change-Id: I22106e382e0d96fc760e4a9fb94be3ae293c8497
2021-09-24 09:19:49 +00:00
Alex Buynytskyy
0c39dd02f6 Create XML parser only once.
This greatly cuts memory usage: 2.5M -> 0.5M (see bug for traces).

Bug: 200995209
Test: atest SystemConfigTest SystemConfigNamedActorTest
Change-Id: I0b76dc2610afaad3e418ef3115c5e54a05ab334e
2021-09-23 15:36:59 -07:00
Rhed Jao
5487d16c81 Dump overlay configurations to the bugreport
Bug: 200250601
Test: adb bugreport
Change-Id: I912c94a44b0592349324d6f74a8685997b2a7601
2021-09-23 20:52:27 +08:00
Rhed Jao
48004fb004 Merge "Fix an IllegalStateException in the OverlayConfigParser" 2021-09-23 03:26:26 +00:00
Mark Renouf
e86123e6d0 Merge "Clean up and expand long screenshots test coverage" 2021-09-22 19:15:27 +00:00
Mark Renouf
1ad5211818 Clean up and expand long screenshots test coverage
This combines two nearly duplicate sets of tests into a single reusable
base test class and adds test coverage for ListViewCaptureHelper and
WebViewCaptureHelperTest.

The tests cover scrolling, bounds checking and clipping and ensure
the captured region is centered vertically within the visible bounds.

Bug: 195109744
Test: atest ListViewCaptureHelperTest RecyclerViewCaptureHelperTest \
      ScrollViewCaptureHelperTest WebViewCaptureHelperTest
Change-Id: Ia533d38238d2a0e0f44358d2033394ad1d70487f
2021-09-22 12:36:30 -04:00
Rhed Jao
b62f02cb14 Fix an IllegalStateException in the OverlayConfigParser
The issue could be reproduced when the device defined an
overlay configuration file and an overlay package which
was in the configuration file also declared the required
system property in its manifest. The device works fine when
the required system property matches the corresponding
value on the device. But an IllegalStateException was thrown
from the system if it didn't match.

The root cause is that the package parser fails to parse the
overlay package if the required system property in the manifest
does not match the corresponding value on the device. It resulted
in the OverlayConfigParser could not find the package present
in the partition and throws the exception.

To resolve this issue, this CL skips the overlay configuration
if the package not found was caused by the system property
conditionon on the device.

Bug: 193422327
Test: atest OverlayConfigTest
Change-Id: I5650d796d92e3c4825b0d035e8e3b18f36d4cb47
2021-09-22 17:15:35 +08:00
TreeHugger Robot
d50fbe5665 Merge "Check custom component names before aggregating BatteryUsageStats snapshots" into sc-qpr1-dev am: 0ef5152b17 am: 4ff921f559
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15872124

Change-Id: If46ae1934feff590ce5202a25765f5eac9bfea41
2021-09-20 20:56:15 +00:00
TreeHugger Robot
4ff921f559 Merge "Check custom component names before aggregating BatteryUsageStats snapshots" into sc-qpr1-dev am: 0ef5152b17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15872124

Change-Id: Ib40da10e9db2ee290e1c65681e25862b0c6b7e35
2021-09-20 20:51:11 +00:00
Dmitri Plotnikov
0c561475c3 Check custom component names before aggregating BatteryUsageStats snapshots
If the lists of custom power components do not match, a crash will occur.
Instead of causing a crash, simply skip incompatible snapshots.

Bug: 196040329
Bug: 200511361
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest

Change-Id: I87ba605371a5f3119dcff33f6109e94ee46ab57d
(cherry picked from commit a1ea9ecd56)
2021-09-20 18:35:09 +00:00
Dmitri Plotnikov
c423ecc6c8 Drop per-app measured energy when an OTA changes the set of energy components am: 50348e3120 am: e4cc934175
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15857253

Change-Id: I8a243b171449a5e297ff9fffe844e873f90a76f3
2021-09-18 04:07:22 +00:00
Dmitri Plotnikov
e4cc934175 Drop per-app measured energy when an OTA changes the set of energy components am: 50348e3120
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15857253

Change-Id: I509be3ae6643864524529c06a61229c11b0ae008
2021-09-18 03:53:48 +00:00
TreeHugger Robot
f8a759f254 Merge "Preserve invocation order in RemoteInputConnection" 2021-09-18 02:49:46 +00:00
Dmitri Plotnikov
50348e3120 Drop per-app measured energy when an OTA changes the set of energy components
Bug: 200123115
Test: atest BatteryStatsTests
Change-Id: I750a5c9fa3faa9757625b2d2494df1484b68016d
(cherry picked from commit 9cb960304e)
2021-09-17 23:10:56 +00:00
Dmitri Plotnikov
0a426db7f0 Merge "Drop per-app measured energy when an OTA changes the set of energy components" 2021-09-17 23:10:03 +00:00
Varun Shah
777d87f91b Dismiss the suspend dialog if conditions have been modified.
Whenever suspension conditions change, if there is a user-visible
suspension-related dialog, dismiss it to ensure the user is never
looking at stale information.

Bug: 169137795
Test: atest SuspendPackagesBroadcastTest#sendPackagesSuspendModifiedForUser
Test: manual (steps below)
-enable EBS, tap on suspended app to see dialog
-enable Focus mode, ensure dialog is dismissed
-tap on suspended app again to see relevent dialog,
 disable Focus mode, ensure dialog is dismissed
-tap on suspended app again to see relevant dialog,
 disable EBS, ensure dialog is dismissed correctly
-can permute enable/disable steps to further verify

Change-Id: Ib1650f910f7441498424ab4bc92185ce432ac405
(cherry picked from commit 25e73a8b9e)
2021-09-17 22:35:26 +00:00
Dmitri Plotnikov
9cb960304e Drop per-app measured energy when an OTA changes the set of energy components
Bug: 200123115
Test: atest BatteryStatsTests
Change-Id: I750a5c9fa3faa9757625b2d2494df1484b68016d
2021-09-17 13:04:13 -07:00
Bernardo Rufino
3cd2231fed Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119 am: 5a2619c678 am: 2e3c6e5724
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I49e47a24a5aacc746d9e9e3e67cad42c75a38b16
2021-09-17 15:56:07 +00:00
Bernardo Rufino
2e3c6e5724 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119 am: 5a2619c678
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I0665dc366b5dd14ddacc61ad882770f36ff79456
2021-09-17 15:43:59 +00:00
Bernardo Rufino
5a2619c678 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I9a03f509116603c2286b2c385af4587bd8dd9b09
2021-09-17 15:29:37 +00:00
Bernardo Rufino
00d9e5301e Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I92fe8e94c677f79951994d03c6cae6071f31592c
2021-09-17 15:29:36 +00:00
Bernardo Rufino
d9ba2df119 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev 2021-09-17 15:15:48 +00:00