Commit Graph

17199 Commits

Author SHA1 Message Date
Alison Cichowlas
dcce3e2682 Merge "Sharesheet: remove 2 separators, restyle the 3rd." into sc-dev am: 832779a555 am: 969473792f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377016

Change-Id: Ib98bfd73dd3e5cd09b8621685aa80bf327dd0f0f
2021-07-24 06:23:17 +00:00
Alison Cichowlas
832779a555 Merge "Sharesheet: remove 2 separators, restyle the 3rd." into sc-dev 2021-07-24 05:53:04 +00:00
Alison Cichowlas
7fe9fdd65f Merge "Sharesheet: be more defensive about un-unparcelable intents." into sc-dev am: a1d1a38269 am: 71ea7c1182
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15374840

Change-Id: I93a27e32648d6fea5b73ca9f2b487c9631d76d9c
2021-07-23 22:03:05 +00:00
Alison Cichowlas
6e6455518c Sharesheet: remove 2 separators, restyle the 3rd.
Test: Manual
Bug: 178619070
Change-Id: I9a6797863be2d0220fb71b2b9ca1d04c1f279b02
2021-07-23 21:43:22 +00:00
Alison Cichowlas
a1d1a38269 Merge "Sharesheet: be more defensive about un-unparcelable intents." into sc-dev 2021-07-23 21:31:40 +00:00
Santos Cordon
0f89c4026d Merge "SCREEN_BRIGHTNESS - map 255 to current max" into sc-dev am: e4e836a175 am: f681b22925
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15359296

Change-Id: I3995d8fbdd1508042c5ba3569679a227d59c624d
2021-07-23 20:23:19 +00:00
Santos Cordon
e4e836a175 Merge "SCREEN_BRIGHTNESS - map 255 to current max" into sc-dev 2021-07-23 20:13:55 +00:00
Alison Cichowlas
417b15994a Sharesheet: be more defensive about un-unparcelable intents.
Test: atest ChooserActivityTest
Bug: 194359789
Change-Id: I2fb0c0e120f048042dea499e1ffc126989e0e2d2
2021-07-23 12:17:29 -04:00
Yohei Yukawa
b72545e7b1 Remove unnecessary "I" from IIInputContentUriTokenResultCallback
This is a mechanical refactoring CL that does nothing but remaning

  IIInputContentUriTokenResultCallback

to

  IInputContentUriTokenResultCallback.

There should be no observable behavior change in this CL.

Bug: 173340613
Bug: 194308519
Test: presubmit
Change-Id: Id37fd7c44145934aea42d7944e5b212c6ff543f6
2021-07-23 08:52:11 -07:00
Alison Cichowlas
1afbd902cb Merge "Sharesheet: action bar is independent of WP tabs, should always launch as primary user." into sc-dev am: 9197f7b260 am: ac0fe8d049
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15363687

Change-Id: I6f828ffbf403884eb1f24778bccbd7a6ab5bdb59
2021-07-23 15:26:16 +00:00
Alison Cichowlas
9197f7b260 Merge "Sharesheet: action bar is independent of WP tabs, should always launch as primary user." into sc-dev 2021-07-23 14:54:12 +00:00
Dmitri Plotnikov
bf55fd64ff Merge "Fix KernelCpuUidUserSysTimeReaderTest#testThrottler by injecting a mock clock" 2021-07-23 01:35:00 +00:00
Alison Cichowlas
f0657fc49e Sharesheet: action bar is independent of WP tabs, should always launch
as primary user.

Bug: 193424706
Test: atest ChooserActivityTest; manual per bug steps

Change-Id: Ie680270fa6a62ec59f35715514bfc0232b0d12f9
2021-07-22 20:43:21 -04:00
Dmitri Plotnikov
d378715dee Fix KernelCpuUidUserSysTimeReaderTest#testThrottler by injecting a mock clock
Bug: 180015146
Bug: 180473895
Test: atest FrameworksCoreTests:KernelCpuUidUserSysTimeReaderTest#testThrottler
Change-Id: I441646b4d5817b62c34bea9cccf0a5a13901736b
2021-07-22 14:57:37 -07:00
Yohei Yukawa
626c33cfea Remove unused methods and classes from Completable class
This is hopefully the last follow up CL to my previous CL [1], which
aimed to logically revert IInputMethodManager from emulated sync IPCs
to truly sync IPCs.

It turns out that my previous clean-up CL [2] forgot to take care of
the following class

  com.android.internal.inputmethod.Completable,

where several unused methods and classes still existed.

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
 [2]: I8666ac1399058b980e51e2459122b2f5f36c77b5
      b1fb07a83b

