Commit Graph

19524 Commits

Author SHA1 Message Date
TreeHugger Robot
f3d635674a Merge "Handwriting gesture line margin" 2022-10-19 07:09:04 +00:00
Sunny Goyal
1bda68a6c9 Merge "Adding missing rotationChange in RemoteAnimationTarget" into tm-qpr-dev am: ff6a8b23df am: 5f2e52127e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19947321

Change-Id: I1213149134544c654df38d657abc56226431a9ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 17:16:36 +00:00
Sunny Goyal
5f2e52127e Merge "Adding missing rotationChange in RemoteAnimationTarget" into tm-qpr-dev am: ff6a8b23df
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19947321

Change-Id: I0d54589ee834e0522531c3f75a178f72f3ab328e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 16:42:52 +00:00
Sunny Goyal
ff6a8b23df Merge "Adding missing rotationChange in RemoteAnimationTarget" into tm-qpr-dev 2022-10-18 16:32:28 +00:00
Yohei Yukawa
bf5dc9ecbf Make IMM#hasActiveInputConnection() more predictable
This is a follow up CL to our previous CL [1], which introduced

  InputMethodManager#hasActiveInputConnection(View)

as a test API.

As this remains to be a test API, we should be able to tweak its
behavior as long as existing use cases continue working.

The main motivations of this CL is to make it more predictable and
easier to understand.

Even with simplification, ImeAwareEditText and CTS tests should
continue working as expected.  Also there must be no app compatibility
concern in this CL.

 [1]: I466a93e2b4706ae809ac50dc16dc8e4ffa7c2f1c
      8bcce88c86

Bug: 176697749
Bug: 182259171
Test: presubmit
Change-Id: I7fe8b18ffbb450fd1e272e15f06f2629518f320c
2022-10-18 07:58:51 -07:00
Yohei Yukawa
bb563d8c41 Merge "Use WeakReference#refersTo() when possible" 2022-10-18 05:45:03 +00:00
TreeHugger Robot
90aa94625b Merge "Merge WINDOW_FOCUS_GAIN_REPORT_WITH{,OUT}_CONNECTION again" 2022-10-18 04:45:37 +00:00
TreeHugger Robot
e49fea2d29 Merge "Remove a redundant check from IMM#isAcceptingText()" 2022-10-18 04:24:52 +00:00
Yohei Yukawa
699fc515e0 Use WeakReference#refersTo() when possible
For a given WeakReference<T> ref,

  ref.refersTo(obj)

is more efficient than

  ref.get() == obj.

This CL applies the above rule to

  RemoteInputConnectionImpl

for a better performance.

This is mechanical refactoring.  There must be no observable behavior
change.

Bug: 182259171
Test: presubmit
Change-Id: Iddf73b0fcb16a14f6c024da4a7db136d4fea4900
2022-10-17 20:18:44 -07:00
TreeHugger Robot
0e7899c1d3 Merge "Simplify MSG_SET_ACTIVE handler" 2022-10-18 01:23:50 +00:00
TreeHugger Robot
73186bfa87 Merge "Extract out IMM.DelegateImpl#checkFocus()" 2022-10-18 01:05:11 +00:00
Yohei Yukawa
62f93a5cf9 Merge WINDOW_FOCUS_GAIN_REPORT_WITH{,OUT}_CONNECTION again
This is the 5th CL after our CLs [1][2][3][4] for IME visibility
issues.

While the last CL [4] logically reverted most of changes made in
previous CLs [1][2][3], there remain some unintentional changes around
WINDOW_FOCUS_GAIN*.  The biggest issue is the invocation of

  IMM#mServedInputConnectionWrapper.isActive(),

from startInputOnWindowFocusGain() added in the 3rd CL [3].  This is
really problematic because it internally

  IMM#checkFocus(),

which is not intended to be called from startInputOnWindowFocusGain().

This CL addresses that problem by effectively removing the call path.

App compat risk is supposed to be low because IMM#checkFocus() was not
called before the 3rd CL [3], which was introduced in Android R.

There are CTS tests to verify that related issues are not regressed
again [5][6][7].

 [1]: I45a9814d812ad906f417c24200fd4219959e2423
      6ecbf08772
 [2]: I2da99ae67b9ce4051dec0c0f0e975ebe6e1ab118
      48bfc3165c
 [3]: I1ef3d341af9d473d94d52fd1890deafbae2bc9e1
      d43b75cf0e
 [4]: I022ad658844142ff4a4cf3b91953013f2bfbb58a
      a24622cfcd
 [5]: Ie029c109e257be81a1ad6327a706bb6bc1e8316c
      3045df602f061a185f6fff18e81f5af1a2c51270
 [6]: Id48eedc1a2d5597bbba5f1d3fc01540e2f6de4c5
      3ed79ab2de600bce312b4ce59b319da0ad9a8dac
 [7]: I022ad658844142ff4a4cf3b91953013f2bfbb58a
      a24622cfcd

