Commit Graph

21079 Commits

Author SHA1 Message Date
Mariia Sandrikova
809e26fc6a Merge "Freeze live wallpaper for letterbox background." into sc-v2-dev 2021-07-30 15:00:37 +00:00
Mariia Sandrikova
a829124577 Freeze live wallpaper for letterbox background.
With this change, WallpaperController sends "freeze" / "unfreeze" commands when the app window is letterboxed / not letterboxed indicating that:
- "freeze": a screenshot of the wallpaper is taken by WallpaperServices and put on top of the main surface while the wallpaper host is notified through onVisibilityChanged(false) callback that it's no longer visible.
- "unfreeze": a screenshot of the wallpaper is removed and the wallpaper host is notified through onVisibilityChanged(true) callback if the wallpaper is visible again (e.g., if transitioned from an app to the Home screen).

Logic isn't applied to static wallpapers.

When wallpaper size changes while being frozen, the screenshot is scaled and cropped to adjust to the new size.

Fix: 177884751
Test: Manual, atest WallpaperServiceTest, WallpaperServiceTests
Change-Id: If0300478cdccc07d226117e01ce3d43aa0b432a0
2021-07-30 12:58:34 +01:00
Jeff DeCew
8f8facbbbc Merge "Fix bug removing semantic colors of CallStyle notification actions." into sc-dev am: 4203db854f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405173

Change-Id: If6c4a857e6cc322f8071256bc2645bae74f1274a
2021-07-30 00:48:48 +00:00
Chalard Jean
6bc441cc01 Merge "Fix: ConnectivityManager methods crashing with SecurityException" into sc-dev am: 4e7b1128a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15401698

Change-Id: Iad002e42bc2c436ad6a69ff61a3c1b0646dc7e9c
2021-07-30 00:44:45 +00:00
Jeff DeCew
4203db854f Merge "Fix bug removing semantic colors of CallStyle notification actions." into sc-dev 2021-07-29 20:24:37 +00:00
Jeff DeCew
5dae211842 Fix bug removing semantic colors of CallStyle notification actions.
* When we changed the default color of emphasized actions to an accent color instead of the notification background color, I didn't split the two into different locals, and this meant the accent color was used to enforce the color contrast of the custom color.  This led to color desaturation in an attempt to meet contrast (when in dark mode) and a failure to ensure sufficient contrast (in light mode).
* A piece of this that applies specifically to colorized notifications is that we used the 'night mode' state as a shortcut for whether the background was light or dark.  This led to 1) different foreground colors for the same background color, depending on dark mode state, and 2) frequently a failure to meet contrast (and/or extreme desaturation) in one of those modes.
* Also adding different night-mode colors for CallStyle actions, to meet spec.

Test: validated sufficient contrast of default and various colorized background/button combos using the accessibility scanner.
Bug: 194935539
Change-Id: I3a69eadc89f1d9d98a816c44a36873c7615a177e
2021-07-29 11:16:52 -04:00
Chalard Jean
d90d6457fb Fix: ConnectivityManager methods crashing with SecurityException
Starting in R, some methods in ConnectivityManager like
getNetworkCapabilities started passing the package name from
the context stored in CM to check that the package is really
whom it pretends to be. Unfortunately, in some cases, the
context contains package "android" for an app, and since the
app is not the system, the check fails and crashes the app.

It seems the culprit is updateHttpProxy, which is called by
ProcessList when the PROXY_CHANGE_ACTION broadcast is sent.
If this happens to run between the time the process is created
and the activity thread is "bound", then the mInitialApplication
member is not set, and updateHttpProxy uses a system context.
Since ConnectivityManager caches the context forever in a
static, this leads to subsequent legitimate calls crashing.

Setting the proxy can be deffered until such a time that the
app is bound, as it can't run any code before then. The member
is never reset to null, so it's guaranteed to be non-null at
bind time.

An alternative would be to post a runnable on the handler
thread if the member is null to try again later. This
could however run the lambda a considerable number of times
as binding can be delayed, and risks causing an infinite loop
if some invariants are changed in the future.

See also b/73572062 and ag/4056059

Bug: 155549446
Bug: 189360509
Test: ActivityThreadTest FrameworksNetTests NetworkStackTests
Test: Manually set a proxy, observe the broadcast being sent and
      apps not crashing
Change-Id: I956f76be2e0a1a675576511fb394d7ed4354b28a
(cherry picked from commit b0d13e29515d5b7c82daed7533b78ac57e46bd93)
2021-07-29 11:55:37 +09:00
Rubin Xu
384e3586f6 Merge "Stop managed profile owner granting READ_SMS" into sc-dev am: 28e4c5d57a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15371691

