Commit Graph

19370 Commits

Author SHA1 Message Date
Yohei Yukawa
a6a2072452 Enable background users to call IMM#getCurrentInputMethodSubtype()
This is a follow up CL to my previous CLs [1][2], which let query APIs
defined in InputMethodManager support background users.

With this CL,

  InputMethodManager#getCurrentInputMethodSubtype()

is also fully supported under multi-user / multi-profile environment.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd
 [2]: I48f57dc7184e85bdb422fd9d1d56e60381654125
      e960986554

Bug: 34886274
Bug: 122164939
Bug: 237316307
Test: atest CtsInputMethodTestCases:InputMethodSubtypeTest
Change-Id: Icb09f9cb1a4147884faa9952b2e03ec4afa9f0b1
2022-07-28 09:04:20 +09:00
Matt Gilbride
bf5d6f3e9c Merge "@EnforcePermission migrations - services.core" 2022-07-27 15:46:03 +00:00
TreeHugger Robot
6ef60a6c04 Merge "Let startInputOrWindowGainedFocus() take userId" 2022-07-27 05:04:11 +00:00
Yohei Yukawa
d6ce057f18 Let startInputOrWindowGainedFocus() take userId
This CL lets

  IInputMethodManager#startInputOrWindowGainedFocus()

take the useId as an explicit input parameter for consistency with
other IPC methods that are annotated with

  @RequiresPermission(
      value = INTERACT_ACROSS_USERS_FULL,
      conditional = true).

Doing so enables us to

 1. easily assume that INTERACT_ACROSS_USERS_FULL is necessary only
    when userId parameter is different from the calling user ID.
 2. place caller verification at the beginning of
      InputMethodManagerService#startInputOrWindowGainedFocus()
    like we do so in other Binder IPC methods.

There should be no semantic change in this CL.  This CL is purely for
better readability.

Bug: 34886274
Bug: 237316307
Test: presubmit
Change-Id: I2755fd1f2425f1c0186d46a8e4d62995c8283050
2022-07-27 09:57:32 +09:00
Yohei Yukawa
f033a75cf5 Add @RequiresNoPermission to IInputMethodManager#startProtoDump()
This is a follow up CL to our previous CL [1], which introduced

  IInputMethodManager#startProtoDump()

so that IME client process can upload its own IME tracing dump data
to InputMethodManagerService.

One may notice that there is no permission / caller verification in

  InputMethodManagerService#startProtoDump(),

but the absence of a permission check there is by design. We need
unprivileged app processes to be able to send that tracing data. To
make it clear in the AIDL file, this CL adds @RequiresNoPermission to
that IPC method.

The annotation is basically for errorprone check [2].  There should be
no observable behavior change at the run time.

 [1]: Ia89f11d5ef8a220ea7746191b18769cea5a8359d
      cf9e5123ce
 [2]: I26a872f07ab13931c241cbb02ff7228edf7dc3b9
      71463a4cb1

Bug: 204904070
Bug: 237316307
Test: presubmit
Change-Id: Ia41be32333a668cbf112ba7394bcca8c8ba7db6a
2022-07-27 07:52:28 +09:00
TreeHugger Robot
a8f475137c Merge "Protect IME tracing IPCs with CONTROL_UI_TRACING" 2022-07-26 22:17:31 +00:00
Yohei Yukawa
e960986554 Support background users to call IMM#getLastInputMethodSubtype()
This is a follow up CL to my previous CL [1], which let query APIs
defined in InputMethodManager support background users.

With this CL,

  InputMethodManager#getLastInputMethodSubtype()

is also fully supported under multi-user / multi-profile environment.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 34886274
Bug: 122164939
Test: atest CtsInputMethodTestCases:InputMethodSubtypeTest
Change-Id: I48f57dc7184e85bdb422fd9d1d56e60381654125
2022-07-26 08:12:34 +09:00
Yohei Yukawa
19e18b6c85 Let getEnabledInputMethodSubtypeList() take userId
This CL lets

  IInputMethodManager#getEnabledInputMethodSubtypeList()

