Commit Graph

19573 Commits

Author SHA1 Message Date
Yohei Yukawa
6bc4ed39c2 Merge "Rename IInputMethodManagerGlobal to InputMethodManagerGlobal" 2022-10-28 16:06:40 +00:00
Prabir Pradhan
95e4067b09 Merge changes from topics "input-device-bluetooth-address", "notify-stylus-presence"
* changes:
  Add hidden API to query the bluetooth address of an InputDevice
  Native input manager: Add default initializers for locked members
  Introduce monitoring behavior changes for USI devices (3/n)
  Notify the policy when a stylus gesture starts
2022-10-28 15:00:01 +00:00
Prabir Pradhan
e513b7ffe3 Add hidden API to query the bluetooth address of an InputDevice
Since revealing the bluetooth address of an input device can reveal
whether bluetooth is enabled, we require the BLUETOOTH permission for
this API.

This also means we cannot send the bluetooth address to apps using the
InputDevice class. We add an IInputManager method to query the address
instead that performs the permission check.

Since we are not using the Java InputDevice class to store the address,
we must cache the vector of last-reported InputDeviceInfos in
NativeInputManager.

DD: go/inputdevice-battery-notifications

Bug: 243005009
Test: manual
Change-Id: I560cb170ab7008314821e5150caf4868efb5d8d5
2022-10-27 20:45:22 +00:00
Robert Horvath
68a196f1ba Merge "[PATCH] Don't report after view detached from window." am: 88749cfd8f am: 698a7836d2 am: 28951b551e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2262742

Change-Id: Ifd30343b0768153c0a165806995f06e29d6a70c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-27 08:34:02 +00:00
Robert Horvath
28951b551e Merge "[PATCH] Don't report after view detached from window." am: 88749cfd8f am: 698a7836d2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2262742

Change-Id: Ia4a7fa688707877cf9145d3831d62587d44b9774
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-27 08:28:28 +00:00
Robert Horvath
698a7836d2 Merge "[PATCH] Don't report after view detached from window." am: 88749cfd8f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2262742

Change-Id: I63390f12c64d6c855b1c61f12d070bf258e3a735
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-27 07:57:17 +00:00
Robert Horvath
88749cfd8f Merge "[PATCH] Don't report after view detached from window." 2022-10-27 07:21:20 +00:00
Yohei Yukawa
f629ddf28b Rename IInputMethodManagerGlobal to InputMethodManagerGlobal
This is a mechanical renaming for classes outside
android.view.inputmethod package.

For non IMF classes, let's expose InputMethodManagerGlobal rather than
IInputMethodManagerGlobal.

In the next CL [1], we want to merge IInputMethodManagerGlobal and
IInputMethodManagerInvoker into a single class, and this CL is just a
preparation.

There must be no observable behavior changes.

 [1]: I310a33f27b876419b6a3058202dcbd663b541079

Bug: 234882948
Test: presubmit
Change-Id: I9b728560369179d5ee17c3570a2543b49b3f14ce
2022-10-26 12:47:56 -07:00
Harry Cutts
812b6ec77e Merge "Add MotionEventTest to code pointer for adding new axes" 2022-10-26 10:14:28 +00:00
Tiger Huang
2f8c5fe063 Merge changes from topic "requestedVisibleTypes2"
* changes:
  Describe requested visibilities in public types (3/n: server side)
  Describe requested visibilities in public types (2/n: client-server)
  Describe requested visibilities in public types (1/n: client side)
2022-10-26 06:10:04 +00:00
Yunfan Chen
b8b5ec823b Merge "Migrate Navigation Bar to InsetsFrameProvider" 2022-10-26 04:20:05 +00:00
Yeabkal Wubshit
81defaa0b4 Merge "Create VelocityTracker#getAxisVelocity API" 2022-10-25 20:35:56 +00:00
Yeabkal Wubshit
93906cabb2 Create VelocityTracker#getAxisVelocity API
This API allows clients to query the velocity over a given axis. This
became necessary as VelocityTracker starts supporting axes beyond X and
Y axes. The immediate reason why we are adding this API is to support
AXIS_SCROLL velocity. When other axes are supported in the future, no
API surface change is needed, as this API takes a target axis. See the
design doc go/velocity-tracker-for-axis-scroll for more discussions for
the API signature choice.