Bug: 152373385
Bug: 155781821
Bug: 160391516
Bug: 161273049
Bug: 182259171
Test: presubmit
Change-Id: I64412e87c4881018ea67140f9472e10ea41836e4
2022-10-17 17:02:49 -07:00
Yohei Yukawa
67a7f00240 Remove a redundant check from IMM#isAcceptingText()
This is a follow up CL to my previous CL [1], which rewrote

  InputMethodManager#isAcceptingText()

with a newly introduced internal method

  RemoteInputConnectionImpl#isFinished().

What I overlooked was the fact that

  mServedInputConnection.isFinished()

is guaranteed to return "true" while

  InputMethodManager#mServedInputConnection

is nonnull.  Let's simplify the logic.

This is a safe clean up.  There must be no observable behavior change.

 [1]: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
      d1ff9740c1

Bug: 234882948
Test: presubmit
Change-Id: Icee431b05108aa607ea0a56c683a361399b7583e
2022-10-17 15:20:46 -07:00
Yohei Yukawa
4f1033f742 Merge "Inline ImeFocusController#onInteractive()" 2022-10-17 21:38:39 +00:00
Yohei Yukawa
a9625d3bee Simplify MSG_SET_ACTIVE handler
This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I410fc54cd941eda13f25acd1aedf8778956091f3
2022-10-17 12:11:58 -07:00
Yohei Yukawa
d838e9f25d Extract out IMM.DelegateImpl#checkFocus()
This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: Ie29c9450ccb7f04bdb434bfa634041105f0c17b4
2022-10-17 12:11:18 -07:00
Yohei Yukawa
444285617b Inline ImeFocusController#onInteractive()
Now that

  ImeFocusController#onInteractive()

is simple enough to be inlined, which allows us to also remove

  InputMethodManagerDelegate#isCurrentRootView().

This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I4f001e7cef6e274a481cd1dc9ce314f3b19313dd
2022-10-17 12:08:13 -07:00
Yohei Yukawa
e864f5dc98 Merge "Further simplify FINISH_INPUT_NO_FALLBACK_CONNECTION handling" 2022-10-17 19:01:19 +00:00
TreeHugger Robot
b4778452fb Merge "Simplify FINISH_INPUT_NO_FALLBACK_CONNECTION handling" 2022-10-17 18:24:24 +00:00
TreeHugger Robot
f9be7f4b67 Merge "Simplify InputMethodManager#startInputInner" 2022-10-17 08:41:07 +00:00
Wilson Wu
b20ee4eea5 Simplify InputMethodManager#startInputInner
Wrap the createInputConnection logic into a
private method to simplify this complex method.

This is a mechanical restructuring without user
visible changes.

Bug: 236937383
Bug: 236920321
Test: presubmit
Change-Id: I21207d22b7f5d55e84cbfde91969e59bb94b3043
2022-10-17 14:22:53 +08:00
Yohei Yukawa
ccc6931412 Further simplify FINISH_INPUT_NO_FALLBACK_CONNECTION handling
This CL aims to further simplify what MSG_SET_INTERACTIVE handler
needs to do, which was introduced in my previous CL [1].

So redispatching the task to the UI thread is necessary when and only
when "interactive" parameter is true.  If it's false, we can directly
invoke DelegateImpl#finishInputAndReportToIme().

 [1]: I0c95d7e70357ac98b336cd1b51a7405ba92a9a6f

Bug: 234882948
Test: presubmit
Change-Id: I19e14526a094900c80d9c3fc00f576e3a50cafb2
2022-10-15 14:54:40 -07:00
Yohei Yukawa
3ca950724c Simplify FINISH_INPUT_NO_FALLBACK_CONNECTION handling
This is the 6th CL for Bug 26851566 [1][2][3][4][5].

In the CLs [3][5], the approach we took was to extend an existing IPC
method

  IInputMethodClient#setActive(boolean active, boolean fullscreen)

by adding one more parameter "reportToImeController".

However, it seems that such an approach made its handling code hard to
maintain, because the IPC method needed to behave in a completely
different manner depending on the newly introduced parameter.

To avoid such a confusion and to make subsequent refactoring easier,
this CL introduces a new IPC method

  IInputMethodClient#setInteractive(
          boolean interactive, boolean fullscreen)

