Commit Graph

6992 Commits

Author SHA1 Message Date
TreeHugger Robot
7e3a4dc30b Merge "Fix BstatsCpuTimesValidationTest.testCpuFreqTimes_trackingDisabled" into sc-dev am: f7aca0513d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15277354

Change-Id: I3e1ff9bea9b3bbaebb6988e0ed5321a79627e19e
2021-07-14 01:50:07 +00:00
Dmitri Plotnikov
682450ec2d Fix BstatsCpuTimesValidationTest.testCpuFreqTimes_trackingDisabled
Bug: 192508837
Test: atest --rerun-until-failure 300 FrameworksCoreTests:com.android.internal.os.BstatsCpuTimesValidationTest#testCpuFreqTimes_trackingDisabled -- --abi x86_64
Change-Id: I0985d8e602f7a7b4fc619545828d6680fc6cf856
2021-07-13 16:13:29 -07:00
Tom Natan
887c796529 Merge "Add support for always_constrain_display_apis flag" into sc-dev am: 28a6e9f973
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15216092

Change-Id: I9df325234e3e01b59c0a17fc8109f1c90182613d
2021-07-08 10:30:09 +00:00
Tom Natan
28a6e9f973 Merge "Add support for always_constrain_display_apis flag" into sc-dev 2021-07-08 10:25:09 +00:00
tomnatan
f332106222 Add support for always_constrain_display_apis flag
Bug: 191184114
Test: atest WmTests:SizeCompatTests
Test: atest FrameworksCoreTests:ConstrainDisplayApisConfigTest
Change-Id: Ifc0d48c838216603c00f4cc09d0df2fd145a53a6
2021-07-06 15:18:50 +00:00
Remi NGUYEN VAN
89c3a316fc Merge "Move BitUtils, RingBuffer test to coretests" am: 35362a9dc1 am: e12829fdea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1754896

Change-Id: Id2b8a4720a14a433788589bba2c216e071374012
2021-07-05 05:31:16 +00:00
Remi NGUYEN VAN
35362a9dc1 Merge "Move BitUtils, RingBuffer test to coretests" 2021-07-05 05:05:34 +00:00
Dmitri Plotnikov
ee0373e491 Merge "Address race condition in procstate time tracking" into sc-dev am: b1f548e3e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15177890

Change-Id: I20670af72e0fe93f4d86c08c72e722ec4595bd67
2021-07-03 00:27:32 +00:00
Dmitri Plotnikov
b1f548e3e4 Merge "Address race condition in procstate time tracking" into sc-dev 2021-07-03 00:14:15 +00:00
Remi NGUYEN VAN
aaa5249e58 Move BitUtils, RingBuffer test to coretests
The utilities are part of com.android.internal.util, but were
historically tested as part of the services.net tests. They were then
mistakenly moved to packages/modules/Connectivity with the rest of the
networking code, but actually belong in coretests.

Bug: 187935317
Test: atest FrameworksCoreTests
Change-Id: Ia4179ac3e25170e46b47133be0f5d4f1b24caf3d
2021-07-02 16:21:56 +09:00
Dmitri Plotnikov
dc3a78354e Address race condition in procstate time tracking
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-01 22:04:28 -07:00
TreeHugger Robot
38291a092b Merge "Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEvent" into sc-dev am: 24b5ca6b4b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15021525

Change-Id: I782931136fede858976a3b625c28bcd1b89e8f72
2021-07-01 03:42:00 +00:00
TreeHugger Robot
24b5ca6b4b Merge "Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEvent" into sc-dev 2021-07-01 03:37:28 +00:00
Siarhei Vishniakou
b42785efdf Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEvent
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-30 21:07:38 +00:00
Dmitri Plotnikov
bea4bac02c Merge "Fix boot time BatteryStats reset failure" into sc-dev am: ebf77ebc51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15128655

Change-Id: I4681840e210a25d27ecb03ff30da088721f2fc8b
2021-06-30 19:12:17 +00:00
Dmitri Plotnikov
ebf77ebc51 Merge "Fix boot time BatteryStats reset failure" into sc-dev 2021-06-30 18:53:20 +00:00
Dmitri Plotnikov
bcd46f1ed4 Fix boot time BatteryStats reset failure
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 0ed84f1263

