Adds a rate limiter to the HintSession.sendHint API for safety, and
update tests to reflect this.
Bug: b/243973548
Test: atest PerformanceHintNativeTestCases
Test: atest FrameworksCoreTests:android.os.PerformanceHintManagerTest
Change-Id: Ic68683bacf7df3e11efc3d59689b5470c3fa4274
Prepare for windowless starting surface. Attemp to decouple the drawing
methods from window related handling.
Move most of snapshot drawing method together to a utility class
SnapshotDrawerUtils, so SystemBarBackgroundPainter now can shared for
shell and core.
Bug: 131727607
Bug: 257857570
Test: atest SnapshotDrawerUtilsTest StartingSurfaceDrawerTests
Test: hot launch an app, and verify snapshot starting window show up
without issue.
Test: cold launch app, verify icon style splash screen can show.
Change-Id: I4d2c04e41d375cf6c8711a60977b8f24dddd41c0
The crash was due to some old logic that was looking for near matches.
Now we only return exact matches, and let the interpolation deal with
near matches.
Add test to make sure it doesn't crash at any value passed in.
Test: atest FrameworksCoreTests:android.content.res.FontScaleConverterTest
Bug: b/260984829
Change-Id: Ic90d1c5b48862e4f78b90be5926c9ce6d468acf9
This is initially thought of in
go/vibration-effects-for-notifications-dd, and can be used whenever a
vibration pattern is needed to be extracted from a VibrationEffect. See
also: go/vibration-changes-for-notification-channels
Bug: 241732519
Test: unit tests
Change-Id: Ieccbe95d40e638dec23014cc18ba11c0b5754fd8
This test is broken because the app op change restarts the test process.
It's already tested in CTS and seems to be accidentally left over here.
Change-Id: If72b0c3f8928d8a912f54a69a1ceeb27a8ed404f
Non-linear font scaling is meant to improve readability at larger font
scales: larger fonts will scale up more slowly than smaller fonts, so we
don't get ridiculously huge fonts that don't fit on the screen.
The thinking here is that large fonts are already big enough to read,
but we still want to scale them slightly to preserve the visual
hierarchy when compared to smaller fonts.
The FontScaleConverter converts SP dimensions to DP, to be used in
TypedValue.applyDimension() which will affect most TextViews and font
sizes automatically.
For now, all the lookup tables are hardcoded. A follow-up CL will make
them configurable via XML. The hardcoded arrays also default to a linear
curve, as to not break any tests. The non-linear curve will come in a
follow-up CL, to make it easier to roll-back if requested.
Also included is some Javascript to generate the hardcoded arrays, which
can later be manually tweaked and optimized.
Test: unit, CTS, and manual:
1. Run `adb shell settings put system font_scale 2.0`
2. Check different apps to see if they are readable.
Bug: b/237558231
Change-Id: I17d67252bf31f55e57e1f3e8a0f638770e6d2cfd
Now that providers can report their status, we can use this to trigger
telephony fallback mode. This opens the door to more sophisticated
mechanisms for things like flight or tunnel detection. After all,
providers know how they work and what they can / cannot do, and may have
access to sensors and providers that the platform has not.
The new "provider reported" flight mode entry cannot replace the
"time_zone_detector"-level behavior entered via calls to
TimeZoneDetectorStrategy as provider status is new and optional;
providers are not required to report their status so it can be omitted.
Bug: 236624675
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Change-Id: I89fb889ba98b3ddedd271670db09f1bb9df95644
Add VirtualSensor, VirtualSensorEvent and a callback to notify the sensor owner for any changes in the registered sensor listeners.
The virtual device sensors will registered with the sensor framework as runtime sensors. They must remain valid for the entire lifetime of the virtual device, so they are created when it is created and only unregistered when it is closed. The virtual device owners can access them from the device itself after creation.
This CL is only adding the API, the sensor registration and lifetime management is added in a follow-up CL.
Bug: 237278244
Test: atest VirtualSensorConfigTest
Test: atest VirtualSensorEventTest
Test: atest VirtualDeviceParamsTest
Change-Id: I8bb458dacba1bb65b00e288734ce41186c4fe624
Strict partition precedence is enforced now, and the legacy
android:priority is no longer able to reorder overlays across
partition boundaries.
Should use OverlayConfig instead to do the custom configuration
if a cross partition reorder is needed.
Bug: 254407173
Test: atest OverlayConfigTest
Change-Id: I915957bee2ce00286c1bad853206e7e5cb1d140b
Provide APIs to query display shape information:
- Added a DisplayShape class which provide a Path.
- Added a new API in Display to get the DisplayShape based on the
display coordinates.
- Added a new API in WindowInsets to get the relative DisplayShape
based on the window frame.
Bug: 236935288
Test: atest DisplayShapeTest LocalDisplayAdapterTest WindowInsetsTest
InsetsStateTest DisplayPolicyLayoutTests DisplayPolicyTests
WallpaperControllerTests
Change-Id: I7aacfcae42203d3f57cd577da5a69180f66780ad
These are:
- onProxyConnected (equivalent to onServiceConnected)
- onAccessibilityEvent
- onInterrupt
- getWindows
- set/getInstalledAndEnabledServices
Connect the proxy client (IAccessibilityServiceClient) to a
proxy service connection
(ProxyAbstractAccessibilityServiceConnection) in ProxyManager,
so the A11yDisplayProxy can access the UI.
AccessibilityServices run on their own thread. To avoid using the
app's main thread, the app that registers the A11yDisplayProxy
can call it on a different thread. Add a note in the proxy class.
Future TODOs (b/254545943):
The a11y state returned to A11yManager includes state
of all proxies and AccessibilityServices.
Separation will require AccessibiilityManager to go from being a
process singleton to a per-display instance.
Input and a11y focus are singletons and may
shift between a proxy display and a display on the device.
Separation will require future changes.
ProxyManager behaves more like UiAutomationManager,
and centralizes proxy management. Separation into different user
states will require future refactoring.
Bug: 241429275
Test: atest AccessibilityDisplayProxyTest,
AccessibilityManagerServiceTest, manual test app that
registers/unregisters A11yDisplayProxy
Change-Id: I830c6613c2c2f8abcc2343c5110f4e7b7494fb0e
The test module would crash with SEGV_MAPERR if the following events
happen in order:
(1) Typeface#deserializeFontMap(ByteBuffer, Map<String, Typeface>)
(also a @TestApi) is called.
(2) The ByteBuffer passed to deserializeFontMap is GC-ed.
(3) The Typeface objects generated by deserializeFontMap are GC-ed.
This is because Typeface reads the buffer in its native object
destructor after
commit 88e387449b3f477a4cde31127cee5c63f332999c
This crash won't happen in production, because the buffer will never be
released.
To prevent the crash in tests, we must release Typeface objects
manually before (2) happens.
Bug: 255798098
Test: atest CtsGraphicsTestCases
Change-Id: If4426beb9a0dcefde317e6a01b4de9bf3fa4c951
Pass @OperationType in BackupAgent#onCreate and use it to instantiate
BackupRestoreEventLogger.
Bug: 255376040
Test: Manual: 1. Log operationType to logcat in BackupAgent#onCreate
2. adb shell bmgr backupnow android; verify
operationType=0 via logcat
3. adb shell bmgr restore 1 android; verify
operationType=1 via logcat
Change-Id: I4b2e337209f31aade91baa6900abced35591a0af
The class will serve as a container for B&R-specific logical types that
are used throughout the code base (i.e. including non-BR components).
Replace BackupManager#OperationType with the new
BackupAnnotations#BackupDestination.
Bug: 255376040
Test: m -j
Change-Id: Ica9fc4670575dab01dbf18864cd8e5ec1132738f
Adds an interface that controls the behavior of
the blocked empty state of personal/work profile
tabs in the ChooserActivity/ResolverActivity.
This state is displayed when the device policy
doesn't allow sharing between apps.
The interface allows to customize in which cases
we block the sharing, what text we display there
and send custom analytics events.
This CL should not change any behaviour.
Default behaviour is to not allow cross profile
sharing which could be overriden by using
different implementation of the ProfileBlockerEmptyStateProvider.
E.g. in partial screensharing app selector we could
decide whether we want to block the tab based
on the screen capturing device policies.
Bug: 233348916
Test: atest com.android.internal.app.ChooserActivityTest
Test: atest com.android.internal.app.ResolverActivityTest
Test: atest com.android.internal.app.ChooserActivityWorkProfileTest
Test: atest com.android.internal.app.ResolverActivityWorkProfileTest
Change-Id: I6b46c9424644016d7e2f472a95b0b5583c58c2cb
The new method hasExplicitIdentity will track whether the caller is
within a Binder.clearCallingIdentity/restoreCallingIdentity block based
on packing this state information into the token returned by clearCallingIdentity.
Bug: b/252975769
Test: android.os.cts.BinderTest
Change-Id: I162db933f9e52cd6f9f46796bda11ad6216d3d66
VirtualTouchEvent.Builder raises an exception during build() that is not
obvious why it is raised. Adding documentation with explanation.
Test: pure documentation change
Change-Id: I877fd17dd8325ff614ea056aa005740c1a25da1f