summaryrefslogtreecommitdiff
path: root/core/tests
AgeCommit message (Collapse)Author
2022-05-05Include saved battery history chunks into BatteryUsageStats parcelDmitri Plotnikov
Bug: 209297031 Test: Test: atest FrameworksCoreTests:BatteryUsageStatsTest FrameworksCoreTests:BatteryUsageStatsProviderTest Merged-In: I369d863b6f6fd488030aa031cc465bef6ce99ab8 Change-Id: Ifc70a49b731b5510e7bcd049e0c12d9ac7f68f44
2022-03-15Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: Idfdd94e902f656ac65a2a75dfdd199f6f85ba472
2022-02-25Associate SystemUiContext with DisplayContentCharles Chen
Before this CL, SystemUiContexts were fixed to the Display metrics when the SystemUiContexts were created. It is the same mechanism as DisplayContext but applies to SystemUiContexts unexpectedly. This CL makes SystemUiContexts associate with DisplayContent with the corresponding display ID. In this way, SystemUiContext would receive updates when there is a Display property change. Bug: 220022170 Bug: 194262507 Bug: 191064581 Bug: 205859784 Test: atest InputMethodMenuControllerTest WindowContextControllerTest Test: atest NexusLauncherTests Change-Id: I64a1614f32d097785915f6105b1813a929e0fe32 (cherry picked from commit 46ffd51d0723ad18b82d1093814ed7995996c8b9)
2021-12-22Merge s-mpr-2021-12-05Eric Arseneau
Change-Id: Ic2889f5eb531008340529eadc36ec8efc62b1984
2021-09-23DisplayManagerGlobal: fix native refresh rate callback registrationAdy Abraham
When AChoreographer is the only callback registered with DisplayManagerGlobal and there are no other display listeners, DisplayManagerGlobal incorrectly skips callback registration with DMS. Bug: 193945763 Test: atest DisplayManagerGlobalTest Change-Id: I4b737fa0a91541fe331edcf3454724200e2db971 (cherry picked from commit 0ee31107edadae1842adc9ec1c15492bfe9ea52f) CRs-Fixed: 2987744
2021-09-20Check custom component names before aggregating BatteryUsageStats snapshotsDmitri Plotnikov
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 a1ea9ecd56fce8bb84fc673650b6be7282ea0e99)
2021-09-17Drop per-app measured energy when an OTA changes the set of energy componentsDmitri Plotnikov
Bug: 200123115 Test: atest BatteryStatsTests Change-Id: I750a5c9fa3faa9757625b2d2494df1484b68016d (cherry picked from commit 9cb960304e6a399507b32ad3ed98d95af15cda27)
2021-09-15Merge "[RESTRICT AUTOMERGE] Send DA's config directly when attaching to DA" ↵Charles Chen
into sc-qpr1-dev
2021-09-14Merge "Ensure package context used by System UI has a valid userId." into ↵TreeHugger Robot
sc-qpr1-dev
2021-09-14Ensure package context used by System UI has a valid userId.Jeff DeCew
Fixes: 189924598 Bug: 194356170 Test: atest SystemUITests Test: atest android.service.notification.StatusBarNotificationTest#testGetPackageContext_worksWithUserAll Change-Id: Ic43a0301cb62ab27e276c2938012a27c3a9a6fff
2021-09-14[RESTRICT AUTOMERGE] Send DA's config directly when attaching to DACharles Chen
WindowContext relies on WindowTokenClient#onConfigurationChanged after calling WMS#attachWindowContextToDisplayArea. However, it took some time to wait for onConfigurationChanged callback from the server side so that we may get a stale value right after creating WindowContext. This confuses developers especially when the foreground activity is in size compat mode or freeform because the process config is overridden by activity's config. This CL makes #attachWindowContextToDisplayArea return DA's configuration and applies to WindowContext direcly. It also benefits WindowProviderService because it can obtain DA's configuration before onCreate() based on [1] and this CL. Bug: 190019118 Bug: 190745506 Bug: 198298520 Test: manual - 1. launch an Activity in size compat mode 2. create a WindowContext and verify if WindowMetrics matches DA bounds. Test: atest WindowContextTest WindowContextTests Test: atest WindowContextControllerTest ContextGetDisplayTest [1]: dd4a748af05851356b5dbd90fb42f503905370bb Change-Id: I8dd3987b731662502bc01e9d2ed67e718ada5f46
2021-09-10Merge changes I0fc3b7ae,I712e6d6b into sc-qpr1-devJeff DeCew
* changes: Reduce the color contrast requirements for the emphasized action button fill color. Refactor the color span code inside Notification.java and add tests.
2021-09-09Reduce the color contrast requirements for the emphasized action button fill ↵Jeff DeCew
color. This reduces the contrast requirement between the notification background and the button fill from 3:1 to 1.3:1 Fixes: 196393060 Test: manual testing using the go/notify2-apk and the CallStyle color customizer Test: android.app.NotificationTest Change-Id: I0fc3b7ae1ede7afd28974c59fa2a58d7fea2e9de
2021-09-09Refactor the color span code inside Notification.java and add tests.Jeff DeCew
* This makes it easy to reduce the contrast requirement between the notification background and the button fill in another review. * This also fixes a bug where partial-length color spans within the emphasized buttons would be contrast-adjusted only with the notification background color rather than the button fill color. Bug: 196393060 Fixes: 197572220 Test: manual testing using the go/notify2-apk and the CallStyle color customizer Test: android.app.NotificationTest Change-Id: I712e6d6b2da1de89afeacda7bd2fc4ad24632811
2021-09-07Ref count isolated uid usage in BatteryStatsMichael Wachenschwanz
Wakelock tracking in BatteryStats relies on the the isolated uid map when tracking wakelocks from isolated uids. The map needs to keep the isolated uid while it still has a wakelock. Bug: 194414351 Test: atest BatteryStatsNoteTest Change-Id: I5e51f5f90191829d12fb080169520d9827b9906c (cherry picked from commit 83c0928c34c2ce6d82bd877520cdd6c565947e25) Merged-In: I5e51f5f90191829d12fb080169520d9827b9906c
2021-09-03Merge "Filter Alias which points non-existing font family name" into sc-qpr1-devTreeHugger Robot
2021-08-27DisplayManagerGlobal: fix native refresh rate callback registrationAdy Abraham
When AChoreographer is the only callback registered with DisplayManagerGlobal and there are no other display listeners, DisplayManagerGlobal incorrectly skips callback registration with DMS. Bug: 193945763 Test: atest DisplayManagerGlobalTest Change-Id: I4b737fa0a91541fe331edcf3454724200e2db971
2021-08-26Filter Alias which points non-existing font family nameSeigo Nonaka
The FontFamily will be removed if none of font files exist on the device. Bug: 192479819 Test: atest FontListParserTest Change-Id: I36f6476fe37bc04ec8737936747385c63908d651 (cherry picked from commit 691cfe8818513e576300cdb963a65341984659c4)
2021-08-16Use tertiary accent color for expander with unread count.Jeff DeCew
Fixes: 196586577 Test: visual inspection Test: atest android.app.NotificationTest Change-Id: I09b3999ad1c51615fbf7c8027dc65e6750721f18
2021-08-16Fix ContrastColorUtil.findContrastColorAgainstDark to return the valid colorJeff DeCew
Fixes: 196600502 Test: atest ContrastColorUtilTest Change-Id: I590be0ba30c03e867bf08558483239818b3aff82
2021-08-13Merge "Revert "Use BinderDeathDispatcher for alarm listeners"" into ↵Treehugger Robot
s-keystone-qcom-dev
2021-08-11Merge SP1A.210811.001Brian Orr
Change-Id: I5aa7cf27a3a3cc16830c9947a826e30a0da481c4
2021-08-06Merge SP1A.210803.001Scott Lobdell
Change-Id: I09253f8614e9ee85a59460f3ef25f17dd98cac80
2021-08-06Handle empty <cloud-backup> section in android:dataExtractionRulesRuslan Tkhakokhov
Currently the <cloud-backup> section in android:dataExtractionRules is ignored unless it contains rules. Instead, we should interpret it as 'everything other than cache and no-backup dirs is eligible for cloud backup'. Bug: 195095045 Test: 1. atest BackupEligibilityHostSideTest 2. Use a test app with empty <cloud-backup> section to manually test: 2.1. Empty section - everything is backed up 2.2. Empty section but "disableIfNoEncryptionCapabilitites" set to "true" - data only backed up if the transport supports encryption. Change-Id: Ic8066721a46bda688f9211c51a0f2497e9caf93b
2021-08-04Revert "Use BinderDeathDispatcher for alarm listeners"Suprabh Shukla
This reverts commit 715ecc2bac07696548bfb56b0cc6a5cf9becee4e. Reason for revert: Causes IAlarmListener objects to leak: b/189091551 CRs-Fixed: 3007490 Change-Id: I9008db537affb4041be36905c317bdcb5368edc9 Merged-In: I390d9bba37a4040b7e789e0ae04f9980fbed5c12 (cherry picked from commit 616e234464e25449bf73d7b7a8016b9d32813f26)
2021-07-29Freezer: fix exception when parsing /proc/locksLi Li
The original code is based on /proc/locks manpage. Unfortunately, that manpage is never correctly updated to include the new field for blocked locks. The new code detects the extra field. As StringTokenizer is too heavy, ProcFileReader is used for better performance. Bug: 194756340 Test: FrameworksUtilTests com.android.internal.util.ProcFileReaderTest Test: FrameworksCoreTests com.android.internal.os.ProcLocksReaderTest Test: No /proc/locks parsing exception with blocked locks Change-Id: I4c9763f9d3091f7d84d2e4b672d7e5cb78b33f59
2021-07-27Merge SP1A.210723.002Scott Lobdell
Change-Id: I220cdfc5cb9db40162fd33f400a54591018d54cf
2021-07-23Merge SP1A.210715.002Scott Lobdell
Change-Id: I65e2b7db097927b87c9c4023015c754033c62086
2021-07-22Merge changes from topic "native_hint" into sc-devTreeHugger Robot
* changes: Implement java PerformanceHintManager on top of native Switch HWUI to use native performance hint API Implement native PerformanceHint API
2021-07-22Merge "Fix validation crash for nextPageToken." into sc-devTerry Wang
2021-07-22Implement java PerformanceHintManager on top of nativeBo Liu
Note some exceptions became silence errors in this conversion. Test: None Bug: 194204196 Change-Id: Ia3cc7f2396f2e307a23b40b3f104a2fa90352196
2021-07-22Mark an ActivityThreadTest as flakyAndrii Kulian
Bug: 194242735 Test: Build Change-Id: I2452db8523438de4d06c938c3c3fa1d8a9aa0f4e Merged-In: I2452db8523438de4d06c938c3c3fa1d8a9aa0f4e (cherry picked from commit 0b6ea59fe04899b0d7c2a8c623479f3561129bba)
2021-07-21Fix validation crash for nextPageToken.Terry Wang
We are caching nextPageToken in query(), and validate it in getNextPage(). But when it reach to the end, the token will be changed to 0. And it will crash if user is trying to fetch next page since 0 is not cached and won't passed the validation. This change fix the issue. Without it, users maybe crashed if they are trying to retrieve all documents in all result pages. Bug: 187972715 Test: AppSearchSessionUnitTest Change-Id: Ia95feb52f2a37348e11afdf0b320c61bfce22d40
2021-07-21Merge "Allow GenericDocument accept a String property longer than 20_000." ↵TreeHugger Robot
into sc-dev
2021-07-20Merge "Allow ConnectivityManagerTest to access Manage Test Network" into ↵Treehugger Robot
s-keystone-qcom-dev
2021-07-20Fix potential memory leak of FrameTrackerAhan Wu
If begin and end invocations are at the same frame, the end vsync id will be smaller than the begin vsync id, results in zero size jank info array, the finish call will be missed as well, a leak happens. Bug: 192140966 Test: atest FrameTrackerTest InteractionJankMonitorTest Change-Id: I388558e60bdb84ad248a9afabe7776c4e6e67c57
2021-07-20Allow ConnectivityManagerTest to access Manage Test NetworkSai Pavan Akhil Remella
Change-Id: If21e9e25254344d68d33e1d3529bdf7eff8dcd9d CRs-Fixed: 2985746
2021-07-16Allow GenericDocument accept a String property longer than 20_000.Terry Wang
This limit was removed from the AppSearch Jetpack API meaning that a client could construct a GenericDocument successfully, but then have a PutDocuments call fail when converting from androidx.appsearch.GenericDocument to android.appsearch.GenericDocument. Icing still has a total document size limit which is 16 MiB. The put call will fail if it trying to write such document. Bug: 192909904 Test: GenericDocumentTest Change-Id: I86f97acc3a8e0f1c25fadf597aed9f42a2c493eb
2021-07-16Merge "Fix BatteryStatsImplTest." into sc-devDmitri Plotnikov
2021-07-15Fix BatteryStatsImplTest.Dmitri Plotnikov
Bug: 180015146 Test: atest FrameworksCoreTests:BatteryStatsImplTest Change-Id: I6b43ca03ba816e12735ebd47d8cf61a6b1cee110
2021-07-13Fix BstatsCpuTimesValidationTest.testCpuFreqTimes_trackingDisabledDmitri Plotnikov
Bug: 192508837 Test: atest --rerun-until-failure 300 FrameworksCoreTests:com.android.internal.os.BstatsCpuTimesValidationTest#testCpuFreqTimes_trackingDisabled -- --abi x86_64 Change-Id: I0985d8e602f7a7b4fc619545828d6680fc6cf856
2021-07-08Merge "Add support for always_constrain_display_apis flag" into sc-devTom Natan
2021-07-06Add support for always_constrain_display_apis flagtomnatan
Bug: 191184114 Test: atest WmTests:SizeCompatTests Test: atest FrameworksCoreTests:ConstrainDisplayApisConfigTest Change-Id: Ifc0d48c838216603c00f4cc09d0df2fd145a53a6
2021-07-03Merge "Address race condition in procstate time tracking" into sc-devDmitri Plotnikov
2021-07-01Address race condition in procstate time trackingDmitri Plotnikov
The issue occurs when the application proc state changes rapidly, e.g. from FOREGROUND to BACKGROUND to CACHED. The original code would sometimes attribute the time slice to the wrong proc state. Bug: 192550308 Test: (on cuttlefish) atest --rerun-until-failure 300 FrameworksCoreTests:com.android.internal.os.BstatsCpuTimesValidationTest -- --abi x86_64 Change-Id: Ic22bbfa3aae701014fc016ec9e2d32b1c528d462
2021-07-01Merge "Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEvent" into sc-devTreeHugger Robot
2021-06-30Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEventSiarhei Vishniakou
This flag indicates that the event was modified or generated by an accessibility service. It allows apps to tell apart real hardware events, events that are injected (device id == -1), and events coming from accessibility (has flag is_accessibility_event). Events that have gone into accessibility, and got reinjected without being modified will not be distinguishable from real hardware events. In the next release, we will make FLAG_IS_ACCESSIBILITY_EVENT public api. Until then, applications will have to hard-code its value (0x800) to use it. The value is the same for both KeyEvents and MotionEvents for convenience. Bug: 175069843 Bug: 152399927 Test: atest VerifiedMotionEventTest VerifiedKeyEventTest Test: atest AccessibilityGestureDispatchTest Test: atest inputflinger_tests libinput_tests GamepadWithAccessibilityTest Change-Id: I38ac2ab8e19e32cad927742c623f14f43ea0c588
2021-06-30Merge "Fix boot time BatteryStats reset failure" into sc-devDmitri Plotnikov
2021-06-30Fix boot time BatteryStats reset failureDmitri Plotnikov
We need some services to create a battery stats snapshot captured at the time of battery reset. The issue is that if the battery stats reset occurs during boot, before the system is ready, those services may not be prepared. The fix is to postpone battery stats reset until after the system server is ready. Also, we will now reset the stats if battery got partially charged and discharged repeatedly without ever reaching the full charge. This will prevent battery sessions from going on forever and overflowing internal data structures. This CL partially reverts https://cs.android.com/android/_/android/platform/frameworks/base/+/0ed84f12639c4cb7ba6623dc232ae31602827bae Bug: 192252233 Test: run PowerOnOffTest#testPowerOnOff repeatedly Change-Id: Ib486e4caeeac7c933288c3a1055259c05f45c6c8
2021-06-29Merge changes from topic "revert-15058002-SNQUARIDWJ" into sc-devPaul Hobbs
* changes: Revert^2 "Deprecate Context#createApplicationContext" Revert "Version LoadedApk cache using base code path" Revert "Apply overlay changes with config change"