Bug: 192252233
Test: run PowerOnOffTest#testPowerOnOff repeatedly
Change-Id: Ib486e4caeeac7c933288c3a1055259c05f45c6c8
2021-06-30 17:07:58 +00:00
Paul Hobbs
3053bd7ab0 Merge changes from topic "revert-15058002-SNQUARIDWJ" into sc-dev am: 8d440c0566
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15144638

Change-Id: I0612c824b412153bb571e5ff1f47d707269a05a6
2021-06-29 20:54:31 +00:00
Paul Hobbs
8d440c0566 Merge changes from topic "revert-15058002-SNQUARIDWJ" into sc-dev
* changes:
  Revert^2 "Deprecate Context#createApplicationContext"
  Revert "Version LoadedApk cache using base code path"
  Revert "Apply overlay changes with config change"
2021-06-29 20:36:15 +00:00
Paul Hobbs
214bf65c95 Revert "Version LoadedApk cache using base code path"
Revert submission 15058002

Reason for revert: Causes crash in com.android.cts.splitapp, breaks android.appsecurity.cts.SplitTests#testFeatureWithoutRestart_full.
Bug: 192242649

Reverted Changes:
Icf81845da:Apply overlay changes with config change
Iea54abf38:Version LoadedApk cache using base code path
I986563142:Revert "Deprecate Context#createApplicationContext...

Change-Id: Iefd431eaddccab8ccbf33bdd701516e34118615f
2021-06-29 19:54:32 +00:00
Kohsuke Yatoh
0a93841c46 Merge "Extract flag font from NotoColorEmoji" into sc-dev am: 80a8cf86c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14970179

Change-Id: If11584176cfc18d8580dc021fabf6fb8445b1cdc
2021-06-29 00:56:10 +00:00
Kohsuke Yatoh
80a8cf86c0 Merge "Extract flag font from NotoColorEmoji" into sc-dev 2021-06-29 00:40:27 +00:00
Ryan Mitchell
2f0946ab86 Merge changes Icf81845d,Iea54abf3,I98656314 into sc-dev am: 5a532f6eed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15058002

Change-Id: Ia5df591c3d0fe5e8fe2bd82c62f527bd9f623391
2021-06-27 06:37:59 +00:00
Ryan Mitchell
5a532f6eed Merge changes Icf81845d,Iea54abf3,I98656314 into sc-dev
* changes:
  Apply overlay changes with config change
  Version LoadedApk cache using base code path
  Revert "Deprecate Context#createApplicationContext"
2021-06-27 06:27:58 +00:00
Siim Sammul
75d6665597 Fix process source propagation for binder calls stats settings so that
it is correctly reported in the pushed atom BinderLatencyReported.

This is a direct cherrypick from sc-dev: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/15054863

Bug: 180584913
Test: unit test
Change-Id: Ifbdd96c73276546fb2a05213f71e1de088e1fe1e
Merged-In: Ifbdd96c73276546fb2a05213f71e1de088e1fe1e
2021-06-25 16:28:12 +00:00
Siim Sammul
07aae99572 Merge "Fix process source propagation for binder calls stats settings so that it is correctly reported in the pushed atom BinderLatencyReported." into sc-dev am: fc7b373389
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15054863

Change-Id: I96717cda6045b2cb1f2e87b7bcdee8922e967bf9
2021-06-25 11:16:29 +00:00
Siim Sammul
fc7b373389 Merge "Fix process source propagation for binder calls stats settings so that it is correctly reported in the pushed atom BinderLatencyReported." into sc-dev 2021-06-25 11:07:53 +00:00
Siim Sammul
26e17305ff Merge "Collect binder latency data even when device is charging / device state is unknown." into sc-dev am: 764da8b1ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080830

Change-Id: I32ba75f264624570c4eff5b74db72e11a6f71fbf
2021-06-25 09:16:41 +00:00
Siim Sammul
764da8b1ab Merge "Collect binder latency data even when device is charging / device state is unknown." into sc-dev 2021-06-25 09:03:12 +00:00
Siim Sammul
f64b4c5dc9 Fix process source propagation for binder calls stats settings so that
it is correctly reported in the pushed atom BinderLatencyReported.

