Commit Graph

19264 Commits

Author SHA1 Message Date
Wilson Wu
30e354347e Merge "Improve lock annotation for InputMethodManager (3/N)" 2022-09-07 01:53:37 +00:00
Wilson Wu
b72a652f46 Merge "Improve lock annotation for InputMethodManager (2/N)" 2022-09-07 01:53:00 +00:00
Kriti Dang
599595bbfa Merge "Add Surface.clearFrameRate API" 2022-09-06 18:42:05 +00:00
Tiger Huang
8538946846 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev am: 7cacd12b23 am: 86e9871a01
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19822513

Change-Id: I4231b5087bdadcd8dce97ec0ca2f89a034df196f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 15:23:05 +00:00
Tiger Huang
86e9871a01 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev am: 7cacd12b23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19822513

Change-Id: I3110eb2b67741f06daad32aae29c69579a1aa3ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 14:50:11 +00:00
Tiger Huang
7cacd12b23 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev 2022-09-06 14:26:43 +00:00
Wilson Wu
ee68a1e34c Improve lock annotation for InputMethodManager (3/N)
Add @GuardedBy("mH") annotation for those Locked methods
which should be guarded by mH in InputMethodManager.

Bug: b/236937383
Test: presubmit
Change-Id: I271f78bc54c7cd406d56775aef0db9d6c4084ee0
2022-09-06 19:48:46 +08:00
Wilson Wu
27d4421382 Improve lock annotation for InputMethodManager (2/N)
In CL[1], we added @GuardedBy("mH") annotation for some
fields which should be guarded by mH for lock annotation
improvement.

Annotate more fields we miss in CL[1].

[1]: I3b345da25841b328358d16695e3a29ee65ae8d83

Bug: b/236937383
Test: presubmit
Change-Id: Ibee725dff3ff3d52f5b4d58e8bf2d8837dba665e
2022-09-06 16:08:27 +08:00
Wilson Wu
9552347b1a Merge "Improve lock annotation for InputMethodManager (1/N)" 2022-09-06 03:13:10 +00:00
Wilson Wu
9624ac3129 Improve lock annotation for InputMethodManager (1/N)
In InputMethodManager, we used the "mH" as a lock to
protect some fields and methods for thread safe.

Some of them are already protected with this lock but
they didn't have the annotation yet.

Add the annotation for those fields to prevent unexpected
behavior change and increase the readability.

Bug: b/236937383
Test: presubmit
Change-Id: I3b345da25841b328358d16695e3a29ee65ae8d83
2022-09-06 03:12:15 +00:00
Riddle Hsu
1a3b32ccd5 Merge "Optimize screen decor insets calculation" into tm-qpr-dev am: cc6255bd91 am: 955b79a8b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19180946

Change-Id: I773d978cf8c1a92e2105be1786f3823bc3ffd0de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 17:08:14 +00:00
Riddle Hsu
955b79a8b3 Merge "Optimize screen decor insets calculation" into tm-qpr-dev am: cc6255bd91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19180946

Change-Id: I672fa05516f90cb2a4c262598cc5734a377fca79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 16:38:34 +00:00
Riddle Hsu
3ef46b57b9 Optimize screen decor insets calculation
This stores the computed decor insets and frame excluding insets.
So it can save 99% time of recomputing the insets every time during
starting an activity. E.g. dozen times of "prepare display info/frame,
compute window layout of insets source windows, calculate insets"
becomes "get result from array".