take the useId as an input parameter for consistency with other query
methods.

There should be no developer observable behavior change because now

  InputMethodManager#getEnabledInputMethodSubtypeList()

specifies its own user ID.

Bug: 34886274
Test: make -j CtsInputMethod1  \
                CtsInputMethod2  \
                CtsInputMethodServiceDeviceTests  \
                CtsInputMethodServiceEventProvider  \
                CtsInputMethodServiceHostTestCases  \
                EditTextApp  &&
        atest CtsInputMethodServiceHostTestCases
Change-Id: Ie213ef7e04d6337e303ea331d0a00c7d7f9a6d1a
2022-07-26 08:12:26 +09:00
Yohei Yukawa
010eef5283 Protect IME tracing IPCs with CONTROL_UI_TRACING
With this CL, the following IPCs start requiring callers to have
CONTROL_UI_TRACING permission [1].

 * IInputMethodManager#startImeTrace()
 * IInputMethodManager#stopImeTrace()

Note that the following shell commands

 adb shell cmd input_method tracing start
 adb shell cmd input_method tracing stop

should not be affected by this CL because those commands are directly
handled by

 * IInputMethodManager#onShellCommand(),

which has been guarded with calling UID check [2].

 [1]: Ibdeb38dc9a066cb8ed2904adcdac29014b166526
      2ad02a383b
 [2]: If87189563ccaacd4f9c666bab4f9ad08a9343084
      b8d240fa3f

Bug: 34886274
Bug: 172444310
Bug: 237316307
Test: make RunSettingsRoboTests ROBOTEST_FILTER="WinscopeTraceTest"
Test: Manually verifies as follows.
  1. build aosp_coral-userdebug and flash it.
  2. Go to System Settings.
  3. Enable Developer Mode.
  4. Go to Developer Options.
  5. Tap "Quick settings developer tiles"
  6. Enable "Winscope Trace"
  7. Pull down the quick settings drawer then Tap Winscope Trace.
  8. Tap some edit field to show AOSP Keyboard.
  9. Pull down the quick settings drawer then Tap Winscope Trace.
 10. adb root
 11. adb shell ls -al /data/misc/wmtrace/
 12. Make sure that tracing files are saved there.
Test: Manually verifies as follows.
  1. build aosp_coral-userdebug and flash it.
  2. adb shell cmd input_method tracing start
  3. Tap some edit field to show AOSP Keyboard.
  4. adb shell cmd input_method tracing stop
  5. adb root
  6. adb shell ls -al /data/misc/wmtrace/
  7. Make sure that tracing files are saved there.
Test: Manually verifies as follows.
  1. build aosp_coral-userdebug and flash it.
  2. adb root
  3. adb shell cmd input_method tracing start
  4. Tap some edit field to show AOSP Keyboard.
  5. adb shell cmd input_method tracing stop
  6. adb shell ls -al /data/misc/wmtrace/
  7. Make sure that tracing files are saved there.
Change-Id: Iaee7be9fb5066664b283a64273bf8685ba966046
2022-07-25 18:38:36 +09:00
Eric Biggers
cd671e384b Merge "Update synthetic password terminology to match new design doc" 2022-07-22 18:56:36 +00:00
Eric Biggers
c37987fe0d Update synthetic password terminology to match new design doc
Update terminology to eliminate ambiguity and to match
http://go/android-locksettings-design :

- The class that represents a synthetic password is now called
  SyntheticPassword instead of AuthenticationToken.  This eliminates an
  inconsistency and avoids ambiguity with the other types of
  authentication tokens (HardwareAuthTokens and escrow tokens).

- "LSKF" is now used in preference to "password", which could be
  confused with LSKFs of type password and with the many other types of
  password (synthetic, Keystore, Gatekeeper).  "Password" is still used
  in places like "password data", "password metrics", and "password
  history"; renaming those in the design doc and code is left for later.