Change-Id: I0d9242aa9682a7bfa8ff972ebd4356160e23fce3
2021-07-28 18:29:27 +00:00
Ahaan Ugale
affd1add48 Merge "Copy ContentCaptureOptions into derived Contexts" into sc-dev am: 2db19f5679
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15352571

Change-Id: Ib07e5a19501d5d54e4dfa4732cf2cb3ce119a898
2021-07-28 18:22:38 +00:00
TreeHugger Robot
495abb7eab Merge changes from topic "native_hint" into sc-dev am: ea52c87596
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15326475

Change-Id: I805e930ede0c22bbcbec62d1b0738dd7c91f5dc5
2021-07-28 14:44:51 +00:00
Rubin Xu
28e4c5d57a Merge "Stop managed profile owner granting READ_SMS" into sc-dev 2021-07-27 08:51:15 +00:00
Andrii Kulian
8c3b7511ab Notify split controller about activity configuration change
Track activity configuration changes, so that split controller has
a chance to apply metrics-based rules like launching a placeholder.

Not using ComponentCallbacks here, since they are only triggered for
Application configuration changes, which might be problematic if
there are multiple running activities with different sizes. They are
also usually triggered before individual activity resources are
updated.

Also moved post-creation actions to onActivityPostCreated(), since
onActivityCreated() is called from the base implementation in
Activity#onCreate() and there is still a chance that app may perform
some actions after calling super in its override.

Bug: 194538838
Test: Configure a placeholder, launch in a small size, enlarge.
Change-Id: Ied55d5f920890fa554cdd66419235d61ab03b440
2021-07-26 16:07:16 -07:00
Ahaan Ugale
2db19f5679 Merge "Copy ContentCaptureOptions into derived Contexts" into sc-dev 2021-07-24 01:18:17 +00:00
Alex Johnston
7f632dca95 Stop managed profile owner granting READ_SMS
Reason: There is only one telephony stack shared
between the personal and work profile.

Bug: 194382185
Bug: 189942529
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testGrantOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDenyOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testSensorsRelatedPermissionsNotGrantedViaPolicy
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testGrantOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDenyOfSensorsRelatedPermissions
      atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSensorsRelatedPermissionsNotGrantedViaPolicy
Change-Id: I99384d5713bb2d04f5b6fbe20c17bd72a39b57d7
2021-07-23 17:05:21 +01:00
Ahaan Ugale
0cfcde8d5e Copy ContentCaptureOptions into derived Contexts
When a new Context is created from the Activity Context and used to
inflate views, Content Capture is disabled for those views because the
new Context is missing ContentCaptureOptions.

Fix: 194321297
Test: atest CtsContentCaptureServiceTestCases
Test: manual - view appeared events come through
Change-Id: I934d41953c7668e371d5961b66187ecd15408e3e
2021-07-23 03:24:42 +00:00
Bo Liu
0b2ad9f70d Implement java PerformanceHintManager on top of native
Note some exceptions became silence errors in this conversion.

Test: None
Bug: 194204196
Change-Id: Ia3cc7f2396f2e307a23b40b3f104a2fa90352196
2021-07-22 11:33:13 -04:00
Evan Severson
b88fa4135b Merge "Don't block intent if op is restricted due to toggles" into sc-dev am: 2b11e7f25c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15245178

Change-Id: I6e6fea3721aed83e38d3b70f570036c1b3c72c03
2021-07-21 17:26:21 +00:00
Evan Severson
2b11e7f25c Merge "Don't block intent if op is restricted due to toggles" into sc-dev 2021-07-21 17:10:21 +00:00
Evan Severson
7b6d643171 Don't block intent if op is restricted due to toggles
Test: Create sdk 22 and 30 test apps and use the MEDIASTORE intents
Bug: 192635623
Change-Id: I250a5e398e72919ec8217e87b76273082e781f63
2021-07-21 08:37:00 -07:00
Andrii Kulian
85986bf974 Split activity organizer in WM Extensions
Reference implementation for the client-side organizer
for side-by-side split activity UI.

Bug: 190433398
Bug: 190432728
Bug: 190433500
Bug: 190433972
Bug: 191163577
Bug: 191163638
Test: Manual, using the sample in WM Jetpack
Change-Id: I27335d47f4f544e2b9f63c5daaac9bd1c272a89f
2021-07-20 20:31:10 -07:00
Andrii Kulian
1e2187cfea Add hidden ATM method to use in TaskFragmentOrganizer
getActivityBelow() is necessary to check if a split rule should
be applied for two activities on top of each other. This will
only report an activity that belongs to the same process.

