Commit Graph

18776 Commits

Author SHA1 Message Date
Liahav Eitan
15e2b0fe84 Fix sharing to another profile where an app has multiple targets
Moves the fixUris call from onTargetSelected directly to the intent
launch to ensure the intent which is actually started is updated with
userId specific URIs.

Bug:242165528
Bug:242605257
Test: manually share image from personal profile to work gmail,
first with chat target then backing up and selecting the main target

Change-Id: Iabf5dcf2612fe718f2f0886e2e5e9b76f37af1e1
2022-08-23 16:05:45 +00:00
Jernej Virag
3234afdaf3 Merge "Prevent loading of Icon resources from the wrong package" into tm-dev am: e1e8b1b932 am: c4ebf2ba2a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19601344

Change-Id: Ibfc955f61506dc3e4aad8e7b19eeb9b8a91e77dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 21:03:38 +00:00
Charles Chen
4cce97fd2e Merge "Fix violation in DecorContext" into tm-qpr-dev 2022-08-16 18:51:03 +00:00
Charles Chen
d9bdee7fa0 Fix violation in DecorContext
The issue happens when activity is launched on the secondary
display. It's because the base context of DecorContext is
a DisplayContext, but we should check #isConfigurationContext in
associatd window's Context instead, like DecorContext#isUiContext

fixes: 242571036
Test: manual - launch activity on the secondary display

Merged-In: Ie2659fb31248ad64099018bfebb6a6b43c72f466
Change-Id: Ie2659fb31248ad64099018bfebb6a6b43c72f466
2022-08-16 15:22:49 +00:00
Joanne Chung
9e263e643d Merge "Fix system toolbar doesn't use correct theme." into tm-qpr-dev 2022-08-16 10:00:57 +00:00
Wilson Wu
08fc972311 Merge "Refine {SHOW,HIDE}_MY_SOFT_INPUT constants" into tm-qpr-dev 2022-08-16 08:37:12 +00:00
Jernej Virag
32f176e470 Prevent loading of Icon resources from the wrong package
If an Icon carries package designator, LocalImageResolver has now
ignored it. This could lead to loading of a wrong icon in cases where
the ID collided with the same ID in android package.

This is fixes that corner-case.

Bug: 241066484
Test: atest LocalImageResolverTest - the new test checks for pkg
      correctness and fails on devices without this cl

      manual test: bluejay device with known, reproducible resource
      collision in media player notification. In reproducible case,
      icon appears as a broken block.

      After applying this patch, small icon in media notification loads
      correctly for the collision case.

Change-Id: Ic79c0d4acb1d347a24282972e009a5a079ce6c21
2022-08-15 10:07:01 +00:00
Mark Renouf
930b8b78b6 More minor cleanups to ScreenshotRequest
* Adds screenshotType into the request instead of relying on the
Message it is sent in (msg.what).

* Adds a constructor which accepts type, source and topComponent

* Adds more @IntDef annotations to `int` constructor args

Bug: 231957192
Test: atest ScreenshotHelperTest
Change-Id: If4bf8ef1b889e4e7b2fabf195a538a13664cce12
2022-08-12 23:33:53 +00:00
Joanne Chung
9325f9b97e Fix system toolbar doesn't use correct theme.
The toolbar should set the theme to the app's theme. Because the
service cannot get the application context, we should pass this
information from application to service.

Bug: 218833400
Test: manual. Use light/dark theme for app, the toolbar shows with
the same theme
Test: atest TextViewIntegrationTest
Test: atest android.widget.TextViewActivityTest

Change-Id: I6d4e4e117c680ce57e760a87987059eded09b2bc
2022-08-12 16:54:34 +00:00
Mark Renouf
020439dcac Fix lines >100 chars and unnecessary fully-qualified class names
Bug: 231957192
Change-Id: If06068802f1358b2708df30338c772d27442266b
Merged-In: If06068802f1358b2708df30338c772d27442266b
2022-08-11 14:35:15 +00:00
Joanne Chung
9cc6ab62b2 Merge "Revert "[DO NOT MERGE] Remove selection toolbar code from build time"" into tm-qpr-dev 2022-08-10 08:38:51 +00:00
Wilson Wu
2ac25627d8 Refine {SHOW,HIDE}_MY_SOFT_INPUT constants
Naming of SoftInputShowHideReason#{SHOW,HIDE}_MY_SOFT_INPUT
constants may not clear enough to indicate its semantics.

Improve show/hide reasons of InputMethodService by:

-. Update constants naming to {SHOW,HIDE}_SOFT_INPUT_FROM_IME.
-. Introduce respective reasons to indicate different hide request
   cases within IME process.

Bug: 224565148
Bug: 241890033
Test: presubmit
Test: atest CtsInputMethodTestCases and observe logs
Change-Id: I8b148e9b5ab05ff7b827c6b8fe23008ca30a8c4b
Merged-In: I8b148e9b5ab05ff7b827c6b8fe23008ca30a8c4b
2022-08-10 11:51:59 +08:00
TreeHugger Robot
317201974a Merge changes from topic "b/232475788-frameworks/base" into tm-qpr-dev
* changes:
  Handle install-constraints tag.
  Scaffolding: reject installs based on device fingerprint
2022-08-08 15:12:29 +00:00
Joanne Chung
888e79f7a0 Revert "[DO NOT MERGE] Remove selection toolbar code from build time"
This reverts commit ade911b9c7.

Reason for revert: The feature is planned to run a study in QPR1
with the aim of launching in QPR-2. The code will be removed from
build time before QPR1 finalized.

Change-Id: Ida04260a1196121bb4084b527216aae1e4e6ec54
2022-08-08 11:02:44 +00:00
Ahan Wu
41998f864b Avoid too long trace section name to crash FrameTracker
android.os.Trace#beginSection limits the length of the section to 127,
otherwise, a IllegalArgumentException throws. We limit the length before
passing the argument to avoid this.

Bug: 239860117
Test: atest InteractionJankMonitorTest FrameTrackerTest
Change-Id: I3d9cbc65a8036c18680edf11aace0b324a1befb6
2022-08-05 16:53:31 +00:00
Andrey Epin
754656a669 Merge "Update icon only once" into tm-qpr-dev 2022-08-04 04:43:17 +00:00
Andrey Epin
d7e183e5ad Merge "Set default list view update to 0" into tm-qpr-dev 2022-08-04 03:13:55 +00:00
Wu Ahan
699f5e9471 Merge "Mark CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE_LOCK as deprecated CUJ" into tm-qpr-dev 2022-08-03 15:49:08 +00:00
Nicolò Mazzucato
560e645f3a Merge "Monitor fold to AOD latency" into tm-qpr-dev 2022-08-03 11:52:06 +00:00
TreeHugger Robot
7f96bd5a88 Merge "Fix leakage of pointer location" into tm-qpr-dev 2022-08-03 11:12:10 +00:00
Nicolo' Mazzucato
1a1976c329 Monitor fold to AOD latency
This logs the latency from when we receive the device state change (device folded), to when the AOD animation starts.

Bug: 237270816
Test: atest FoldAodAnimationControllerTest
Change-Id: I67e0e04bbc24064640f46cdc8feb667814170529
Merged-In: I67e0e04bbc24064640f46cdc8feb667814170529
2022-08-03 09:23:04 +00:00
Cliff Wu
0bc5eed6fa Merge "Fix generic wrong strings to comply with the UX guideline" into tm-qpr-dev 2022-08-02 23:13:14 +00:00
Mark Renouf
dcc2bb37a3 Adds OWNERS for ScreenshotHelper
This code is managed as part of SystemUI screenshots.

(This is a manual cherrypick of
27df215eba from AOSP.)

Change-Id: I624a52754cffcca66798d2813d25d8896597a39a
2022-08-02 10:55:15 +00:00
Arthur Hung
5a47857643 Fix leakage of pointer location
When display is removing, we should explicitly remove the pointer
location view to ensure the client object would be released.

Bug: 239078899
Test: Enabled pointer location, add/remove virtual display, check if
      the surface would be released.
Change-Id: I89ef3dc8e5b4aa8c3b7d5c1393d6543a9d3d67db
2022-08-02 09:38:35 +00:00
Cliff Wu
d1f854d2c0 Fix generic wrong strings to comply with the UX guideline
- The generic error need to remove "Unavailable" in the header and
only show body text.
- The "Play Store" app needs to be added to the error for a specific
app and it says "Play Store not available".
- Dialer app uses generic alert dialog.

Bug: 230048652
Test: Manual, atest FrameworksServicesTests:VirtualDeviceManagerServiceTest
Change-Id: I8b56e2804c3204901a3551d3300ab8c0391e7260
2022-08-02 04:18:34 +00:00
Pedro Loureiro
9c18a2a523 Handle install-constraints tag.
The tag can only be used by allowed packages. The list of the allowed
packages is controlled by configuration on a device, and it gets parsed
in SystemConfig.