Bug: 32830165
Test: CTS tests
Change-Id: Ib150ea8177c1f207c277d7889ed71515a29c64d3
2022-10-25 14:57:14 +00:00
Harry Cutts
369e3cfd54 Add MotionEventTest to code pointer for adding new axes
Bug: 255408337
Test: none
Change-Id: I2c3c23569885e99a4c657ed71c73f2ba5cc47978
2022-10-25 14:08:31 +00:00
Yohei Yukawa
6980a434cd Add InputMethodSubtype#isSuitableForPhysicalKeyboardLayoutMapping()
This is a preparation for implementing Subtype-keyed physical keyboard
layout switching.

This CL introduces an @hide method

  InputMethodSubtype#isSuitableForPhysicalKeyboardLayoutMapping()

so that later CLs can be written on the same rule about what kind of
InputMethodSubtype is valid for physical keyboard layout swithcing.

Here is the current rule but it's subject to change.

 * hashCode() != 0 (SUBTYPE_ID_NONE)
 * getMode() must be "keyboard"
 * not isAuxiliary()
 * getCanonicalizedLanguageTag() returns a valid (non "und") value.

See test cases to see how it works.

Bug: 252816846
Test: atest FrameworksCoreTests:InputMethodSubtypeTest
Change-Id: Ifc0247041a43ef64f8a76a23832da2ee058c6958
2022-10-24 23:11:40 -07:00
Yohei Yukawa
1484b9e764 Add InputMethodSubtype#getCanonicalizedLanguageTag()
This is a preparation for implementing Subtype-keyed physical keyboard
layout switching.

This CL introduces an @hide method

   InputMethodSubtype#getCanonicalizedLanguageTag()

so that later CLs can be written by obtaining canonicalized BCP 47
Language Tags from InputMethodSubtype.

See test cases to see how it works.

Bug: 252816846
Test: atest FrameworksCoreTests:InputMethodSubtypeTest
Change-Id: I5276642ba83fb708e95591da9bc7fefe2810b170
2022-10-24 23:11:35 -07:00
Ady Abraham
1ff6724539 Merge "DisplayModeDirector: separate the display refresh rate and the render frame rate" 2022-10-24 17:46:26 +00:00
Yohei Yukawa
6cc102380b Merge "Call IMM#startInputInner() after releasing the lock" 2022-10-24 15:24:52 +00:00
Yunfan Chen
070ae52e71 Migrate Navigation Bar to InsetsFrameProvider
This patch is moving the navigation bar related insets logic from
DisplayPolicy to com.android.systemui.navigationbar package. To fully
match the feature, callbacks between NavigationBar and
EdgeBackGestureHandler is added to handle the nav bar button force
visible case.

Bug: 239145252
Test: DisplayPolicyInsetsTests
Test: InsetsPolicyTest DisplayPolicyTests
Test: InsetsControllerTest
Change-Id: I628a9e24df14268f2c7e92ab8ecd8d5d0d611847
2022-10-24 09:56:09 +00:00
Wilson Wu
b63dc53330 Simplify IMM#hasActiveConnectionInternal(View)
After CL[1] and CL[2], IMM#hasActiveConnectionInternal(View)
only used by onPostWindowGainedFocus(View, LayoutParams).

However, the condition only need to verify the given view is
associated with current active input connection.

Hence we can remove the mServedInputConnection.isActive() check
to simplify the method.

[1]: I64412e87c4881018ea67140f9472e10ea41836e4
[2]: I7fe8b18ffbb450fd1e272e15f06f2629518f320c

Bug: 182259171
Test: atest CtsInputMethodTestCases
Test: make -j CtsInputMethod1  \
              CtsInputMethod2  \
              CtsInputMethodServiceDeviceTests  \
              CtsInputMethodServiceEventProvider  \
              CtsInputMethodServiceHostTestCases  \
              EditTextApp  &&
      atest -it  \
      CtsInputMethodServiceHostTestCases:InputMethodServiceLifecycleTest
Change-Id: Ib0c6827c58dd082a5f70b6ec508536b24cf42dcd
2022-10-24 09:07:00 +00:00
Ady Abraham
b878a206e8 DisplayModeDirector: separate the display refresh rate and the render frame rate
Add an additional dimension to DisplayModeDirector for render frame rate
in addition to the display physical refresh rate. DisplayModeDirector aggregates the requests for both render frame rates and physical refresh rates, and sets the policy to SurfaceFlinger.
SurfaceFlinger will select the display refresh rate based on the physical refresh rate range, and schedule applications based on the render frame rate range.
This is a change over the previous logic where the render frame rate and
physical refresh rate were always the same for SurfaceFlinger.