Bug: 192412909
Test: presubmit
Change-Id: Id5d5a4abeff8291b40baf95d425f4035d3cddffe
2021-07-22 14:00:54 -07:00
TreeHugger Robot
407b327fc7 Merge "A unified data class to represent all the InputConnection call" 2021-07-22 20:26:16 +00:00
TreeHugger Robot
d0f65ce476 Merge changes from topic "a11y_gesture_s-sc-v2-dev" into sc-v2-dev am: ede423187b am: 5f9942df32
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15124972

Change-Id: Ie695d84624595ecbf479d6d724be5f191ead4619
2021-07-22 19:26:21 +00:00
TreeHugger Robot
5f9942df32 Merge changes from topic "a11y_gesture_s-sc-v2-dev" into sc-v2-dev am: ede423187b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15124972

Change-Id: I8d6c0a1842b367db8622f7144fbde02bb2a7fa3c
2021-07-22 19:12:17 +00:00
TreeHugger Robot
ede423187b Merge changes from topic "a11y_gesture_s-sc-v2-dev" into sc-v2-dev
* changes:
  Add the log for new supported accessibility button type 'Accessibility Gesture'
  Update the supported type in ACCESSIBILITY_BUTTON_MODE according to navigation gestural mode or button mode
  Add a supported type 'gesture' under ACCESSIBILITY_BUTTON_MODE
2021-07-22 18:53:58 +00:00
Yohei Yukawa
2757c24880 A unified data class to represent all the InputConnection call
This CL introduces a new parcelable class InputConnectionCommand so
that any of existing and future InputConnection APIs can be marshalled
into a standard Java object, which itself can be a subject of other
useful operations.

Historically each InputConnection API has had a corresponding IPC
definition in IInputContext binder interface, which is indeed a widely
used design pattern in the Android OS [1].  Instead of continuing
doing so, this CL reimplements everything by a single unified IPC
method with a single unified Parcelable data object existing and
future InputConnection APIs.  Although doing so would introduce some
complexity, it also gives us huge flexibility and opportunities to
abstract out common data structure and operations across all the
InputConnection API calls.

For instance, here are code snippets we can now simply write.

  ArrayList<InputConnectionCommand> pendingTasks;

  void dumpToProto(@NonNull InputConnectionCommand command) {
     ...
  }

  void cancelPendingTasks(Predicate<InputConnectionCommand> cond) {
    ...
  }

to do more complex abstractions as needed.

Other than rewriting InputConnection remote execution in a different
manner, this CL changes nothing.  There should be no developer/user
visible behavior changed in this CL, which can also be verified with
CtsInputMethodTestCases:InputConnectionEndToEndTest.

 [1]: This is not a hard requiement though. In fact there is already
      android.os.Messenger that has been used in several places in the
      system.  What android.os.Messenger does is semantically the same
      as what IInputConnectionWrapper is going to do with this CL.

Fix: 194151409
Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest
Test: atest FrameworksCoreTests:InputMethodDebugTest
Change-Id: I86eba7185b4b0664c1b0b3da794dfc5eeddc725c
2021-07-22 11:03:05 -07:00
Santos Cordon
002e656a51 SCREEN_BRIGHTNESS - map 255 to current max
Since the current max can change for brightness due to
high-brightnes-mode (HBM), make it so that 255 is always mapped
to the current max, which can be different when in HBM or normal
brightness mode.

Bug: 187784093
Test: atest HighBrightnessModeControllerTest
Test: manually verify 255 is used for max when in HBM or not.
Change-Id: Ib0631fc12de0e8e4c7c638901d82c362e79944c3
2021-07-22 18:34:37 +01:00
Nikita Ioffe
cc2578c34b Restrict what APEXes different installers can update am: e501fd8379 am: 85af284b2f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15331871

Change-Id: I62b1ad90cd47aee96437de8bf8d36e5ef9cc111d
2021-07-22 17:26:55 +00:00
Nikita Ioffe
9e0f4ac414 Merge changes from topic "apex-installers-restriction" into sc-dev am: e8b129351c am: 476c20cf84
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15347597

Change-Id: Ia18fd231d7bba4fb168a4c7e2419ef26b9baa099
2021-07-22 17:22:48 +00:00
Nikita Ioffe
85af284b2f Restrict what APEXes different installers can update am: e501fd8379
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15331871

Change-Id: I06443f46326c1a877d7245ba913e0261432db352
2021-07-22 16:56:05 +00:00
Arthur Hung
a6564536e6 Merge "Fix pointer location apply wrong insets in foldable device" into sc-v2-dev am: c923e35a3c am: 76f074094c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15334686

Change-Id: I4e45e2bb2346180a32b8446ad982759f27c7244c
2021-07-22 03:49:26 +00:00
Arthur Hung
76f074094c Merge "Fix pointer location apply wrong insets in foldable device" into sc-v2-dev am: c923e35a3c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15334686

