Commit Graph

17149 Commits

Author SHA1 Message Date
TreeHugger Robot
5a7c74d3f4 Merge "Simplify ResultCallbacks by not using WeakReference" 2021-07-20 23:45:00 +00:00
Yohei Yukawa
682df9edbc Simplify ResultCallbacks by not using WeakReference
This is a follow up CL to my previous CL [1], which introduced
ResultCallbacks in a bit conservative way, that is, to always wrap
Completable.* with WeakReference in case the target app fails to
respond for some reasons.

Using WeakReference would make sense if otherwise we would put more
stress on the memory than holding WeakReference object itself.  In our
case the expected memory stress on extending lifetime of Completable.*
objects is still comparable with the memory cost of holding
WeakReference objects instead.  Let's remove WeakReference from
ResultCallbacks in favor of simplicity.

This change should be completely transparent to other layers since
there is no change in the semantics (except for the lifetime itself of
Completable.* object, which is technically observable with APIs such
as java.lang.ref.Cleaner).

 [1]: Ic65a95eb5d0fd56f505a02fd9083bcf6694b6734
      f87f750888

Bug: 192412909
Test: atest -c CtsInputMethodTestCases
Change-Id: I43966494ccb4fceb8e7f8c60bd6ce3cc7fbfdd82
2021-07-20 11:02:37 -07:00
Wu Ahan
5595804b3d Merge "Fix potential memory leak of FrameTracker" into sc-dev am: aef0db8f94 am: d1cb83dd08
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15334110

Change-Id: I2d10193d8215229218919070967ace99b4d50c06
2021-07-20 15:39:12 +00:00
Ahan Wu
65a3d5dfa4 Fix potential memory leak of FrameTracker
If begin and end invocations are at the same frame, the end vsync id
will be smaller than the begin vsync id, results in zero size jank info
array, the finish call will be missed as well, a leak happens.

Bug: 192140966
Test: atest FrameTrackerTest InteractionJankMonitorTest
Change-Id: I388558e60bdb84ad248a9afabe7776c4e6e67c57
2021-07-20 06:31:41 +00:00
TreeHugger Robot
75b51f31d4 Merge "Use IBooleanResultCallback when appropriate in IInputContext" 2021-07-19 22:04:15 +00:00
TreeHugger Robot
83fbe443dd Merge "Finish renaming requestUpdateCursorAnchorInfo() to requestCursorUpdates()" 2021-07-19 21:45:34 +00:00
Yohei Yukawa
14add1cb74 Use IBooleanResultCallback when appropriate in IInputContext
This is a small code clean up in IInputContext, which should have no
observable behavior change for app/IME developers.

In the following two methods we have used IIntResultCallback to return
a boolean value in a synchronous manner by using 0 to represent false
and 1 to represent true.

 * IInputContext#requestCursorUpdates
 * IInputContext#commitContent

Now that we have IBooleanResultCallback, we can just use true and
false without any conversion.

Bug: 192412909
Test: presubmit
Change-Id: Id6beaf3c9350b70138eb77f406be86fe2c8b679f
2021-07-18 23:48:23 -07:00
Yohei Yukawa
ca490fc879 Finish renaming requestUpdateCursorAnchorInfo() to requestCursorUpdates()
This is a follow up CL to my previous CL [1] in Android L, which
renamed

  InputConnection#requestUpdateCursorAnchorInfo()

to

  InputConnection#requestCursorUpdates()

per API council feedback before that API was finally published.

Although its API surface has been correctly renamed, there have been
several uses of its older name in our internal code.  This CL also
updates such internal uses to avoid confusions.

As this is a purely mechanical renaming, there should be no behavior
change in this CL.

 [1]: I772c48ff18918e48a81e807b48ff907614485c09
      d8636ea7ca

Bug: 192412909
Test: atest
Change-Id: I75701a5a32d52283497208013c28ceb75c1adfa9
2021-07-18 23:38:16 -07:00
Yohei Yukawa
b1fb07a83b Remove unused methods and classes
This is a follow up CL to my previous CL [1], which logically reverted
IInputMethodManager from emulated sync IPCs to truly sync IPCs.

There are several methods and classes that are no longer actively used
after that revert CL.  This CL also removes those unused stuff until
we we actually start using them again.

Since those methods and classes are not used right now, there should
be no user/developer visible behavior change in this CL.

 [1]: If16ac0de536d9089eb04f6e07b1ee47378124658
      662b48b72d

