Commit Graph

19344 Commits

Author SHA1 Message Date
TreeHugger Robot
5e11ce8ca7 Merge "Use @EnforcePermission for IIMM#addVirtualStylusIdForTestSession()" 2022-07-18 21:57:40 +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
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
Andrey Epin
68242f1b4b Merge "Fix Chooser-to-editor transition animation" into tm-qpr-dev am: 9b723322f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18304427

Change-Id: Ic3dc5abac382389e916325dda7a59c90a2dfa9b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 18:03:47 +00:00
Andrey Epin
9b723322f1 Merge "Fix Chooser-to-editor transition animation" into tm-qpr-dev 2022-07-07 17:53:29 +00:00
Andrey Epin
7f2c104faa Merge "ResolverDrawerLayout to request layout when needed." into tm-qpr-dev am: d238f79f92 am: 3d11dbc77c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19142926

Change-Id: If93e8e16e02dc1059f10088a4f9faf7eef458441
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 17:13:26 +00:00
Andrey Epin
3d11dbc77c Merge "ResolverDrawerLayout to request layout when needed." into tm-qpr-dev am: d238f79f92
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19142926

Change-Id: Ic131b206b4c4153334a876e01649833477ce8887
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 17:05:27 +00:00
Andrey Epin
d238f79f92 Merge "ResolverDrawerLayout to request layout when needed." into tm-qpr-dev 2022-07-07 16:45:47 +00:00
Jerry Chang
c9f2fbe77f Merge "Make sure system bars have visible background while force-showing" into tm-qpr-dev am: b11f679d66 am: 338bfb7b48
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19193687

Change-Id: Iab0e6ec103fd66b67ab903af647368cce33335eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 02:42:44 +00:00
Jerry Chang
338bfb7b48 Merge "Make sure system bars have visible background while force-showing" into tm-qpr-dev am: b11f679d66
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19193687

Change-Id: Icbf6a52c98e8f0f6245594daee7f0502698d46f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 02:14:42 +00:00
Jerry Chang
b11f679d66 Merge "Make sure system bars have visible background while force-showing" into tm-qpr-dev 2022-07-07 01:59:39 +00:00
Andrey Epin
e83e0620bd Fix Chooser-to-editor transition animation
Add a scene animation - image thumbnail in Chooser to full-size image in
the editor - when the thumbnail is visible.
Finishing Chooser activity while the transition animation is running
produces an effect of "flashing" background (as the activity disappears
before the animation completed). Thus the call to finish the activity is
delayed until the activity is stopped (i.e. becomes fully invisible).

Fix: 231448720

Test: Use 'Files' app to share an image, select Edit in the Chooser,
 observe animation (optionally slow down the animation in the developer
 settings)
Test: The same as the previous test but in the split-screen mode.
Test: Slow-down animation, select "edit" in the chooser and cancel the
 animation mid-flight. The ChooserActivity pauses and resumes and
 remains overall functional (had to slow down the fade-out animation in
 the code). The animation in this case is broken but
 addressing this case is beyond the scope of this change.
Test: Use a mock app with the dialog-themed activity instead of the
system image editor; check that Chooser fades out and finishes in
background.
Test: Accessibility with talk-back on.

Change-Id: I982b9b2a8a049b5986dce521ee1abcd9ad83ba38
2022-07-06 10:05:24 -07:00
Jerry Chang
1c995fa719 Make sure system bars have visible background while force-showing
Client insets controller can request to hide system bars to enter
immersive mode. However, there're cases force-show system bars like in
split screen or freeform mode. This makes sure the background view of
system bars are always visible while force-showing.

Fix: 234196894
Test: put an immersive app in split, verified system bars background
      won't be invisible
Change-Id: Ia167bce9e64cd81a2ade499f8c6528384d957209
2022-07-06 12:22:11 +00:00
Nick Chameyev
ae0042d77a Merge "[Partial screen sharing] App selector initial version" into tm-qpr-dev am: 0b670f205e am: cf7494fd79
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18188206

Change-Id: I8a82be2a2f1e87cf7847b1151ba7cabea6ec423f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 15:39:38 +00:00
Nick Chameyev
cf7494fd79 Merge "[Partial screen sharing] App selector initial version" into tm-qpr-dev am: 0b670f205e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18188206