Change-Id: Iae47db3ceb8cb0a09ef4bed77bd2a7a7c5d485af
2021-07-22 03:48:12 +00:00
Arthur Hung
c923e35a3c Merge "Fix pointer location apply wrong insets in foldable device" into sc-v2-dev 2021-07-22 03:31:54 +00:00
TreeHugger Robot
cfd82c0521 Merge "Remove @UnsupportedAppUsage from IInputConnectionWrapper#mLock" 2021-07-22 03:17:15 +00:00
TreeHugger Robot
afc5c55592 Merge "Remove @UnsupportedAppUsage from IInputConnectionWrapper#mInputConnection" 2021-07-21 19:24:24 +00:00
Yohei Yukawa
d52a271e64 Remove @UnsupportedAppUsage from IInputConnectionWrapper#mLock
We are mostly confident that this @UnsupportedAppUsage was a false
positive.

Bug: 170729553
Fix: 194299196
Test: presubmit
Change-Id: I0967db5742dcfa1ef55046cac283a683f1a56a94
2021-07-21 10:23:58 -07:00
Yohei Yukawa
88d597b988 Remove @UnsupportedAppUsage from IInputConnectionWrapper#mInputConnection
As already mentioned in Bug 115609023 and confirmed in Bug 194297014,
we are mostly confident that this @UnsupportedAppUsage was a false
positive.

Bug: 115609023
Fix: 194297014
Test: presubmit
Change-Id: Ie70099c2f5f926ce64324998a61eb54649e553f9
2021-07-21 10:23:08 -07:00
Nikita Ioffe
e501fd8379 Restrict what APEXes different installers can update
* Mainline APEXes can only be updated by a modulesInstaller (an entry
in whitelisted-staged-installer.xml with isModulesInstaller="true")

* The whitelisted-staged-installer.xml file can have only one entry with
isModulesInstaller="true"

* Vendor APEXes can only be updated by an installer defined in the
corresponding entry in vendor-apex-allowlist.xml.

BYPASS_INCLUSIVE_LANGUAGE_REASON=existing occurrences

Test: atest StagedInstallInternalTest
Test: atest GtsStagedInstallHostTestCases
Test: atest CtsRollbackManagerHostTestCases
Test: atest CtsStagedInstallHostTestCases
Bug: 190802380
Change-Id: I729abb5153df079fb6885016a4b41d0acc827e3c
2021-07-21 16:44:42 +01:00
Arthur Hung
da2fc25475 Fix pointer location apply wrong insets in foldable device
Uses LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS to let the pointer location
window could be allowed to extend into the cutout areas so we could
draw the trace points on whole screen.

This CL would also apply the waterfall insets in pointer location view,
so we could layout the label properly when apply such cutout.

Bug: 193206093
Test: atest DisplayPolicyLayoutTests
Test: atest DisplayPolicyInsetTests
Change-Id: I62f0de44820d154383f92632fdd1c86fceaae10c
2021-07-21 09:44:33 +00:00
TreeHugger Robot
95ccc85b73 Merge "Fix concurrency of BatteryStats cleanup after user removal" 2021-07-21 01:02:23 +00:00
TreeHugger Robot
5a7c74d3f4 Merge "Simplify ResultCallbacks by not using WeakReference" 2021-07-20 23:45:00 +00:00
Dmitri Plotnikov
ece4ef7393 Fix concurrency of BatteryStats cleanup after user removal
Bug: 193742542
Bug: 180015146
Test: atest --rerun-until-failure 20 FrameworksCoreTests:BatteryStatsUserLifecycleTests#testNoCpuDataForRemovedUser

Change-Id: If45cbf0be6c29fc99771053c6a0ec34c60e293a8
2021-07-20 16:09:08 -07: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
ffc06d6b53 Merge "Fix potential memory leak of FrameTracker" into sc-dev am: aef0db8f94 am: 51b46e36b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15334110

Change-Id: I18558faf8bec3395a30b5dbd5ee222dc29b90e43
2021-07-20 15:39:39 +00: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
Wu Ahan
51b46e36b9 Merge "Fix potential memory leak of FrameTracker" into sc-dev am: aef0db8f94
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15334110

Change-Id: I8fc1922802a844530d43dc9462fc8d801094f3e9
2021-07-20 15:27:53 +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
fa116b0d18 Merge "Fix BatteryStatsImplTest." into sc-dev am: 4162c032bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15291010

Change-Id: Id5ffe3ff3b7b44299955b8b8c9cb322519688021
2021-07-16 02:04:04 +00:00
Dmitri Plotnikov
1a07db84ef Merge "Fix BatteryStatsImplTest." into sc-dev am: 4162c032bf am: c37c2ba216
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15291010

Change-Id: I037fc83983dd3a564c64be11fa870dae23824954
2021-07-16 01:06:05 +00: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
c37c2ba216 Merge "Fix BatteryStatsImplTest." into sc-dev am: 4162c032bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15291010

Change-Id: Ib21cd08963534c6622d095c0b3d6b7ebc4a97bcc
2021-07-16 00:48:02 +00:00