Test: atest LocalDisplayAdapterTest DisplayModeDirectorTest
Bug: 241460058
Change-Id: I9563257c7268a731a3919ffa368f7b8ae777eb99
2022-10-21 18:16:48 -07:00
Josep del Río
af8e76c75d Merge "Add global microphone mute key for keyboard" am: e85f271021 am: 13e8df2c0a am: 34b40ae557
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263102

Change-Id: I735e363e875dd6f4a8aca6bb2d01f83322865787
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 21:43:50 +00:00
Josep del Río
34b40ae557 Merge "Add global microphone mute key for keyboard" am: e85f271021 am: 13e8df2c0a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263102

Change-Id: I31dc6e7e492de91da9def8b0ff33888edfbc0fd6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 21:19:45 +00:00
Josep del Río
13e8df2c0a Merge "Add global microphone mute key for keyboard" am: e85f271021
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2263102

Change-Id: Idf4643df3f011352ae07b1920ba2ded863ab7165
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 20:51:05 +00:00
Patrick Williams
a7cc7a5816 Merge "BBQ: Update TransactionHangCallback to pass ANR reason" 2022-10-21 14:50:37 +00:00
Ming-Shin Lu
85a70efe72 Merge "Dump InputMethodManager#{mServedView, mNextServedView} for ime tracing" 2022-10-21 01:11:41 +00:00
Patrick Williams
3bb9f289f2 BBQ: Update TransactionHangCallback to pass ANR reason
Bug: 244218818
Test: presubmits

Change-Id: I00f961c743665b1a38fe3a9e66935b11570bc3e4
2022-10-20 20:07:31 +00:00
Yohei Yukawa
0135a4793a Inline Imm.DelegateImpl#startInputOnWindowFocusGain()
This is mechanical refactoring.  There must be no behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I2253c9e76df6aca352f2ecfc5fbb27cf6eec9126
2022-10-20 09:24:53 -07:00
Yohei Yukawa
68ef29b21c Call IMM#startInputInner() after releasing the lock
While IMM#startInputInner() should not be called while the caller
already holds IMM#mH lock, it seems that there is a long standing
violation of such a rule for more than 10 years [1].

This CL finally addresses it.

The method calling order remains to be the same so hopefully the app
compat risk is low.

 [1]: I9189e6d2ac90aa8c621fdb44989728101e00329d
      31e4e14994

Bug: 234882948
Test: presubmit
Change-Id: Ib6f5a356ce5574976baefbe89e82de183b691e91
2022-10-20 08:24:17 -07:00
LiZhihong
95c1165bb8 Add global microphone mute key for keyboard
This change will enable the "mic mute" key on keyboards to globally mute
the microphone using the SensorManager, which has UI implemented in
multiple places (quick shortcuts, privacy center, settings...).

Test: manual
Bug: 237355207
Signed-off-by: LiZhihong <lizh52@lenovo.corp-partner.google.com>
Signed-off-by: DingYong <dingyong2@lenovo.corp-partner.google.com>
Change-Id: I492e501503b0ab9f56e1fa84fcc77a8c798bcb83
2022-10-20 14:59:19 +00:00
Ming-Shin Lu
bb42ab032d Dump InputMethodManager#{mServedView, mNextServedView} for ime tracing
As CL[1] migrated {mServedView, mNextServedView} from ImeFocusController
to InputMethodManager and removed its proto dump, we add it back to
imputmethodmanager.proto to keep it tracked in winscope for debugging.
(And deprecate the original fields in imefocuscontroller.proto)

[1]:Ie3446e1d0f62c489195e31fc7f073020884d6cae

Bug: 244504062
Test: manual as following steps:
   1) rebuild rom image and winscope
   2) flash the rom and reboot the device
   3) run the built winscope and connect with the device
   4) start record trace by winscope page
   5) stop recording and verify {servedView, nextServedView} can be
      shown on the ImeClient Tracing panel.
Change-Id: I1ffb63a2e1e73591e7bf349d88e1e56728ab0953
2022-10-20 22:40:12 +08:00
derek.li
6e2a429d42 [PATCH] Don't report after view detached from window.
Check window view is not null in reportKeepClearAreasChanged