to clarify what we are actually doing.

In most cases there must be no observable behavior change.  One
possible behavior change is when setInteractive() gets called when
IMM#mCurRootView.getView() is not available.  In the previous CL, we
fell back to previous behavior as if
FINISH_INPUT_NO_FALLBACK_CONNECTION was not defined.  However it looks
like such a fallback mechanism is not an intentional behavior.

The main use case is still verified with existing CTS tests [6][7].

 [1]: Ic11956fe745a829da1ec7c09ea214e9b3961c8e0
      0df8812486
 [2]: If06daf71160aa44a4254ac125561974ecbdef4f2
      2c6e80be12
 [3]: I8a657e75e274d842fb46b60375f6aeafeab96a59
      152eacec4f
 [4]: I16f4a34360a2f64b69978724648a9be741f140b5
      3d62f739a8
 [5]: Id4e71a822bfde5fe6a263bbe094c0d238017efe1
      3d62f739a8
 [6]: Iba0332ed3b767a9a15768b64947b9cde31105af1
      e2f4138156c784746becde6a01c19f0c3de6ac32
 [7]: I346ef42f2546a2925bf44ca7719ae19399e15e78
      84c5ec2f81d4be5285b9c5f1d0e943f808e9158c

Bug: 26851566
Bug: 156215187
Test: atest InputMethodStartInputLifecycleTest
Change-Id: I0c95d7e70357ac98b336cd1b51a7405ba92a9a6f
2022-10-15 14:54:34 -07:00
Yohei Yukawa
77e8c34679 Extract out IMM.DelegateImpl#onViewFocusChanged()
This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I8cccfa29db3a605c9bf1b480d755db40ed11d17e
2022-10-15 13:01:27 -07:00
TreeHugger Robot
7942003609 Merge changes I49665b38,I0c63504f
* changes:
  Merge updateImeFocusable() into onPostWindowFocus()
  Partly inline ImeFocusController#updateImeFocusable()
2022-10-14 18:51:21 +00:00
Yohei Yukawa
1179a454b0 Merge "Partly inline on{Pre,Post}WindowFocus()" 2022-10-14 18:37:05 +00:00
TreeHugger Robot
0d63714522 Merge "Remove InputMethodManagerDelegate#setCurrentRootView()" 2022-10-14 14:40:41 +00:00
Tiger Huang
896a08a386 Merge "Re-land "Enable LOCAL_LAYOUT"" into tm-qpr-dev am: b3c6384df9 am: bcac7745ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20106621

Change-Id: I002f7ab9fd5f604fda71064fc7ded09a6ff1c42e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-14 14:25:53 +00:00
TreeHugger Robot
c522d44d60 Merge "Inline IMM.DelegateImpl#finishInput()" 2022-10-14 14:13:23 +00:00
TreeHugger Robot
2fcc0547bf Merge "Inline IMM.DelegateImpl#startInput()" 2022-10-14 14:02:02 +00:00
Tiger Huang
bcac7745ac Merge "Re-land "Enable LOCAL_LAYOUT"" into tm-qpr-dev am: b3c6384df9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20106621

Change-Id: I0f2ab2a923654383484442c70e651811fbc29631
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-14 13:52:29 +00:00
Tiger Huang
b3c6384df9 Merge "Re-land "Enable LOCAL_LAYOUT"" into tm-qpr-dev 2022-10-14 13:00:03 +00:00
Harry Cutts
ec7c40da3e Merge "Add AXIS_GESTURE_{X,Y}_OFFSET MotionEvent axes" 2022-10-14 08:25:07 +00:00
Yohei Yukawa
f324eaba3c Merge updateImeFocusable() into onPostWindowFocus()
This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I49665b3832de75238243227acc76be58dceb50fc
2022-10-13 23:06:47 -07:00
Yohei Yukawa
cbeadf8f71 Partly inline ImeFocusController#updateImeFocusable()
This is mechanical refactoring.  There must be no observable behavior
change.

Bug: 234882948
Test: presubmit
Change-Id: I0c63504fc7fe665f7b7816bdcc7a6cb357482380
2022-10-13 23:05:41 -07:00
Yohei Yukawa
e128f7da41 Partly inline on{Pre,Post}WindowFocus()
This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I8cd9dfe858c3ae4e860742a3b771888aa5d8921d
2022-10-13 23:04:04 -07:00
Yohei Yukawa
c723b12c8a Remove InputMethodManagerDelegate#setCurrentRootView()
With this CL,

  InputMethodManagerDelegate#setCurrentRootView()

will be removed.

This is mechanical refactoring.  There must be no observable behavior
change.