Bug: 192412909
Test: presubmit
Change-Id: I8666ac1399058b980e51e2459122b2f5f36c77b5
2021-07-18 23:22:04 -07:00
Dmitri Plotnikov
2c06c196c2 Merge "Fix BatteryStatsImplTest." into sc-dev am: 4162c032bf am: d6956bc287
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15291010

Change-Id: I19bc29d6bf83c8d077e9b8961fcc41100edf3f27
2021-07-16 01:05:18 +00:00
Dmitri Plotnikov
4162c032bf Merge "Fix BatteryStatsImplTest." into sc-dev 2021-07-16 00:26:16 +00:00
Dmitri Plotnikov
21dd5325fb Fix BatteryStatsImplTest.
Bug: 180015146
Test: atest FrameworksCoreTests:BatteryStatsImplTest

Change-Id: I6b43ca03ba816e12735ebd47d8cf61a6b1cee110
2021-07-15 14:51:18 -07:00
TreeHugger Robot
3685b41a2a Merge "Make Verification text shrink to zero size for long names or large fonts." into sc-dev am: 4820907a6b am: 56c1550497
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15237713

Change-Id: I13b61ece898af80fdfeca77c21600b158a1c9ea8
2021-07-14 14:07:11 +00:00
TreeHugger Robot
4820907a6b Merge "Make Verification text shrink to zero size for long names or large fonts." into sc-dev 2021-07-14 13:46:45 +00:00
Wilson Wu
89b9508a37 Merge "Add startImeTrace and stopImeTrace APIs in ImeTracing" 2021-07-14 09:00:31 +00:00
Wilson Wu
aeb5b6392d Add startImeTrace and stopImeTrace APIs in ImeTracing
So Settings DevelopmentTiles doesn't need to create direct
IInputMethodManager dependency to access system API.

Bug: 175742251
Test: Manually test ime winscope works properly
Test: make RunSettingsRoboTests ROBOTEST_FILTER="WinscopeTraceTest"
Change-Id: Ie37790c7479f6b9064afd7fbcee7fd6f712d1a75
2021-07-14 15:39:57 +08:00
Hans Boehm
d459b7d727 Merge "Use tmpArgBuffer correctly when argBuffer is null" am: a7fbddac5f am: 6d7cf56683 am: fbccd18cb1 am: 980b437c86
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1762425

Change-Id: Icf1d9d2f92eea481449f7dc0c4a4fbe2d7b8c944
2021-07-14 01:42:04 +00:00
Hans Boehm
980b437c86 Merge "Use tmpArgBuffer correctly when argBuffer is null" am: a7fbddac5f am: 6d7cf56683 am: fbccd18cb1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1762425

Change-Id: I9cd1a70e4942329b12d139e69066445cc46b17bf
2021-07-14 01:22:00 +00:00
Hans Boehm
fbccd18cb1 Merge "Use tmpArgBuffer correctly when argBuffer is null" am: a7fbddac5f am: 6d7cf56683
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1762425

Change-Id: Ie7f2e9987469c84d7f039519da3ac73120cbc1d0
2021-07-14 01:08:18 +00:00
Daniel Sandler
cba5c9b8d3 Merge changes from topic "egg12" into sc-dev am: 51204c444a am: 6b4145107f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241669

Change-Id: I258dd2c449133be0ffef274324d2e7d4c3d91477
2021-07-13 19:59:35 +00:00
Daniel Sandler
653c7f6fcf Merge changes from topic "egg12" into sc-dev am: 51204c444a am: 5bf5b00245
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241669

Change-Id: Icd29726e0386461bc592556799ccb6746cec8de0
2021-07-13 19:58:55 +00:00
Daniel Sandler
6b4145107f Merge changes from topic "egg12" into sc-dev am: 51204c444a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241669

Change-Id: I8b4f140fbb274c27322edbce630b48d0421baa07
2021-07-13 19:47:05 +00:00
Daniel Sandler
51204c444a Merge changes from topic "egg12" into sc-dev
* changes:
  Bubbling up some of these great new colors.
  AnalogClock: Allow subclasses to override the "now" instant.
2021-07-13 19:37:48 +00:00
TreeHugger Robot
00ec9a6d91 Merge "Introduce InputMethodServiceInternal for better abstraction" 2021-07-13 17:00:49 +00:00
TreeHugger Robot
f8a6eb6982 Merge "Optimize InputConnectionProtoDumper a bit" 2021-07-13 16:09:40 +00:00
Yohei Yukawa
a975bfc447 Introduce InputMethodServiceInternal for better abstraction
This is a mechanical refactoring CL that has no behavior change.