The saved decor insets will be updated when:
- Display metrics is changed (DC#updateBaseDisplayMetrics).
- Insets provider is added/removed/changed.

Also
- Use DisplayCutout rather than WmDisplayCutout to simplify
  passing the cutout between methods.
- Optimize getSourceProvider to avoid unnecessary object allocation.

This also fixes an issue that the display doesn't compute the latest
configuration when navigation mode is changed. Now it is fixed by
checking if the insets provider has layout changes and then recompute
screen configuration.

Bug: 238399969
Bug: 159103089
Test: atest DisplayPolicyInsetsTests DisplayPolicyLayoutTests
      DisplayPolicyTests#testUpdateDisplayConfigurationByDecor
Test: Change navigation mode or display size (density) in Settings.
      And then swipe-up or press home key, there won't be a
      frozen effect (display configuration change).

Change-Id: If6c28a89939372e6362b92f469ef7d793e8ec215
2022-09-02 23:29:29 +08:00
Haoyu Zhang
7cf6d0618c Merge "Checking TextOperationUser when initialize stylus handwriting" 2022-09-02 09:05:15 +00:00
Neha Jain
3e52eb1bc6 Revert "Enable LOCAL_LAYOUT"
This reverts commit 1721522709.

Reason for revert: b/244521023

Change-Id: I67df39f4d218ff65cb7a2010b544c3ef158f50cf
2022-09-02 02:50:46 +00:00
Haoyu Zhang
3f655af0b3 Checking TextOperationUser when initialize stylus handwriting
Bug: 237418160
Fix: 244475514
Test: atest HandwritingInitiatorTest
Change-Id: I6c87d034d5bef28383db70f587bdd0ee2db77a79
2022-09-01 18:44:19 -07:00
TreeHugger Robot
5c6a88e404 Merge "Simplify code around mPreviousViewFocusParameters" 2022-09-02 00:13:35 +00:00
Haoyu Zhang
49bd302a80 Merge "Introduce visible line bounds to CursorAnchorInfo" 2022-09-01 18:56:12 +00:00
TreeHugger Robot
6632295826 Merge "Allow ANI#setQueryFromAppProcessEnabled to disable (remove) the connection." 2022-09-01 18:29:49 +00:00
Haoyu Zhang
4976e19609 Introduce visible line bounds to CursorAnchorInfo
Add visible line bounds to CursorAnchorInfo for IME to improve
scribe rich gesture recognization accuracy.

Bug: 215533103
Bug: 239843501
Test: manually tested
Change-Id: I7039b75388ae34d24feb38d18d8da9a91df89504
2022-09-01 05:07:37 -07:00
Daniel Norman
b40cb68ffb Allow ANI#setQueryFromAppProcessEnabled to disable (remove) the connection.
Bug: 243543412
Test: atest AccessibilityEndToEndTest
Change-Id: Icce9ff7ebf98a32bf6e92b0e9fc84d7bc091678e
2022-08-31 16:48:21 -07:00
Alan Viverette
009ccfbabb Merge "Intercept abnormal MotionEvent in GestureDetector#onTouchEvent" 2022-08-31 18:25:48 +00:00
Chet Haase
49589ed7fe Merge "Fix docs for FrameMetrics.TOTAL_DURATION" 2022-08-31 17:23:42 +00:00
Cole Faust
9acf46f66f [conflict] Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567 am: 9b3a5fc03b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I5e59b8549df348c181cd3b72311798a5d7602a67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 21:03:54 +00:00
Cole Faust
9b3a5fc03b Merge "Fix array-related errorprone warnings" am: a1eb8cf128 am: 44f8576073 am: 91d6c5b564 am: 6a79ae2567
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2186016

Change-Id: I7052a1f7391ed6701fe0e1036c27368609032e35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-30 20:44:00 +00:00
Cole Faust
a1eb8cf128 Merge "Fix array-related errorprone warnings" 2022-08-30 18:03:01 +00:00
Treehugger Robot
e9712ca91b Merge "Exclude large tests from presubmit." am: 3d8681e31d am: 9dc9fd8930 am: 5860c207c9 am: da40df7c95
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2176682

Change-Id: I56d7b99eab9acc055a6935166f962d10e6df357c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-29 22:35:54 +00:00
Treehugger Robot
3d8681e31d Merge "Exclude large tests from presubmit." 2022-08-29 20:52:36 +00:00
Daniel Norman
38d6796af8 Merge "Rename ANI#makeQueryableFromAppProcess to enableQueryFromAppProcess." 2022-08-29 19:30:01 +00:00
Taran Singh
ca10f8bb95 Merge "Incorporate API feedback for Companion widget" 2022-08-29 19:26:58 +00:00
Daniel Norman
331a12188a Rename ANI#makeQueryableFromAppProcess to enableQueryFromAppProcess.
Bug: 243584378
Test: renamed in CTS tests
Change-Id: I4c1ab6b758a5d146ae9e24a8b1276829584710fe
2022-08-29 18:53:06 +00:00
Chet Haase
34cb4ed36b Fix docs for FrameMetrics.TOTAL_DURATION
The existing docs are incorrect and misleading. This change
fixes those docs to be more accurate.

Bug: 244193434
Test: Doc-only fix, no testing needed
Change-Id: I454786c2ef888417e96d7139efd1c922537188d6
2022-08-29 18:41:59 +00:00
Leon Scroggins
dfcdf5d529 Merge "Update docs for location of matching native flags" 2022-08-26 21:10:02 +00:00
huyuxin
9f45a12cc1 Intercept abnormal MotionEvent in GestureDetector#onTouchEvent
This could happen if an app started to send events to
GestureDetector.onTouchEvent without sending an ACTION_DOWN event first.
GestureDetector must see a complete event stream for a gesture to behave
correctly. A complete event stream is defined as:
-One ACTION_DOWN event
-Zero or more ACTION_MOVE events and matched pairs of
ACTION_POINTER_DOWN/ACTION_POINTER_UP
-One ACTION_UP or ACTION_CANCEL

Bug: 242021191
Test: run cts -m CtsViewTestCases -t android.view.cts.GestureDetectorTest

Change-Id: I22a5d1c162885d08ee7dfe9deef2aed0ed801d16
Signed-off-by: huyuxin <huyuxin@xiaomi.corp-partner.google.com>
2022-08-26 15:09:50 -04:00
Taran Singh
5f1971ff4d Merge changes from topics "performHandwritingGesture-return", "supported-gestures"
* changes:
  Add consumer callback in performHandwritingGesture()
  Add supported gesture type to EditorInfo
2022-08-26 18:26:54 +00:00
Tiger Huang
3a8fb05149 Merge "Enable LOCAL_LAYOUT" into tm-qpr-dev am: 2220c995a4 am: 81e8a4eb7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18030522

Change-Id: I8a7153c3029b9ac82bb5cc994046d526dc1d91e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:39:26 +00:00
Tiger Huang
81e8a4eb7f Merge "Enable LOCAL_LAYOUT" into tm-qpr-dev am: 2220c995a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18030522

Change-Id: I9848f788b2eff05772fd6c90421cc458f0a4c7b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:15:36 +00:00
Tiger Huang
2220c995a4 Merge "Enable LOCAL_LAYOUT" into tm-qpr-dev 2022-08-26 16:56:26 +00:00
Kriti Dang
4bfeeb4ec5 Add Surface.clearFrameRate API
This API is same as using setFrameRate with 0 as frame-rate value. But
this causes confusion, as the remaining two arguments are ignored, when
frame-rate is 0.

Bug: 241096917
Test: android.graphics.cts.SetFrameRateTest#testClearFrameRate
Change-Id: I1324c64ac75dacb78a733df2b91d7a5b46fc7455
2022-08-26 16:29:25 +02:00
Vaibhav Devmurari
3d81a3d7d3 Merge "Save country code information in InputDevice" 2022-08-26 09:27:39 +00:00
Rhed Jao
31856cd532 Merge "Improve package visibility gap for TextServicesManager" 2022-08-26 02:07:51 +00:00
Daniel Norman
47d8fe5c9f Merge changes from topic "reland-a11y-adp"
* changes:
  Tweak behavior of isAccessibilityDataPrivate() to reduce CPU usage.
  Revert "Revert "Limit off-label accessibility access using a new..."
2022-08-25 23:25:12 +00:00
Taran Singh
4b5d696935 Add consumer callback in performHandwritingGesture()
performHandwritingGesture should take an optional IntConsumer
& executor to provide result of Gesture operation back to IME.

Bug: 210039666
Bug: 239783077
Test: atest InputConnectionEndToEndTests

Change-Id: I2ca7eaa182159b7ffef0812d970512ffcf817ce2
2022-08-25 13:58:44 -07:00
Taran Singh
f135f8952b Add supported gesture type to EditorInfo
Editors should declare which Scribe Gestures do they support
as a means of providing this info to IME.

Bug: 239783077
Test: atest CtsInputMethodTestCases

Change-Id: Ic52a48c0a04d405e65ad49e9d447d603fefb4eb0
2022-08-25 13:58:44 -07:00
Taran Singh
28dd0b1b5a Incorporate API feedback for Companion widget
API feedback:
1. use IntDef for toolType
2. Add javadoc in onUpdateEditorTooltip describing its called after
   onStartInput.

Fix: 241206150
Bug: 233108064
Test: atest CtsInputMethodTestCases
Change-Id: I95bccd992690af5c160277b88a854d8f032278aa
2022-08-25 20:36:31 +00:00
Cole Faust
584140c83a Fix array-related errorprone warnings
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.

Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ia6f216cc36ad0a5758f39fd9b34962cd4adf9d8e
2022-08-25 10:57:12 -07:00
Leon Scroggins III
f265c480b0 Update docs for location of matching native flags
These flags have moved. Update the documentation stating which file to
keep the flag in sync with.

Bug: NA
Test: NA - documentation-only change
Change-Id: I679ee6534d697a9f2ba452a83258569688100707
2022-08-25 12:39:53 -04:00
Ming-Shin Lu
ebef237175 Merge "Fix IME jumpcut when playing user IME animation after IME restarted" into tm-qpr-dev am: 469cbe9037
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19600919

Change-Id: I6a80cf882660267d6a131ebb016a09e09c34297a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 16:32:23 +00:00
Ming-Shin Lu
469cbe9037 Merge "Fix IME jumpcut when playing user IME animation after IME restarted" into tm-qpr-dev 2022-08-25 16:13:08 +00:00
Vaibhav Devmurari
053555a70f Save country code information in InputDevice
Country code information is passed by a HID device over sysfs.
We can read that information and save it in InputDevice which
will be later used for auto-detecting Layout for PK.
More information in DD: go/pk_auto_layout_detection

Test: atest InputDeviceTest
Bug: 242715614
Change-Id: I97bde1f2338ad601a7e2636600038e6ca124e3ff
2022-08-25 13:14:05 +00:00