Change-Id: I86840a3e81feffe9d6f978467f04d3d1bd6a6eef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 15:20:12 +00:00
Nick Chameyev
0b670f205e Merge "[Partial screen sharing] App selector initial version" into tm-qpr-dev 2022-07-05 15:02:58 +00:00
Hani Kazmi
c7cdc8ca72 Merge "Migrate Bundle/Intent APIs to new, type checked, variants" 2022-07-05 10:32:47 +00:00
Christian Göllner
ae7cfe66f9 Merge "Create API for WM to send letterbox info to SysUI." into tm-qpr-dev am: fb27457c53 am: c227aaa274
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19032748

Change-Id: I3c804c9e35549de0bbfc393d2df4454765094378
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 08:12:06 +00:00
Christian Göllner
c227aaa274 Merge "Create API for WM to send letterbox info to SysUI." into tm-qpr-dev am: fb27457c53
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19032748

Change-Id: If10ac7a41f17332c3bdd5ace51aa436c7b9f8e26
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 07:52:39 +00:00
Christian Göllner
fb27457c53 Merge "Create API for WM to send letterbox info to SysUI." into tm-qpr-dev 2022-07-05 07:30:40 +00:00
Nick Chameyev
2bcb37a7ab [Partial screen sharing] App selector initial version
Adds an activity that inherits ChooserActivity
to select an app in the partial screen sharing
flow under a feature flag.
It doesn't have a proper visual design, analytics,
enterprise policies handling.

Bug: 218314434
Test: start partial screen sharing
Change-Id: Ia7d9ae07e2ef35d33f85530f26cab4e6cdc1f94a
2022-07-04 16:14:09 +00:00
Christian Göllner
a42e8efc83 Create API for WM to send letterbox info to SysUI.
+ Creates a new LetterboxDetails parcelable class
+ Adds LetterboxDetails as a parameter to IStatusBar#onSystemBarAttributesChanged

Test: Manually by checking that the device works without crashing
Fixes: 236829652
Change-Id: Ib4e615f6e4eb44d0fc4fb753b27a04b908e7bd24
2022-07-04 13:25:12 +00:00
Andrey Epin
883bb34d07 ResolverDrawerLayout to request layout when needed.
The list of fields that directly or undirectly and/or condtionally
influence view's layout:
onMeasure:
  mMaxWidth

onLayout:
  mTopOffset
    <- mCollapseOffset
  mCollapseOffset
    <- mCollapsibleHeight
      <- mShowAtTop
      <- mMaxCollapsedHeightSmall
      <- mCollapsibleHeightReserved
      <- mSmallCollapsed
      <- mAlwaysShowHeight
    <- mOpenOnLayout
    <- mShowAtTop
All their assigments is revied and discovered issues is addressed in
this CL (plus small adjustements suggested by the static code inspector).

Fix: 237718103
Test: Unit tests + manual.
Change-Id: I405b7a48dac18e090a055f3187004b3a8565586c
2022-07-01 11:49:43 -07:00
Yohei Yukawa
f3ae3b39ea Annotate methods in IInputMethodManager with @RequiresPermission
This CL adds @RequiresPermission annotations to IInputMethodManager
binder methods.

Since @RequiresPermission is just a source-level annotation, there
should be no observable behavior change.

Bug: 237316307
Test: compile
Change-Id: Iea02937d19e0353725d1eb1c9553236c93a4a71d
2022-07-01 10:23:43 -07:00
Hani Kazmi
4f221e5c51 Migrate Bundle/Intent APIs to new, type checked, variants
Part of go/safer-parcel. Follow up to ag/16639043. Migrates the following unsafe APIs:

* Parcel.readArray()
* Parcel.readParcelableArray()
* Bundle.getSerializable()
* Bundle.getParcelable()
* Bundle.getParcelableArrayList()
* Bundle.getParcelableArray()
* Bundle.getSparseParcelableArray()
* Intent.getSerializableExtra()
* Intent.getParcelableExtra()
* Intent.getParcelableArrayExtra()
* Intent.getParcelableArrayListExtra

Bug: 227458983
Test: m and presubmit pass
Change-Id: I72f206cb18eb5c669a7fff07a6845bed1c433fdb
2022-07-01 10:53:53 +00:00