- The things that protect the SP are now called "SP protectors", or just
  "protectors" when SP is clear from context.  Previously these were
  called "synthetic passwords" (ambiguous with the SP) or "SP blobs"
  (ambiguous with the spblob file, which is just part of a protector).

- The 64-bit integers that identify protectors are now called "protector
  IDs" instead of "synthetic password handles".  This avoids ambiguity
  with the SP's Gatekeeper password handle (which in the code is just
  called a "synthetic password handle"; a later CL might clarify that),
  and it clarifies that the identified items are SP protectors, not SPs.

- The secret that each protector uses to protect the SP is now called
  the "protector secret" instead of the application ID.  This avoids
  ambiguity with the Keystore application ID, which isn't being used and
  is a less intuitive name.

No behavior changes intended, except for some changed log messages.

Test: atest com.android.server.locksettings
Test: Basic manual test of locksettings core functionality: upgraded a
      device that has a pattern set, without wiping userdata; unlocked;
      changed to PIN; rebooted; unlocked; changed to swipe; rebooted;
      changed to password; rebooted; and unlocked.
Change-Id: I564a738119a47a31b4822d26c6405249f8ce1c06
2022-07-21 18:27:44 +00:00
TreeHugger Robot
fadc810a48 Merge "Merge IInputMethodManager#get{,AwareLocked}InputMethodList" 2022-07-20 06:29:08 +00:00
Eric Biggers
1e1c820d96 Merge "Remove obsolete locksettings db migrations" 2022-07-19 22:12:31 +00:00
Jeff Sharkey
d0c1067185 Merge changes from topic "jul15" am: 0e27faa039 am: 954431c4df am: fd0915aeec am: 70123a912d am: ad18b6f58c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2155659

Change-Id: Ie4563a12b72d038baeb952537c867b598db2c30e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 21:11:20 +00:00
Jeff Sharkey
ad18b6f58c Merge changes from topic "jul15" am: 0e27faa039 am: 954431c4df am: fd0915aeec am: 70123a912d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2155659

Change-Id: I6d5cc1577c71cf60fe16c62d5523cfb5c3a10468
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 20:20:04 +00:00
Jeff Sharkey
954431c4df Merge changes from topic "jul15" am: 0e27faa039
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2155659

Change-Id: Ie949e0bb40967581190f7b98bb5005bab19cb7fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 19:12:28 +00:00
Yohei Yukawa
1fb9a87bdb Merge IInputMethodManager#get{,AwareLocked}InputMethodList
This is a follow up CL to our previous CL [1], which introduced

  IInputMethodManager#getAwareLockedInputMethodList

as a variant of

  IInputMethodManager#getInputMethodList.

This CL mechanically merges those two IPC entries into one entry as
specifying

  DirectBootAwareness.AUTO

is something we can do in the IME client side, without changing any
observable semantics.

 [1]: I54d5dbec7e76d6a68935007ed3af0641f717a7c5
      04a226334d

Bug: 210083408
Bug: 234882948
Test: presubmit
Change-Id: Ic02484fcbb9c1bbd8e964bb7a2f7acff904e2a33
2022-07-19 11:56:30 -07:00
Jeff Sharkey
c6b3699b63 Offer explicit 3-byte vs 4-byte modified UTF-8.
As documented in art/runtime/jni/jni_internal.cc, ART has deviated
from the RI by using a 4-byte encoding instead of the 3-byte encoding
required by the JNI specification.

Some users are okay with this 4-byte encoding (where they control
both the reading and writing logic) but other users require
compatibility with the DataOutput/DataInput API contract, so this
change lets users request either behavior.

This change now exercises all tests in both 4-byte and 3-byte modes,
and exhaustively confirms that all valid code-points match the
DataOutput/DataInput contract when in 3-byte mode.

