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
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
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
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
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
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
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
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
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