The previous implementation of DeviceStateProviderImpl would report the
current device state as soon as a listener was registered leading to a
series of device state changes on boot as the state of the hardware
becomes known. This changes the implementation to await callbacks before
notifying the listener of a change in device state.
Fixes: 181671216
Test: atest DeviceStateProviderImplTest
Test: atest DeviceStateManagerServiceTest
Test: atest DeviceStateManagerGlobalTest
Change-Id: I3f133b6d7135b829b79c9f225ae52c71061faa3e
Track battery voltage along side the measured energy to calculate
battery charge consumption per EnergyConsumer. This better represents
a consumer's impact on battery. Also change numerous variable/method
names from energy units to charge units.
Bug: 180079165
Fixes: 173765509
Test: atest FrameworksCoreTests:com.android.internal.power.MeasuredEnergyStatsTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsNoteTest
Test: atest ScreenPowerCalculatorTest
Test: atest FrameworksServicesTests:com.android.server.am.MeasuredEnergySnapshotTest
Change-Id: I5e727cebf1252cc7b1645a53282de2281c68ae85
This is the re-merging of ag/12923546 (where most of that original
message is posted below), which includes various bug fixes.
Slow prefetch requests would block user interactive requests, creating
noticeable sluggishness and unresponsiveness in accessibility services,
especially on the web.
Let's make it so a user interactive requests stops prefetching.
We can't interrupt an API call, but we can stop in between API calls.
On the service side, we have to separate the prefetch callbacks from the
find callback. And we have to make it asynchronous. It does dispatch
intothe main thread, so the AccessibilityCache can remain single threaded.
When the calls are interrupted on the application side,
returnPendingFindAccessibilityNodeInfosInPrefetch checks the find
requests that are waiting in the queue, to see if they can be addressed
by the prefetch results. If they can be, we don't have to call into
potentially non-performant application code. We don't check requests
that have differing prefetch flags (FLAG_INCLUDE_NOT_IMPORTANT_VIEWS,
FLAG_REPORT_VIEW_IDS) that would result in different caches.
We also make mPendingFindNodeByIdMessages thread-safe and ensure in
ActionReplacingCallback we don't return null results. Merged
ag/13246536, ag/13256330
Messages should be added to PrivateHandler and
mPendingFindNodeIdMessages at the same time to avoid a race condition
where we try removing a message from the handler before it's actually
enqueued. This was causing double recycling
UiAutomation does't require a main thread, so getMainLooper may
return null. In this case, instead of posting to the main looper,
we cache nodes on the binder thread (which is our ultimate goal).
Added tests to verify AccessibilityInteractionController interactions
Test: atest AccessibilityInteractionControllerNodeRequestsTest,
FrameworksServicesTests FrameworksCoreTests, CtsAccessibility, Manual
testing
Bug: b/176195360, b/175877007, b/175884343, b/178726546, b/175832139,
b/176195505, b/181701570
Change-Id: I66902f995f33f0236003faa439925ec72fcf6952
As part of an upcoming feature, we're anticipating the need to match
arbitrary byte sequences, such as Bluetooth UUIDs or MAC addresses,
so this change adds a new BytesMatcher similar in spirit to
the existing PatternMatcher.
It supports a reasonably compact serialization format which can be
used to transport a server-pushed deny-list. The choice to support
both "accept" and "reject" rules in an ordered list means that very
complex matching rules can be expressed efficiently.
Bug: 181812624
Test: atest FrameworksCoreTests:android.os.BytesMatcherTest
Change-Id: I55193051354278abaef8bef51413c632b07c7177
Add a new usage event to UsageStats when a component in a package is
used (content provider binding, explicit broadcast, activity resume)
and it is considered to be important usage.
The follow-up CL will handle the service binding case as it is a little
complicated due to job bindings.
Bug: 175829712
Test: adb shell dumpsys usagestats <package-name>
Test: atest UserUsageStatsServiceTest
Change-Id: I1f2967dcf5999a8f0affea94bce4c0873a04e022
BatteryExternalStatsWorker will now include measured Cpu Cluster energy
data (if available) when triggering a Cpu update in BatteryStatsImpl.
Using the per cluster per uid duration read from the kernel, the
measured energy can be attributed per cluster and then totaled to get
the Cpu energy consumption of a uid since the last update.
Fixes: 180079165
Test: manual ("adb shell dumpsys batterystats --measured-energy" on an
unplugged PowerStatsHal2.0 enabled device)
Change-Id: I0127bf61decdd5a9a5744e3352d5a3ff3a5fa2fe
This reverts commit f94c85b130.
Reason for revert: Causing app crashes and runtime restarts in tests. See b/181701570 for details.
Change-Id: I2b5f7b80f07f5d8f564acdf20fcdb1e9b5b9da19
Add list of supported vibrator capabilities to information reported to
dumpsys, and fix Vibration to log original effect before any change is
applied by the local service.
Bug: 180924179
Test: manual
Change-Id: I97201771d3ee211dc2f4b6f9eac50b5b150affc0
In order to support auto translation, we need to give information to
content capture service to let the app can use this information to
find the Activity which needed to be translated.
It's not safe to provide an activity token to the client app directly
even if it is a privilege app. They can use this activity token to
access many activity/windows related functions. We create a new token
for use for content capture and translation. This token will be used
get the target Activity for translation new APIs.
This change focuses on the Content capture API change, the API change
about translation will be done in the next change,
Bug: 177789967
Test: manual. Make sure cc service can get the information.
Test: atest android.view.contentcapture.ContentCaptureContextTest
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ife8096a8bd1e71ce4e686d95043e347222ad7ee6
This is the re-merging of ag/12923546 (where most of that original
message is posted below), which includes various bug fixes.
Slow prefetch requests would block user interactive requests, creating
noticeable sluggishness and unresponsiveness in accessibility services,
especially on the web.
Let's make it so a user interactive requests stops prefetching.
We can't interrupt an API call, but we can stop in between API calls.
On the service side, we have to separate the prefetch callbacks from the
find callback. And we have to make it asynchronous. It does dispatch
intothe main thread, so the AccessibilityCache can remain single threaded.
When the calls are interrupted on the application side,
returnPendingFindAccessibilityNodeInfosInPrefetch checks the find
requests that are waiting in the queue, to see if they can be addressed
by the prefetch results. If they can be, we don't have to call into
potentially non-performant application code. We don't check requests
that have differing prefetch flags (FLAG_INCLUDE_NOT_IMPORTANT_VIEWS,
FLAG_REPORT_VIEW_IDS) that would result in different caches.
We also make mPendingFindNodeByIdMessages thread-safe and ensure in
ActionReplacingCallback we don't return null results. Merged
ag/13246536, ag/13256330
UiAutomation does't require a main thread, so getMainLooper may
return null. In this case, instead of posting to the main looper,
we cache nodes on the binder thread (which is our ultimate goal
once b/180957109 is fixed).
Added tests to verify AccessibilityInteractionController interactions
Test: atest AccessibilityInteractionControllerNodeRequestsTest,
FrameworksServicesTests FrameworksCoreTests, CtsAccessibility, Manual
testing
Bug: b/176195360, b/175877007, b/175884343, b/178726546, b/175832139,
b/176195505
Change-Id: I346a3f40c84c6697b8a1e1d84a636eada655b984
In order to move shortcuts from memory into AppSearch, we need to move
the bookkeeping states associated with ShortcutInfo into AppSearch as
well. This CL updates the schema to reflect the necessary chagnes.
Bug: 151359749
Test: atest ShortcutManagerTest1 ShortcutManagerTest2 ShortcutManagerTest3 ShortcutManagerTest4 ShortcutManagerTest5 ShortcutManagerTest6 ShortcutManagerTest7 ShortcutManagerTest8 ShortcutManagerTest9 ShortcutManagerTest10 ShortcutManagerTest11
Change-Id: Iaafaf6b81504b3f80c05b7f4a996b1b5b6beaeb7
state.
This:
1. Renames DeviceStateListener to DeviceStateCallback as there is more
than one method in the callback.
2. Adds a callback to DeviceStateCallback to notify clients about a
change in supported device states.
3. Adds a callback to DeviceStateCallback to notify clients about a
change in non-override state (the state of the device without
considering override requests).
4. Restructures the IDeviceStateManager callback interface to return a
DeviceStateInfo object on successful registration of the callback
instead of triggering callbacks after registation. This simplifies the
callback code paths.
Bug: 159401801
Bug: 154038218
Fixes: 179291575
Test: atest DeviceStateManagerServiceTest
Test: atest DeviceStateManagerGlobalTest
Test: atest DeviceStateInfoTest
Change-Id: I42841de3e19ec0161a8c7b18c5baac0f2c2548bf
* Ignore android:fullBackupContent for apps targeting Android S+ while
in D2D
* Update LocalTransport::getTransportFlags() to support
FLAG_DEVICE_TO_DEVICE_TRANSFER (required for CTS testing)
Bug: 180523564
Test: atest FullBackupRulesHostSideTest
Change-Id: I115c1c76f4b0d8b486cc9f146ef630fda3ff2a03
This class will be used by BatteryUsageStats
Bug: 180765532
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsHistoryTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsNoteTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsHistoryIteratorTest
Change-Id: Ic392bcdb6eb815afcc3cd882aa32dd4c78b6484f