Commit Graph

8879 Commits

Author SHA1 Message Date
TreeHugger Robot
329f5f3858 Merge "Add rate limiter to sendHint API call" 2022-12-05 09:45:00 +00:00
Wei Sheng Shih
941c58dee9 Merge "Extract the drawing logic from StartingSurfaceDrawer." 2022-12-05 03:11:23 +00:00
Ruslan Tkhakokhov
6dfaaf1969 Merge "Make BackupRestoreEventLogger System API" 2022-12-03 18:06:20 +00:00
Matt Buckley
56093a77a9 Add rate limiter to sendHint API call
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
2022-12-03 03:45:41 +00:00
wilsonshih
f8801f5069 Extract the drawing logic from StartingSurfaceDrawer.
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
2022-12-02 12:11:30 +00:00
Ruslan Tkhakokhov
ecc97c0ba2 Make BackupRestoreEventLogger System API
Also adds BackupManager#getBackupRestoreEventLogger() - a method to
instantiate BackupRestoreEventLogger.

Bug: 244436184
Test: atest FrameworksCoreTests:BackupManagerTest
Change-Id: I5539094dc2c465013c9567fd35313dc595218571
2022-12-02 08:14:21 +00:00
Dennis Song
b82ea935ae Merge "Respect partition precedence while deciding overlay priority" am: 9f25e02fa3 am: 8579fa7af4 am: 0c7d4135fb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2310127

Change-Id: Ic8a455217f9c56970d5b1b9917fc38fe005f3001
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 05:18:01 +00:00
Dennis Song
0c7d4135fb Merge "Respect partition precedence while deciding overlay priority" am: 9f25e02fa3 am: 8579fa7af4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2310127

Change-Id: I808b41aaf25d8546b508e6041a844c873dc88208
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 04:42:14 +00:00
Tyler Freeman
c9b04d73ae Merge "fix(non linear font scaling): fix crash with certain negative SP values" 2022-12-02 04:32:47 +00:00
Dennis Song
8579fa7af4 Merge "Respect partition precedence while deciding overlay priority" am: 9f25e02fa3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2310127

Change-Id: I55dfc0f2933d956f924a1017d1aa94ad04aeff5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 04:13:08 +00:00
Ilya Matyukhin
d71de2614a Merge changes from topic "new-udfps-touch" into tm-qpr-dev am: 0672ae40db am: 858442e50d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20550191

Change-Id: I15ceb55ba19a1b07605d80614ca4c538c557cff5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-02 02:06:40 +00:00
Tyler Freeman
bae1102a51 fix(non linear font scaling): fix crash with certain negative SP values
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
2022-12-01 17:05:32 -08:00
Shawn Lin
ae07cf71f5 Merge "Support DisplayShape" 2022-12-01 07:34:39 +00:00
Kohsuke Yatoh
a089ecef9f Merge "Make Typeface#releaseNativeObjectForTest @TestApi." 2022-12-01 00:58:46 +00:00
Yeabkal Wubshit
c04d8de7c4 Merge "Create API to Compute Vibration Pattern Equivalent to a VibrationEffect" 2022-12-01 00:04:58 +00:00
Yeabkal Wubshit
4e125b212a Create API to Compute Vibration Pattern Equivalent to a VibrationEffect
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
2022-11-30 20:07:01 +00:00
Ilya Matyukhin
858442e50d Merge changes from topic "new-udfps-touch" into tm-qpr-dev am: 0672ae40db
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20550191

Change-Id: Idad692926ac241f051d6580ddfe1b1318e8cad08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 17:16:07 +00:00
Vladimir Komsiyski
79101e966f Merge changes from topic "virtual-sensors"
* changes:
  Adjust the behavior of SensorManager for virtual device sensors.
  Virtual sensors lifecycle management.
  Virtual sensor API.