When an application starts an activity B on top of an existing
activity A normally, there might be a split rule to put them
side-by-side. Organizer needs to know that activities A and B
are on top of each other to check, so it can either intercept
new activity launch or observe it after it happens and check the
rules then. The second approach results in a cleaner implementation,
but it also means that the organizer needs a reliable way to check
which activity is directly below the launched one. There is no
reliable source of info for that on the client side yet.

Bug: 190433398
Bug: 190433500
Test: Manual, using the reference implementation of the organizer.
Change-Id: I0e0116b1b0144e0ba4d19039d78c34495fbe4457
2021-07-20 17:46:55 -07:00
Shuo Qian
c45b4a0a53 Merge "Change the doc to reflect the default status of preferential network service" into sc-dev am: c03fb15e29
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15329706

Change-Id: Id3afae60a414750b735d171cc679122418465f99
2021-07-20 17:00:33 +00:00
Shuo Qian
2be8f7898d Change the doc to reflect the default status of preferential network service
Test: Build
Bug: 193913733
Change-Id: I648b85c39f9b4e66193188852d649e82371ee90c
2021-07-19 23:24:55 +00:00
Evan Rosky
6139cf51b2 Create a LegacyTransitions to manage combined WCT + remoteanimation
Use this to implement Drag-to-split transition

BYPASS_INCLUSIVE_LANGUAGE_REASON=using existing API.

Bug: 192291727
Test: drag from taskbar into split and observe. Also,
      drag same-app into split and observe no-op.
Change-Id: I710805c85c7d57ae8eebe18e5df7fca899f1b882
2021-07-16 19:06:14 -07:00
TreeHugger Robot
22b36a7a66 Merge "Don't allow PI crashes on unknown sender types" into sc-dev am: e0c972a2be
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15245014

Change-Id: I4dd8731a59b58e7376283eb41ae0e7185183566b
2021-07-16 01:51:54 +00:00
TreeHugger Robot
e0c972a2be Merge "Don't allow PI crashes on unknown sender types" into sc-dev 2021-07-15 03:14:15 +00:00
Hongwei Wang
ebe8550d03 Fix letterbox issue when auto-enter-pip from landscape
Included in this CL
- Skip layout of window when in transition to PiP mode
- Pass display cutout info via TaskInfo
- Removed TaskInfoCompat

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bpKcGg1eoOo5Jz5U6IwBYK
Bug: 191310680
Test: manual, auto-enter-pip from landscape with source rect hint being
      turned on, see the video
Change-Id: Ie657d15d9edb9d07555bd166b5919bb12cb217e6
Merged-In: Ie657d15d9edb9d07555bd166b5919bb12cb217e6
2021-07-13 15:07:18 -07:00
Hongwei Wang
70dd96cea7 Fix letterbox issue when auto-enter-pip from landscape
Included in this CL
- Skip layout of window when in transition to PiP mode
- Pass display cutout info via TaskInfo
- Removed TaskInfoCompat

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bpKcGg1eoOo5Jz5U6IwBYK
Bug: 191310680
Test: manual, auto-enter-pip from landscape with source rect hint being
      turned on, see the video
Change-Id: Ie657d15d9edb9d07555bd166b5919bb12cb217e6
2021-07-13 14:59:52 -07:00
TreeHugger Robot
192785cba9 Merge "Apply pending AppInfo on Activity override change" into sc-dev am: d2dd630204
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15260966

Change-Id: I65f9630fe8c10ed833292cb1c609cacac3fcf343
2021-07-13 00:02:52 +00:00
TreeHugger Robot
d2dd630204 Merge "Apply pending AppInfo on Activity override change" into sc-dev 2021-07-12 23:46:03 +00:00
TreeHugger Robot
496e98d41b Merge "Remove isAppStartModeDisabled binder entry point" into sc-dev am: f59bf68628
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15246166

Change-Id: Ic847445732f37587b8b03713b7cb1451ae0ce1af
2021-07-12 22:30:52 +00:00
TreeHugger Robot
f59bf68628 Merge "Remove isAppStartModeDisabled binder entry point" into sc-dev 2021-07-12 22:14:30 +00:00
Ryan Mitchell
290e51fce3 Apply pending AppInfo on Activity override change
When the activity override configuration changes, we need to apply any
pending application info changes so that when the activity is
recreated, it will have updated overlays.