This CL removes the direct dependency on AbstractInputMethodService
from whenever possible.  As a result, the following classes no longer
directly depend on AbstractInputMethodService.

 * android.inputmethodservice.IInputMethodWrapper
 * android.inputmethodservice.RemoteInputConnection
 * com.android.internal.inputmethod.ImeTracing
 * com.android.internal.inputmethod.ImeTracingClientImpl
 * com.android.internal.inputmethod.ImeTracingServerImpl

This is still a purely mechanical refactoring.  There should be no
observable behavior change.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Test: Manually verified that IME tracing still works
Change-Id: I2aeeeacd27195ce10059d6590e098a4a969e774d
2021-07-13 15:54:10 +00:00
Dan Sandler
28f8033d80 Bubbling up some of these great new colors.
Bug: 177962166
Test: adb shell am start -n android/com.android.internal.app.PlatLogoActivity
Change-Id: I92cfe3f9e2294d888dfaa5f30591885804d8302b
2021-07-13 09:52:29 -04:00
TreeHugger Robot
2407ab11f2 Merge "Merge android.util.imetracing into com.android.internal.inputmethod" 2021-07-13 04:28:54 +00:00
Jeff DeCew
c17567ce1a Merge "Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton" into sc-dev am: d14c60be51 am: ffdbe187a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15237912

Change-Id: I0ca7582b8a7eb51e364ffd9eaf8a252ef278ee41
2021-07-13 00:52:33 +00:00
Ahaan Ugale
950376ceac Merge "Check/note ops when delivering HotwordDetectedResult" into sc-dev am: e360fc69a7 am: ab354b6d70
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241921

Change-Id: I5ea5b0e15323176c2dfcbfd0a607de1d9c356c9e
2021-07-13 00:48:14 +00:00
Jeff DeCew
ffdbe187a6 Merge "Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton" into sc-dev am: d14c60be51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15237912

Change-Id: Iab479860b685db90eee761f98d5d450bd8907a4c
2021-07-13 00:36:19 +00:00
Ahaan Ugale
ab354b6d70 Merge "Check/note ops when delivering HotwordDetectedResult" into sc-dev am: e360fc69a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241921

Change-Id: Ic5d1308896f9b8c1c7c31f17f56b446b855c1115
2021-07-13 00:34:13 +00:00
Tiger Huang
ce8184b2f5 Merge "Send more system bar attributes to System UI for logging" into sc-v2-dev am: c3d3e0ea33 am: ae12afe314
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15229896

Change-Id: I56dc73fa2ab7c4d953af00abad7c24bc967a9119
2021-07-12 20:34:08 +00:00
Mark Renouf
ecfcbc3439 Merge "Quiet down long screenshots logcat output" into sc-dev am: a7af7f8346 am: 1ac5b4b4a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15236057

Change-Id: I10d064a7abb9c131a6e71340e164d716e5fd003b
2021-07-12 20:21:57 +00:00
Mark Renouf
f809c9b7e9 Merge "Quiet down long screenshots logcat output" into sc-dev am: a7af7f8346
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15236057

Change-Id: Id86cbbd865fe93e8c59683a32a44019c6883e995
2021-07-12 20:21:05 +00:00
Tiger Huang
ae12afe314 Merge "Send more system bar attributes to System UI for logging" into sc-v2-dev am: c3d3e0ea33
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15229896

Change-Id: If0adf5f4f92b5b975ea5a4cfde023d0ccbb13ecd
2021-07-12 20:19:25 +00:00
Jeff DeCew
4e9a31b73c Merge "Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton" into sc-dev am: d14c60be51 am: 1dfc1b579b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15237912

Change-Id: I669a3703f71320fde265c1a4bbc6314d74693830
2021-07-12 20:18:26 +00:00
Jeff DeCew
b3f13370d4 Make Verification text shrink to zero size for long names or large fonts.
Fixes: 189723284
Test: manual
Change-Id: I19e327df59cd085870c04e266f053a87b35b8a54
2021-07-12 16:04:21 -04:00
Jeff DeCew
d14c60be51 Merge "Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton" into sc-dev 2021-07-12 19:48:58 +00:00
Ahaan Ugale
878ceb38cd Merge "Check/note ops when delivering HotwordDetectedResult" into sc-dev am: e360fc69a7 am: 19c940f607
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241921