Benchmark results still show significant performance benefits when
using this 3-byte encoding over the upstream RI:

    timeRead_Upstream_mean (ns):                  5090068
    timeRead_LocalUsing3ByteSequences_mean (ns):  1996032
    timeRead_LocalUsing4ByteSequences_mean (ns):  1813250

    timeWrite_Upstream_mean (ns):                 3856276
    timeWrite_LocalUsing3ByteSequences_mean (ns): 1632697
    timeWrite_LocalUsing4ByteSequences_mean (ns):  886503

Bug: 236923096
Test: atest FrameworksCoreTests:CharsetUtilsTest
Test: atest FrameworksCoreTests:FastDataTest
Test: atest FrameworksCoreTests:XmlTest
Test: atest FrameworksCoreTests:BinaryXmlTest
Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:FastDataPerfTest
Change-Id: Ibddd36410a0d4a909522de011f23a337b53d6889
2022-07-19 10:36:37 -06:00
Yohei Yukawa
ea675ead0a Implement IMM#showInputMethodAndSubtypeEnabler() in the client side
With this CL,

  InputMethodManager#showInputMethodAndSubtypeEnabler()

is fully implemented in the client side.  By not using system_server
privileged context to launch the Settings activity, we can stop
worrying about conflicts with existing security concepts such as

 * Background Activity launch blocking mechanism
 * Restrictions for instant apps

Bug: 34886274
Test: Manually verified as follows.
 1. Build aosp_coral-userdebug and flash it.
 2. adb install -r $ANDROID_TARGET_OUT_TESTCASES/ApiDemos/arm64/ApiDemos.apk
 3. adb shell am start -n com.example.android.apis/.ApiDemos
 4. View -> Input Method -> ShowInputMethodAndSubtypeEnabler
 5. Verify that the API works.
Change-Id: I5199ca4609c03900a0e86011d344b054b1df08dd
2022-07-18 22:31:40 -07:00
Eric Biggers
ce64edf40d Remove obsolete locksettings db migrations
Remove migration code that was only needed on devices upgrading to much
earlier versions of Android:

- "migrated" and "migrated_user_specific" were only needed for upgrades
  to Android K (http://ag/297566)

- "migrated_biometric_weak" was only needed for upgrades
  to Android M (http://ag/609529)

- "migrated_lockscreen_disabled" was only needed for upgrades
  to Android M (http://ag/677350).

- "migrated_wear_lockscreen_disabled" was only needed for upgrades
  to Android O (http://ag/1595971).

Leave the "migrated_keystore_namespace" one for now, as it's
significantly more recent (needed for upgrades to Android S).

Change-Id: Ia69b8baf1995dd6deba8cf58440a481542c67bba
2022-07-19 00:09:44 +00:00
TreeHugger Robot
5e11ce8ca7 Merge "Use @EnforcePermission for IIMM#addVirtualStylusIdForTestSession()" 2022-07-18 21:57:40 +00:00
mattgilbride
95c4dc01cd @EnforcePermission migrations - services.core
Immediate calls to Context.enforceCallingOrSelfPermission.  Fixes
applied by Android Lint (cl/18432857).

Bug: 232058525
Test: Existing tests still pass
Change-Id: I4c3c70241ac18d1435af4b13c1b7da90f0b8bb70
2022-07-18 15:13:42 +00:00
Yohei Yukawa
80b2911d01 Use @EnforcePermission for IIMM#addVirtualStylusIdForTestSession()
This CL manually migrates

  IInputMethodManager#addVirtualStylusIdForTestSession(),

which was added recently [1], from manual permission check with

  Context#enforceCallingPermission(INJECT_EVENTS)

to code-generation check with

  @EnforcePermission("INJECT_EVENTS").

There should be no observable semantic behavior change in this CL.

 [1]: I7399c0a56c04f024d65c16d459818cc2c5cdbc7f
      d96ef57bc4

Bug: 34886274
Bug: 210039666
Bug: 232058525
Bug: 237316307
Test: atest CtsInputMethodTestCases:InputMethodManagerTest#testShowInputMethodPickerFromSystemProtection
Change-Id: Ida227d417496dd91c071c38ca0be003529764de4
2022-07-15 21:44:29 -07:00
Yohei Yukawa
f2e9812cfe Use @EnforcePermission for IIMM#showInputMethodPickerFromSystem()
This CL manually migrates

  IInputMethodManager#showInputMethodPickerFromSystem(boolean, int)

from manual permission check with

  Context#checkCallingPermission(WRITE_SECURE_SETTINGS)

to code-generation check with

  @EnforcePermission("WRITE_SECURE_SETTINGS").

There should be no observable semantic behavior change in this CL.

Bug: 34886274
Bug: 232058525
Bug: 237316307
Test: manually verified that SecurityException is thrown
Change-Id: I9d1be1aa65276fcc50c2868fed6b0447d54ff7ee
2022-07-15 17:24:47 -07:00
Alex Buynytskyy
2be5b4c118 Cache least recently used output buffer.
- reduce memory allocations especially when Xml is serialized inside a
tight inner loop,
- performance slightly improved.

BEFORE:
100 packages:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.516s)
	timeWrite_Binary_mean: 674979
	threadAllocCount_mean: 59
	timeWrite_Binary_min: 671194
	timeWrite_Binary_median: 674798
	timeWrite_Binary_standardDeviation: 3658
	threadAllocSize_mean: 530176
10 packages:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.542s)
	timeWrite_Binary_mean: 71113
	threadAllocCount_mean: 56
	timeWrite_Binary_min: 70201
	timeWrite_Binary_median: 71237
	timeWrite_Binary_standardDeviation: 692
	threadAllocSize_mean: 59136
1 package:
[2/4] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.091s)
	timeWrite_Binary_mean: 15698
	threadAllocCount_mean: 56
	timeWrite_Binary_min: 15072
	timeWrite_Binary_median: 15677
	timeWrite_Binary_standardDeviation: 410
	threadAllocSize_mean: 6439

AFTER:
100 packages:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.221s)
	timeWrite_Binary_mean: 605862
	threadAllocCount_mean: 53
	timeWrite_Binary_min: 602353
	timeWrite_Binary_median: 604424
	timeWrite_Binary_standardDeviation: 4972
	threadAllocSize_mean: 492748
10 packages:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.575s)
	timeWrite_Binary_mean: 58710
	threadAllocCount_mean: 50
	timeWrite_Binary_min: 57551
	timeWrite_Binary_median: 57798
	timeWrite_Binary_standardDeviation: 2129
	threadAllocSize_mean: 21696
1 package:
[1/1] android.util.XmlPerfTest#timeWrite_Binary: PASSED (10.151s)
	timeWrite_Binary_mean: 11576
	threadAllocCount_mean: 50
	timeWrite_Binary_min: 11315
	timeWrite_Binary_median: 11381
	timeWrite_Binary_standardDeviation: 431
	threadAllocSize_mean: 4336

Test: atest FastDataPerfTest XmlPerfTest
Bug: 195994150
Fixes: 195994150

Merged-In: Ieedd27a676d718967c2fac30bc48a68ae636a180
Change-Id: Ieedd27a676d718967c2fac30bc48a68ae636a180
2022-07-15 16:07:19 -06:00
Wilson Wu
956374833a Improve API annotation for InputMethodManager
Annotate null-ness for APIs and parameter for
InputMethodManager, IInputMethodManagerInvoker
and IInputMethodManager.aidl.

This is a annotation improvement without any user
visible changes.

Bug: 237959367
Test: presubmit
Change-Id: I426fb9ca9009f0f91a4d2d6a39094ea9c20671f7
2022-07-15 18:21:45 +08:00
TreeHugger Robot
ff66e490bf Merge "Ensure all FrameTracker invocation run on either main or ui thread" into tm-qpr-dev am: 91a0bbdddf am: de8e7777c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18654746