Bug: 180584913
Test: unit test
Change-Id: Ifbdd96c73276546fb2a05213f71e1de088e1fe1e
2021-06-25 09:02:26 +00:00
Seigo Nonaka
458f1dd71c Extract flag font from NotoColorEmoji
Bug: 188926991
Bug: 188779144
Test: m fontchain_lint
Change-Id: Ie807e31abb407f5b58665d4d2941bc75186d5c42
Merged-In: Ie807e31abb407f5b58665d4d2941bc75186d5c42
2021-06-24 18:46:08 +00:00
TreeHugger Robot
b474cc0757 Merge "Fix SystemVibrator constant support checks on device without vibrator" into sc-dev am: a02615b9cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15054858

Change-Id: I4805c35f08126378eed3e1ccdff90819ce7ac110
2021-06-24 14:26:12 +00:00
Lais Andrade
efc9cc93be Fix SystemVibrator constant support checks on device without vibrator
Fix the implementation of SystemVibrator to return always no support to
all effect and primitive constants on devices with no vibrator.

Fix: 191414125
Test: FrameworksCoreTests:VibratorTest
Change-Id: I0fd9e27d6e2890df9ee206029488ea70ff50712d
2021-06-24 12:33:40 +01:00
Alexander Dorokhine
9f4899f725 Merge "Sync framework from jetpack." into sc-dev am: 635e511b0e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15083411

Change-Id: I224f1595d746a486a947634967e3c34cb484903f
2021-06-24 02:20:02 +00:00
Alexander Dorokhine
9a8625df25 Sync framework from jetpack.
Changes included:
* 131d852: Remove usages of hidden APIs in the CTS tests.
* c984c24: Change AppSearchSchema and PropertyConfig #toString()

Bug: 146218515
Bug: 179680545
Test: Presubmit
Change-Id: Ibcef982cfea95ede2ae8e6075a052a83b44298c4
2021-06-23 13:14:01 -07:00
Alexander Dorokhine
2ec2f83885 Merge "Update framework from jetpack." into sc-dev am: 4e229f4471
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15066873

Change-Id: I69f16c8edb6bdf868ef81d30969af355251509ab
2021-06-23 17:17:36 +00:00
Siim Sammul
421a6874ee Collect binder latency data even when device is charging / device state
is unknown.

Test: unit test
Bug: 180584913
Change-Id: I2e4234b764e4341cea54172309d1f804a7cd5a88
2021-06-23 15:59:44 +00:00
Ryan Mitchell
25360a2f65 Version LoadedApk cache using base code path
When a context is requested through Context#createApplicationContext,
the underlying LoadedApk cached in ActivityThread#mResourcePackages is
updated using the ApplicationInfo passed in. This creates unexpected
problems when using APIs that expect to be able to read resources from
a previous version of a package after that package has been updated.

With this change, contexts requested through
Context#createPackageContext and Context#createApplicationContext will
will have an underlying LoadedAPK that is tied to the version of the
package represented by the ApplicationInfo. If createPackageContext
is invoked before a package updates and then after a package updates,
the two contexts will have different underlying LoaddApks.

The ActivityThread#mPackages and ActivityThread#mResourcePackages now
only hold LoadedAPKs of that were created using ApplicationInfos that
were sent to this process from system_server in order to run the
application. Whenever a newer version of  an ApplicationInfo is
delivered from system_server for one of these packages, the previously
cached LoadedAPK will be updated using the new ApplicationInfo. This
will usually be because of an overlay change or "don't kill" package
upgrade.

Bug: 188059515
Test: atest FrameworksCoreTests:ContextTest
Change-Id: Iea54abf38449c9d8ab9dae16d36d95cbb4d7d8b0
2021-06-22 22:31:20 -07:00
Alexander Dorokhine
bb978dfe38 Update framework from jetpack.
Changes included:
* 79f2ffe: Fixes required for export.
* e1ca63a: Implement empty schema shouldn't have a version number.
* 8b76be4: Refactor VisibilityStore from a no-op implementation into an interface.
* 47ba533: Remove the max repeatable length limit for GenericDocument
* 52ca287: Add GetSchemaResponse cts test.
* 56585f5: Change PutDocumentsRequestTest to be a cts test.