Change-Id: I8d9e9d472412c113c349e6ba630949f1fd11abe3
2021-07-12 18:10:18 +00:00
Ahaan Ugale
e360fc69a7 Merge "Check/note ops when delivering HotwordDetectedResult" into sc-dev 2021-07-12 17:46:28 +00:00
Ahaan Ugale
c5e855a9d9 Check/note ops when delivering HotwordDetectedResult
This is partially a followup of
I80dabaf6ae0e781028dde16ead3321fbff319542 which removed these operations
from the SoundTrigger layer when the HotwordDetectionService is used.

Also fixes a race condition where the DSP event can go directly to the
Interactor if the DetectionService isn't connected.

Bug: 186164881
Test: atest HotwordDetectionServiceBasicTest
Test: manual - DSP and non-DSP
Change-Id: Iee3b00c6c08597ad1993fae677e9f8ae2f60744c
2021-07-12 17:42:24 +00:00
Wang Han
3688f9590c Use tmpArgBuffer correctly when argBuffer is null
* Seems to be a typo and can cause NPE.

Change-Id: I7e253c97e02767a076d9450e88ccea08c5122bb1
2021-07-11 08:13:30 +00:00
Jeff DeCew
8d6f3cc158 Use SRC_ATOP instead of SRC_IN for blending the NotificationExpandButton
Bug: 191969252
Bug: 193157438
Test: check for number of layers in the scene
Change-Id: I65bd80c71b55582347da1559cf707e9d023b7f13
2021-07-09 15:40:31 -04:00
Yohei Yukawa
26b594af10 Optimize InputConnectionProtoDumper a bit
This is a mechanical refactoring CL that has no behavior change.

Currently all the utility methods defined in
InputConnectionProtoDumper return ProtoOutputStream, while the
returned instances will always be converted into byte[] eventually.
With this CL, those utility methods return byte[] instances directly,
which is expected to make it easier for ART/dexpreopt to do more
optimizations such as code inlining because instances of
ProtoOutputStream will no longer be escaped from those methods.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Test: Manually verified that IME tracing still works
Change-Id: I7b24aee5428da312972aa86b8658429b421490f8
2021-07-09 09:46:47 -07:00
Yohei Yukawa
3beeb3e3c7 Merge android.util.imetracing into com.android.internal.inputmethod
This CL renames classes related to IME tracing as follows

 * android.util.imetracing.ImeTracing
     => com.android.internal.inputmethod.ImeTracing
 * android.util.imetracing.ImeTracingClientImpl
     => com.android.internal.inputmethod.ImeTracingClientImpl
 * android.util.imetracing.InputConnectionHelper
     => com.android.internal.inputmethod.InputConnectionProtoDumper

Other than those renamings, there should be no observable chagnes.

Fix: 175761228
Test: presubmit
Test: Manually verified that IME tracing still works
Change-Id: I6518d946e1832037f240f57aa900d3447083f1fa
2021-07-09 09:46:36 -07:00
Yohei Yukawa
20f32bd8e9 Move EditableInputConnection into com.android.internal.inputmethod
EditableInputConnection has been one of the most important and widely
used InputConnection implementations.  While having it under

  com.android.internal.widget

would still make some sense, it'd become more easier for the IMF team
to keep improveing it if EditableInputConnection is moved into

  com.android.internal.inputmethod

Anyway, EditableInputConnection has never been a public API hence just
moving its package should have no impact on app compatibility.

Bug: 192412909
Test: atest CtsInputMethodTestCases CtsWidgetTestCases:TextViewTest
Change-Id: I87974f779dbda60dfb79331cbe1ec975c475c695
2021-07-09 09:46:18 -07:00
Mark Renouf
993bf32cdd Merge "Quiet down long screenshots logcat output" into sc-dev am: a7af7f8346 am: 8ef5ca3d45
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15236057

Change-Id: I9dbbcdda155cfcbc07c0cb5854a78e28f8c5c13a
2021-07-09 15:59:59 +00:00
Mark Renouf
1ac5b4b4a1 Merge "Quiet down long screenshots logcat output" into sc-dev am: a7af7f8346
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15236057

Change-Id: Ia18a598dc9879764c4ed1ae134dec0162efcc2ff
2021-07-09 15:45:56 +00:00
TreeHugger Robot
107825105c Merge "Remove @UnsupportedAppUsage from EditableInputConnection" 2021-07-09 06:58:06 +00:00