2022-11-30 12:41:38 +00:00
TreeHugger Robot
9ec600d356 Merge "Delete android.os.EnvironmentTest#testIsExternalStorageManager" 2022-11-30 01:06:02 +00:00
Tyler Freeman
7f0fb8234f Merge "feat(non linear font scaling)!: add FontScaleConverter for non-linear font scaling." 2022-11-29 23:43:18 +00:00
TreeHugger Robot
45ce9ddfab Merge "Enable telephony fallback triggered by providers" 2022-11-29 23:01:17 +00:00
Winson Chiu
b1dfdd2f20 Delete android.os.EnvironmentTest#testIsExternalStorageManager
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
2022-11-29 22:22:12 +00:00
Tyler Freeman
5f7036df71 feat(non linear font scaling)!: add FontScaleConverter for non-linear font scaling.
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
2022-11-29 12:09:02 -08:00
Neil Fuller
7fbcae6efd Enable telephony fallback triggered by providers
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
2022-11-29 19:45:45 +00:00
Sally Yuen
77eb98c8ac Merge "Expose more SystemAPI methods on AccessibilityDisplayProxy" 2022-11-29 16:36:27 +00:00
Vladimir Komsiyski
ca9308224a Virtual sensor API.
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
2022-11-29 13:50:21 +01:00
Dennis Song
040471fb38 Respect partition precedence while deciding overlay priority
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
2022-11-29 17:14:05 +08:00
Shawn Lin
2742c68f6c Support DisplayShape
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
2022-11-29 15:48:50 +08:00
sallyyuen
111ef0b932 Expose more SystemAPI methods on AccessibilityDisplayProxy
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
2022-11-28 13:07:14 -08:00
Ruslan Tkhakokhov
920b00febc Merge "Pass operation type to BackupAgent" 2022-11-28 18:58:27 +00:00
Ruslan Tkhakokhov
d48cd70ef7 Merge "Create BackupAnnotations for B&R-related annotations and constants" 2022-11-28 18:57:43 +00:00
Ilya Matyukhin
3318c87c48 Add rotatePointF to RotationUtils
Bug: 218374828
Test: atest RotationUtilsTest
Change-Id: I877e762b1f2b96ae8da3e6b08a78ba4d066c2880
2022-11-28 05:55:49 +00:00
Kohsuke Yatoh
6c89096fb8 Make Typeface#releaseNativeObjectForTest @TestApi.
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
2022-11-28 04:50:24 +00:00
Nick Chameyev
c3bbd7a1de Merge "[Partial Screensharing] Add abstraction to show custom device policy blockers in ChooserActivity" into tm-qpr-dev am: 814ef64f49 am: 2fcb916dcb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20139164

Change-Id: Ie64989a9e4a4f05405f47a9fcfe4d79627e24f05
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-24 12:50:24 +00:00
Nick Chameyev
2fcb916dcb Merge "[Partial Screensharing] Add abstraction to show custom device policy blockers in ChooserActivity" into tm-qpr-dev am: 814ef64f49
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20139164

Change-Id: I94044049f2d8be9984e8fa110345ca5dd9141a48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-24 12:11:28 +00:00
Ruslan Tkhakokhov
9c44a14afe Pass operation type to BackupAgent
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
2022-11-23 23:52:08 +00:00
Ruslan Tkhakokhov
0828847a7e Create BackupAnnotations for B&R-related annotations and constants
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
2022-11-23 23:44:29 +00:00
Almaz Mingaleev
b799b6cf59 Merge "Clean-up after TZUvA feature removal." am: 06b9abf013 am: ac0cf4e9ae am: fe16fe6f8c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2300422

Change-Id: Ifd1e49c1611ed2d55337609e5d07d43761f3e44d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 18:37:04 +00:00
Matt Gilbride
b991fd2c9e Merge "Make getCallingUidOrThrow() not throw in clearCallingIdentity() blocks" am: a3862537ff am: 2f3bc71868 am: 96cf82ee53
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2311186

Change-Id: Ida72d323ed6e7692b58d07cecab31267b31dc063
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 17:07:05 +00:00
Almaz Mingaleev
fe16fe6f8c Merge "Clean-up after TZUvA feature removal." am: 06b9abf013 am: ac0cf4e9ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2300422

Change-Id: Id8a86a06c500d6e58571ec903a4238613597eae8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 11:28:16 +00:00
Almaz Mingaleev
ac0cf4e9ae Merge "Clean-up after TZUvA feature removal." am: 06b9abf013
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2300422

Change-Id: I1d9b114c135f7e3c80613ae1f7b32346cd0b258f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 11:02:13 +00:00
Almaz Mingaleev
06b9abf013 Merge "Clean-up after TZUvA feature removal." 2022-11-23 10:16:21 +00:00
Nick Chameyev
a722553826 [Partial Screensharing] Add abstraction to show custom device policy blockers in ChooserActivity
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
2022-11-22 12:08:59 +00:00
Matt Gilbride
96cf82ee53 Merge "Make getCallingUidOrThrow() not throw in clearCallingIdentity() blocks" am: a3862537ff am: 2f3bc71868
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2311186

Change-Id: Idf161d70dfa5fe1a029245b5a568e9e0dde3baa4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 12:05:35 +00:00
Matt Gilbride
2f3bc71868 Merge "Make getCallingUidOrThrow() not throw in clearCallingIdentity() blocks" am: a3862537ff
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2311186

Change-Id: I4ad458fee77e00dd491407a5122c3c1173cf4e2e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-22 11:40:26 +00:00
mattgilbride
d8323e8684 Make getCallingUidOrThrow() not throw in clearCallingIdentity() blocks
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
2022-11-21 20:24:28 +00:00
Zeyin Wu
3f9671444d Merge "Add new APIs for initial accessibility focus setting" 2022-11-21 18:55:16 +00:00
Sandro Meier
5c2bd27f77 Merge "Improve documentation of VirtualTouchEvent" 2022-11-21 14:04:17 +00:00
Sandro Meier
70ef8a99fb Improve documentation of VirtualTouchEvent
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
2022-11-21 07:47:39 +00:00
Zeyin Wu
30c9a9f093 Add new APIs for initial accessibility focus setting
Bug: 255189088
Test: ran cts tests
Change-Id: Iaf5f863f22c4263be2cb2687ede566939e630d2b
2022-11-18 00:10:01 +00:00