Bug: 234882948
Test: presubmit
Change-Id: I3e596b4243f3223d1c9b8ba3571f91879ce0ecd4
2022-10-13 21:53:23 -07:00
Yohei Yukawa
867ceacb77 Inline IMM.DelegateImpl#finishInput()
This CL inlines

  InputMethodManager.DelegateImpl#finishInput().

There must be no observable behavior change except for we no longer
log IME tracing event

  "InputMethodManager.DelegateImpl#finishInput".

If that event is turned out to be useful, we can add a similar tag
later, but for now it doesn't look to be critically useful.

Bug: 234882948
Test: presubmit
Change-Id: Ie204f9f665e9ab4814100068ac357fbb4b26b5a5
2022-10-13 21:53:02 -07:00
Yohei Yukawa
b7b38bd0b3 Inline IMM.DelegateImpl#startInput()
This CL inlines

  InputMethodManager.DelegateImpl#startInput().

There must be no observable behavior change except for we no longer
log IME tracing event

  "InputMethodManager.DelegateImpl#startInput".

If that event is turned out to be useful, we can add a similar tag
later, but for now it doesn't look to be critically useful.

Bug: 234882948
Test: presubmit
Change-Id: I15919fba14c3c78d64796c3e600cfd8f62e73133
2022-10-13 21:52:48 -07:00
Yohei Yukawa
83c853b24b Remove InputMethodManagerDelegate#startInput()
This is a follow up CL to my previous CL [1], which partly reverted
the initial commit of ImeFocusController [2].

With that CL,

  InputMethodManagerDelegate#startInput()

is no longer called.  Thus we no longer need to defined it.

There must be no behavior change.

 [1]: Ie3446e1d0f62c489195e31fc7f073020884d6cae
      ff975479b4
 [2]: Ib455704fe1e9d243f93190a84f230210dbceac2a
      970d9d2e0c

Bug: 234882948
Bug: 244504062
Test: presubmit
Change-Id: I62ae648b75cc33592e4e985b4c975c97ccdd24f8
2022-10-13 21:52:32 -07:00
Yohei Yukawa
e16dbabf16 Merge "Remove InputMethodManagerDelegate#getLockObject()" 2022-10-14 01:02:48 +00:00
Justin Ghan
e709f0a4ed Handwriting gesture line margin
Point-based handwriting gestures are supported for points within text
line bounds. With this change, they will also be supported for points
which are outside the line bounds but within a margin of the line bounds.

The margin is added to ViewConfiguration so that the value can be
accessed by other UI toolkits so that they can implement the same
behavior.

The dimension resource is added as a @SystemApi so that OEMs may
override the value.

Bug: 243967209
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I0e64f20c670808580346a485d06a0da0f21d3ed2
2022-10-13 17:54:20 -07:00
Sally Qi
d5d106aea9 Merge "Plumb getOverlaySupport() into Display Manager for HWUI." 2022-10-13 21:29:47 +00:00
Alan Viverette
0f2d50e23f Merge "Fix OnGestureListener nullability annotations" 2022-10-13 18:48:00 +00:00
Mark Punzalan
c1ec30e72c Merge "Remove active translation on Activity destroyed" into tm-qpr-dev am: 9c185693d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20022962

Change-Id: I1d3c6b4776c2b635a2c40d26ec47daecd478fb72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-13 18:04:58 +00:00
Mark Punzalan
9c185693d4 Merge "Remove active translation on Activity destroyed" into tm-qpr-dev 2022-10-13 18:00:08 +00:00
Antonio Kantek
26c3d22a2c Merge "Update View#isInTouchMode javadoc" 2022-10-12 21:36:31 +00:00
Antonio Kantek
f1cd9e468c Update View#isInTouchMode javadoc
Update View#isInTouchMode javadoc according to the new multi-display
touch mode implementation.

Bug: 198499018
Test: m
Change-Id: Idb6cbadd3afd745b76690de67c363749c810f06e
2022-10-12 17:36:19 +00:00
TreeHugger Robot
8d44d5302d Merge "Update layout direction if ViewRoot is preserved" into tm-qpr-dev am: 3c282790e4 am: 97fdee3996
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20158130

Change-Id: Ia3c413d17e02c436ef22459c4b387d6fe890eb72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-12 14:45:08 +00:00
Prabir Pradhan
fdf025854e Merge changes from topic "inputdevice-supportsusi"
* changes:
  BatteryController: Only listen to UEvents from power_supply changes
  BatteryController: Remove the /sys prefix when adding UEvent listener
  Determine whether an input device supports USI using IDC files
2022-10-12 14:36:45 +00:00