Bug: 193256671
Test: change live wallpaper and observe launcher colors
Change-Id: I6b8c25a6e6756f612a0f57c921625bc58ac1ecf6
2021-07-12 22:00:43 +00:00
Jeff DeCew
e390215973 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: Ie1b2c82414463188f6a9404a2ad3015290e07c94
2021-07-12 19:55:51 +00: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
Charles Chen
427a66fa71 Merge "Send DA's config directly when attaching to DA" into sc-v2-dev 2021-07-10 05:02:32 +00:00
TreeHugger Robot
c4fe42e347 Merge "Optimize AttributionSource tokens - base" into sc-dev am: 2b90cc827b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15247205

Change-Id: I4b1d8d446ea18a308c4a523298682b3a7d217421
2021-07-10 02:27:03 +00:00
Svet Ganov
1babd5bf51 Optimize AttributionSource tokens - base
For cases where the attribution soruce doesn't need to be
registered as trusted we are now using a shares static
token since the only purpose of the token in these cases
is for watching the source process dying as opposed to that
and security for registered cases.

bug: 192415943

Test: CtsPermissionTestCases
      CtsPermission2TestCases
      CtsPermission3TestCases
      CtsPermission4TestCases
      CtsPermission5TestCases

Change-Id: I93fde9ca1cacada7929761533dcae11b2736ce1e
2021-07-10 00:24:30 +00:00
Christopher Tate
6054148ef9 Remove isAppStartModeDisabled binder entry point
Obsolete: the use cases for which it was introduced now have a clean
internal API layer to use instead, and this reduces informational
exposure about package presence & states.

Bug: 185513355
Test: atest SyncManagerTest
Test: atest CtsSyncManagerTest
Change-Id: I4aa1848950061dce3a1378f7d0117364e62ba59f
2021-07-09 14:28:37 -07: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
Soonil Nagarkar
8fba7cf989 Don't allow PI crashes on unknown sender types
Bug: 193207800
Test: presubmits
Change-Id: I2a674549f4cfe45841dc0094709666c25c2d743b
2021-07-09 09:08:47 -07:00
Amith Yamasani
4993c552e7 Merge "Fix FGS notification mismatch" into sc-dev am: 9eed97ac10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15226946

Change-Id: Ib6cae8c9e8fbb1361da3555074eabc803f23878d
2021-07-09 02:01:45 +00:00
Amith Yamasani
9eed97ac10 Merge "Fix FGS notification mismatch" into sc-dev 2021-07-09 01:45:59 +00:00
Chris Li
c769062301 Merge "Revert "Revert "Not show size compat UI when task is not visible""" into sc-dev am: 50c03ea7ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15237129

Change-Id: I8c2e257e5a2b7d89814288d5d8cd2e24af76c722
2021-07-08 22:03:19 +00:00
Chris Li
a23a2bb5db Revert "Revert "Not show size compat UI when task is not visible""
This reverts commit 76370b6fe6.

Reason for revert: Fix the merge break in ShellTaskOrganizerTests.java

Fix: 193069342
Test: atest WMShellUnitTests:ShellTaskOrganizerTests
Change-Id: I02c4bddc407eaac0ebb7cd5abb0b394f242d4d6e
2021-07-08 12:09:40 -07:00
Chris Li
e7ed99bfc2 Merge "Remove TaskInfo#topActivityToken usage in size compat for security" into sc-dev 2021-07-08 18:05:40 +00:00
Evan Rosky
5ca3820ae6 Hook up split-launch to legacy transition system
Part 1 of hooking up stage-split to legacy stuff. This
actually routes the legacy remoteAnimation through shell
in order to gather the dividerbar and interract with the
WindowProcessController

Bug: 192279476
Test: atest WindowOrganizerTests.
      use SPLIT_SELECT to launch 2 apps in split and observe.
Change-Id: I4f8802e6eb33f068fae0e4b3c12942bea76e332b
2021-07-08 09:02:59 -07:00
Bernardo Rufino
bef6e7a3c6 Merge "Require proper permission for togglePanel()/handleSystemKey()" into sc-dev am: 6b1896db4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15216476

Change-Id: Ibba7df55a23bffb6ff0a28322f242278c9a0d8cf
2021-07-08 10:30:42 +00:00
Leon Jeng
979db138fe Revert "Not show size compat UI when task is not visible" am: 76370b6fe6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15232572

Change-Id: Ib61cabd6c4d77d4fa5cd3f64b2272fcd684db153
2021-07-08 10:01:44 +00:00
Leon Jeng
76370b6fe6 Revert "Not show size compat UI when task is not visible"
This reverts commit adb92508c0.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=coral-userdebug&lkgb=7530814&lkbb=7530923&fkbb=7530923, bug b/193105445

Bug: 193105445
Change-Id: I697229da6986d6466d7f13872e9ae7a727b80838
2021-07-08 09:48:10 +00:00