Bug: 254586205
Test: CtsAutoFillServiceTestCases
Change-Id: I0db582c6f73e2a0602bfb2968e2b10536b5242d5
2022-10-20 16:34:35 +08:00
Yohei Yukawa
2174769546 Merge "Merge lock blocks around IMM#checkFocusInternal()" 2022-10-20 02:35:00 +00:00
TreeHugger Robot
9d747a7909 Merge "Introduce StartInputReason.SCHEDULED_CHECK_FOCUS" 2022-10-19 21:27:45 +00:00
Justin Ghan
316f451fb6 Merge "TextView implementation of select range and delete range gestures" 2022-10-19 20:48:54 +00:00
Justin Ghan
f7f707e51b Merge "Suppress scrolling when handwriting initiator requests focus" 2022-10-19 20:14:54 +00:00
Yohei Yukawa
c356266e25 Merge lock blocks around IMM#checkFocusInternal()
This CL removes unnecessary lock acquisitions when possible.

There must be no observable behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I1b5e5870bdf7ace6a4585c640339c6196d78af42
2022-10-19 11:34:37 -07:00
Yohei Yukawa
90ce33c315 Introduce StartInputReason.SCHEDULED_CHECK_FOCUS
With this CL,

  adb shell dumpsys input_method,

tells us about whether startInputInner() is triggered by

  InputMethodManager.DelegateImpl#onScheduledCheckFocus()

or

  InputMethodManager#checkFocus().

Other than that there must be no observable behavior change.

Bug: 234882948
Test: presubmit
Change-Id: I54ebf1a4e1f749ce265756908ef52fc63f1218e5
2022-10-19 11:34:31 -07:00
Yohei Yukawa
26b50d8f6f Merge "Rename ImeFocusController#checkFocus() to #onScheduledCheckFocus()" 2022-10-19 18:01:17 +00:00
TreeHugger Robot
5f35907147 Merge "Let IMM directly call checkFocusInternal() when possible" 2022-10-19 17:21:52 +00:00
Vishnu Nair
0310eb679e Merge "ViewRootImpl: Fix display install orientation query for transform hint" 2022-10-19 16:49:59 +00:00
Justin Ghan
1ce033402e TextView implementation of select range and delete range gestures
Bug: 247570808
Test: atest android.widget.cts.TextViewHandwritingGestureTest
Change-Id: I2cfd579c1dd213fa1847f302b56d22bda0c96f19
2022-10-19 00:32:21 -07:00
TreeHugger Robot
f3d635674a Merge "Handwriting gesture line margin" 2022-10-19 07:09:04 +00:00
Tiger
ec584382fa Describe requested visibilities in public types (3/n: server side)
This CL migrates requestedVisibilities (InsetsVisibilities) to
requestedVisibleTypes (int) at the system server side.

Bug: 253420890
Bug: 234093736
Test: atest DisplayContentTests DisplayPolicyTests
Change-Id: I35df21a4b36f3071b33455085bce903ea854dcb2
2022-10-19 14:55:42 +08:00
Yohei Yukawa
42c6de0c0f Rename ImeFocusController#checkFocus() to #onScheduledCheckFocus()
Now that

  ImeFocusController#checkFocus()

is called only from ViewRootImpl to handle MSG_CHECK_FOCUS.

Hence, it would make much more sense to rename it to

  ImeFocusController#onScheduledCheckFocus().

with also inlining hard-coded parameters.

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

Bug: 234882948
Test: presubmit
Change-Id: I354acacb2d35d378ee7bc140ac7bc6311bfec156
2022-10-18 11:44:11 -07:00
Yohei Yukawa
0135405ed5 Let IMM directly call checkFocusInternal() when possible
With this CL, the code paths from IMM#checkFocus() will be drastically
simplified as follows.

 * Before
    InputMethodManager#checkFocus()
     -> ImeFocusController#checkFocus()
      -> InputMethodManager.DelegateImpl#checkFocus()
       -> InputMethodManager#checkFocusInternal()

 * After
    InputMethodManager#checkFocus()
     -> InputMethodManager#checkFocusInternal()

In the end,

  InputMethodManager.DelegateImpl#checkFocus()

is guaranteed to be called only from ViewRootImpl.

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

Bug: 234882948
Test: presubmit
Change-Id: Ie1c7525ee46db11ccd593c6ed0ac17b4ece41953
2022-10-18 11:29:21 -07: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