Change-Id: I6fed511a8c1e9c87622f20fbf13f37f5d59559a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 20:52:02 +00:00
TreeHugger Robot
de8e7777c8 Merge "Ensure all FrameTracker invocation run on either main or ui thread" into tm-qpr-dev am: 91a0bbdddf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18654746

Change-Id: I2b159823f2952f1de43f11bdbeadfe6971767471
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 20:45:08 +00:00
TreeHugger Robot
91a0bbdddf Merge "Ensure all FrameTracker invocation run on either main or ui thread" into tm-qpr-dev 2022-07-14 20:25:06 +00:00
Eric Biggers
a2b5e1c75f Merge "Remove the "locksettings sp" shell command" 2022-07-14 17:08:55 +00:00
Bill Lin
214e664c31 Merge "Instrument CUJ_SHADE_CLEAR_ALL with InteractionJankMonitor" into tm-qpr-dev am: fb4fdcee9c am: bfb19f11fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19272632

Change-Id: I3ead9cbcbb790758f0ac9e760a1ecbafcc850e0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 16:20:03 +00:00
Bill Lin
bfb19f11fc Merge "Instrument CUJ_SHADE_CLEAR_ALL with InteractionJankMonitor" into tm-qpr-dev am: fb4fdcee9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19272632

Change-Id: I3f8a0c7dc1ae8239855977c73c13d9ff289c5cda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 16:00:53 +00:00
Ahan Wu
f7bd2bc6ba Ensure all FrameTracker invocation run on either main or ui thread
FrameTracker has some ViewRootImpl invocations that it would be better
to make FrameTracker accesses run on either main or ui thread.

Bug: 200938639
Test: atest InteractionJankMonitorTest FrameTrackerTest
Change-Id: I91e9536293a694f3d110bda583a32b5918c96c55
2022-07-14 09:34:04 +00:00
lbill
03e80d715b Instrument CUJ_SHADE_CLEAR_ALL with InteractionJankMonitor
In NotificationStackScrollLayout
- Begin instrument in clearNotifications()
- End in onClearAllAnimationsEnd()

Note: due to all child views run clear anim concurrently,
we just monitor parent(NSSL).

Bug: 238863970
Test: atest SystemUITests
Test: make and get perfetto trace
Change-Id: I705d03357a5a458a7f9eae5ecc5c4cfd7811cf7c
2022-07-14 07:59:12 +00:00
Eric Biggers
11e4762be4 Remove the "locksettings sp" shell command
This command no longer does anything, and I couldn't find any evidence
that anyone is using it.

Bug: 146040259
Change-Id: I48867bbfa2d5ca34286d7050f7f5a255803e2ada
2022-07-14 00:36:45 +00:00
Yohei Yukawa
667a08b04c Merge "Protect isInputMethodPickerShown() with TEST_INPUT_METHOD permission" 2022-07-13 18:02:52 +00:00
Alex Buynytskyy
f8dcaf2fc0 Merge "Forcefully convert to basic Intent before calling PM API." into tm-qpr-dev am: aec1a526b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19221809

Change-Id: I1ea0c55c86bf8a53c4668042fa2a8e8df22441b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 16:40:36 +00:00
Matt Gilbride
10fed4a2ec Merge "@EnforcePermission migrations - other services" 2022-07-13 11:31:01 +00:00
Yohei Yukawa
b869c78380 Protect isInputMethodPickerShown() with TEST_INPUT_METHOD permission
IInputMethodManager#isInputMethodPickerShownForTest() was introduced
in Android P (API 28) to verify IME picker visibility in CTS [1].

To make it clear that that IPC method must be available only for
special testing purpose, this CL introduces an @hide permission

   android.permission.TEST_INPUT_METHOD

and requires it in

   InputMethodManagerService#isInputMethodPickerShownForTest().