A config is expected to have "install-constraints-allowed" tags per
package:

"""
<config>
    <install-constraints-allowed package="foo" />
    <install-constraints-allowed package="bar" />
</config>
"""

Bug: b/232475788
Test: atest AppSecurityTests com.android.server.systemconfig.SystemConfigTest
Change-Id: If3c07ddc1e58a5d16547a50437c939d17b3a4e69
2022-08-01 18:20:01 +00:00
Mark Renouf
693478bd52 Code cleanup of ScreenshotRequest and usages
Make constructor visible for tests
Make all fields final (no setters, so already effectively final)
Remove mHasStatusBar and mHasNavBar (unused)
Remove overload 'takeScreenshot' method without a source param
Added missing @IntDef annotations to parameters

Bug: 231957192
Test: atest ScreenshotHelperTest SystemActionPerformerTest
Change-Id: Ief43bd0ba50dafac720ae18d00c3c99b8d31e2e1
2022-08-01 18:14:33 +00:00
Ahan Wu
ad673c2220 Mark CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE_LOCK as deprecated CUJ
The CUJ is never implemented, mark it as deprecated to avoid confusions.

Bug: 229249877
Test: NA
Change-Id: I40d468eca4dfa483420605515ec5e11551be8afc
2022-07-27 10:46:46 +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
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
Andrey Epin
33f923ec77 Update icon only once
We have multiple LoadIconTasks started for the same icon, first from the
list view measurement and then from the actual view biding. We let all
those tasks to update the UI which riggered (through an observed but not
precicly comprehended mechanism) multiple announcements for the first
item in the list.
Ideally, we should have only one loading task for an item, but that
would be a more complex fix. Instead, we just let the winning task to
update the UI.

Fix: 238681660
Test: Manual test.
Change-Id: I8cc7a9a12a3b2e9e49834500d8b7d2bf3e6367d3
2022-07-12 10:50:20 -07: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
Andrey Epin
9b723322f1 Merge "Fix Chooser-to-editor transition animation" into tm-qpr-dev 2022-07-07 17:53:29 +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
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
64a7b85e9e Set default list view update to 0
This delay is not needed anymore.
Will rely on the remote configuration to revert the value if anything
would go wrong.

Bug: 224816815
Test: manual testing.
Change-Id: If045ed0ae488df1ad8ecaef1aea3ffe6b22e9cb1
2022-07-06 15:32:14 -07: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
0b670f205e Merge "[Partial screen sharing] App selector initial version" into tm-qpr-dev 2022-07-05 15:02:58 +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
Nicolo' Mazzucato
b612fe0a58 Add jank monitoring for taskbar appearing and disappearing
Bug: 228969045
Test: record a perfetto trace and make sure the interaction is there
Change-Id: I9bb46cd92a373ec4cfe43954cc66d983f1b380b1
2022-06-28 08:27:29 +00:00
Vadim Caen
9e2a134dde Merge "Prevent callback registration when back flag is disabled" into tm-dev am: 1c6de844ce am: 0592820f44
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18794217

Change-Id: I367c3888b726f0f7c83d382881741478e715d549
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 21:19:32 +00:00
Vadim Caen
a2e45f1ed1 Prevent callback registration when back flag is disabled
When the enableOnBackInvokedCallback is set to false (or not set),
registering an OnBackInvokedCallback should be a no-op to avoid
overriding the default compat callback.

Test: Manual testing registering a callback on an app with the flag
disabled and doing a back gesture. Currently we don't have test
executing a back gesture so automated tests are not possible

Bug: 235206960

Change-Id: I54d843f11130a78ed5a68cbe4722e601a2086ee1
Merged-In: I54d843f11130a78ed5a68cbe4722e601a2086ee1
(cherry picked from commit aa48dc3c2d)
2022-06-20 11:40:18 +02:00
Nick Chameyev
f3697ffee8 Merge "Update the number of columns on config change in share sheet" into tm-qpr-dev 2022-06-20 09:24:35 +00:00
Hui Yu
9e578ed3ac Merge "Fix the missing history event problem." into tm-dev am: 25019b3782 am: f6743c032c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18582121

Change-Id: I94c52ccbdc1b734d16f3dc9f99023e7a17973000
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-16 18:32:18 +00:00
Hui Yu
25019b3782 Merge "Fix the missing history event problem." into tm-dev 2022-06-16 18:03:26 +00:00