Bug: 183050495
Bug: 180058203
Bug: 191592792
Bug: 189161227
Bug: 183239766
Test: Presubmit
Change-Id: I30f51a18d697d3a5e43d2c63549ab19a36bbe99e
2021-06-22 12:32:15 -07:00
Alexander Dorokhine
04eb99cc0c Merge "Update framework from jetpack." into sc-dev am: 27b63bb150
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15031318

Change-Id: I6dd4fbde7820889eae137d0e160f0e2538590f7a
2021-06-22 17:44:53 +00:00
Alexander Dorokhine
27b63bb150 Merge "Update framework from jetpack." into sc-dev 2021-06-22 17:30:26 +00:00
TreeHugger Robot
c536559f00 Merge "Split long vibration composition using HAL limits" into sc-dev am: 55a8db6450
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807584

Change-Id: I97b1b2584a05db04ccaf25fe2cc63807e451c10b
2021-06-22 16:30:22 +00:00
TreeHugger Robot
55a8db6450 Merge "Split long vibration composition using HAL limits" into sc-dev 2021-06-22 16:08:22 +00:00
Lais Andrade
a1167c2a06 Split long vibration composition using HAL limits
Load composition and pwle limits from the HAL and apply them on
VibrationThread to split long vibrations in multiple calls.

This ensures that long vibration will be performed by the HAL.

Bug: 188431691
Fix: 183517124
Test: VibrationThreadTest & VibrationInfoTest
Change-Id: I09a04c7b1de331320d453899f59b01e4bbb42ac3
2021-06-22 15:36:23 +01:00
Lee Shombert
e917eb9add Merge "Modify PropertyInvalidatedCache" into sc-dev am: c1ad465c8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14922569

Change-Id: I58c1a58e68ff05ac3d792974de8a9dcba42245e4
2021-06-22 05:23:34 +00:00
Lee Shombert
c1ad465c8a Merge "Modify PropertyInvalidatedCache" into sc-dev 2021-06-21 23:03:18 +00:00
Lee Shombert
659dcc86a3 Modify PropertyInvalidatedCache
Bug: 186778818

This makes two changes to PropertyInvalidatedCache.

1. disableLocal() now disables all current and future caches that use
   the same name (not the necessarily the same property) , in the
   local process.  Previously, disableLocal() only disabled a single
   cache instance, but the intent was always to disable all instances
   of the same cache in the process.

   disableInstance() is available with the old behavior.

2. A bypass() method has been added.  If bypass() returns true,
   query() will skip the cache and go straight to the binder call as
   though the cache had been disabled.  The default implementation
   always returns false.  Caches can override the implementation to
   avoid caching selected queries.

These changes specifically address the problem of caches that are
created dynamically and which should be disabled in the local
process.

A unit-test is added for PropertyInvalidatedCache.  This is not a
complete test because test processes are not allowed to set system
properties.  The unit-test will be improved in the future by modifying
PropertyInvalidatedCache to use an invalidation mechanism other than
system properties.

Manual test: boot a phone with a baseline build and with the build
under test and verified that the list of disabled caches is the same.
Use 'dumpsys cacheinfo' to get the cache status.

Test: atest
 * FrameworksServicesTests:UserManagerServiceCreateProfileTest

Change-Id: I9f604b872911290e4e3d8a58b3e28e328b2000a9
2021-06-21 13:49:29 -07:00
Dmitri Plotnikov
0c6fb4926e Merge "Reduce size of BatteryUsageStats Parcel" into sc-dev am: 8b22190dfd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15020275

Change-Id: Iaca25ed1dfb3626aba7dee19684cc9471f468ef1
2021-06-21 20:09:34 +00:00
Michael Wright
36336e0d37 Merge "Fix failed tests for ApplicationPackageManagerTest" am: 03a3eb4b3d am: 984dcc2c62
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1351251

Change-Id: If340225a9b4de291b5ad68e575c0c2fa4eba69b0
2021-06-21 13:14:33 +00:00
Michael Wright
03a3eb4b3d Merge "Fix failed tests for ApplicationPackageManagerTest" 2021-06-21 10:20:24 +00:00