This CL grants that permission to the shell process hence CTS tests
can still access to the corresponding test API by using
UiAutomation#adoptShellPermissionIdentity().

 [1]: I4e21625c32a0ca1abc740229efb3c7fcd97141cc
      eb5706183f

Bug: 237317525
Test: atest CtsInputMethodTestCases
Test: Manually verified as follows.
 1. adb logcat -b events | grep 237317525
 2. atest CtsInputMethodTestCases:InputMethodManagerTest#testIsInputMethodPickerShownProtection
Ignore-AOSP-First: For a security fix
Change-Id: Ie79a3e9d41ce22605ae083594d639c37d08b7def
2022-07-12 19:03:26 -07:00
Matt Gilbride
941bde91bc Merge "@EnforcePermission migrations - services.core" 2022-07-12 15:27:14 +00:00
mattgilbride
f48d794e01 @EnforcePermission migrations - services.core
Immediate calls to Context.enforceCallingPermission.  Fixes
applied by Android Lint (ag/18432857).

Bug: 232058525
Test: N/A
Change-Id: Id9bdeb71e84962d55fd1657e91856d84e1c3d11b
2022-07-11 20:01:27 +00:00
mattgilbride
244522cfbc @EnforcePermission migrations - other services
Immediate calls to helper methods that themselves call
Context.enforceCallingOrSelfPermission.
Fixes applied by Android Lint (ag/18432857).

Bug: 232058525
Test: N/A
Change-Id: Id3418f038122fd8861e38812623d42a07bb6baf9
2022-07-11 19:47:21 +00:00
TreeHugger Robot
758293c835 Merge "Forcefully convert to basic Intent before calling PM API." 2022-07-11 16:33:39 +00:00
Alex Buynytskyy
682df5bb41 Forcefully convert to basic Intent before calling PM API.
AIDL can't accept subclasses, see more info in the bug

Bug: 238277108
Fixes: 238277108
Test: follow steps in the bug, click on share
Change-Id: Ie691df4566e6b622c868bbed4377afc1ee82807d
2022-07-09 18:29:58 +00:00
Alex Buynytskyy
c62d43202e Forcefully convert to basic Intent before calling PM API.
AIDL can't accept subclasses, see more info in the bug

Bug: 238277108
Fixes: 238277108
Test: follow steps in the bug, click on share
Change-Id: Ie691df4566e6b622c868bbed4377afc1ee82807d
2022-07-09 11:28:06 -07:00
Taran Singh
4d097cc478 Merge "Conditional Init HWController when device has supported stylus" 2022-07-09 07:47:56 +00:00
TreeHugger Robot
c3f3048d61 Merge "Make InputBindResult#accessibilitySessions final" 2022-07-08 23:18:56 +00:00
Yohei Yukawa
ae8a46b18b Make InputBindResult#accessibilitySessions final
This field was somehow added as a non-final field [1], but nothing
prevents this from being a final field.  Let's make this final to be
consistent with other fields in InputBindResult.

This is a safe refactoring.  There should be no observable behavior
change.

 [1]: I8efdc9886ce33185a2195b741668c12e319ea660
      107b9413a6

Bug: 234882948
Test: presubmit
Change-Id: I5aef2e6a744f435fd192590673e91cb26cc3b02c
2022-07-08 13:07:11 -07:00
Taran Singh
d96ef57bc4 Conditional Init HWController when device has supported stylus
Use InputManager device listener to track if we've a known supported
stylus in system, only then init Handwriting.
Also supports simulated stylus

Bug: 210039666
Test: atest StylusHandwritingTest

Change-Id: I7399c0a56c04f024d65c16d459818cc2c5cdbc7f
2022-07-07 14:38:08 -07:00
Andrey Epin
2438f7ee8b Merge "Fix Chooser-to-editor transition animation" into tm-qpr-dev am: 9b723322f1 am: 68242f1b4b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18304427

Change-Id: I1a1e4748702364b31ec4e7b520ed9af2d7027b27
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 18:22:40 +00:00