Commit Graph

21111 Commits

Author SHA1 Message Date
Julia Reynolds
798e21e401 Revert "Don't restore notification channel if its sound is unavailable" am: cc547d33e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15718202

Change-Id: I65ed82759ab2a721331700a7856b8a993aff02eb
2021-08-30 23:20:05 +00:00
Julia Reynolds
cc547d33e5 Revert "Don't restore notification channel if its sound is unavailable"
This reverts commit 6a5ca92e75.

Reason for revert: This is affecting notification channels that are using the system sound and is resulting in users losing most of their notification settings

Change-Id: I350cf8190eec6296a597bef38b711900336ddf75
Fixes: 197129198
2021-08-30 20:30:57 +00:00
Chilun
e6692e20e6 [RESTRICT AUTOMERGE] Workaround to dump error log instead of exception am: f8fc1326f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15690060

Change-Id: I8107e094cd6182434683d359a52d9e0855c48221
2021-08-29 16:27:20 +00:00
Chilun
f8fc1326f7 [RESTRICT AUTOMERGE] Workaround to dump error log instead of exception
This is a short-term workaround to dump error log instead of throwing
the exception to unblock the test.

Bug: 197484331
Test: build pass
Change-Id: I2ece3b9d85edc1ae43038e6f69b35f59b160a3dd
2021-08-27 10:41:41 +00:00
Charles Chen
1be9657cc4 Using LaunchActivity when possible
... to prevent race

In [1], we store ActivityClientRecord earlier to make
ActivityClientRecord accessible in onCreate Lifcycle callback.
However, we still store the activity after Activity#onCreate.

This CL fixes the exception by obtaining ActivityClientRecord
from launch Activity list first to prevent race.

fixes: 196900007
Test: Try reproducible steps several times and didn't see
the error log.

[1]: 85986bf974

Change-Id: I7553c56cad474feb73fca73c72b5e6e833b46fbf
2021-08-23 15:54:24 +08:00
Chris Li
9c606e2740 getActivityTokenBelow should exclude finishing activity
This method was introduced in ag/15302841 to check the new launch
activity and the activity below.

However, when launching an activity into split, the organizer may also
call to finish existing activity in split. We don't want to check the
split rule with a finishing activity.

Bug: 190433398
Test: test with demo app
Change-Id: I7f604ddea7c2f68adc3cee52b8872e653d5dad98
2021-08-21 12:25:57 -07:00
Govinda Wasserman
bfbda478d3 Merge "Allow BackupHelper to be overridden" into sc-qpr1-dev am: 3de2a1e721
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15596703

Change-Id: I242397f7dd28c8d4df9ccf57010b6072ebfc67cf
2021-08-19 18:36:15 +00:00
Govinda Wasserman
8de1c313e6 Allow BackupHelper to be overridden
This will allow vendor versions of System UI to backup their
vendor-specific data.

Test: Tested locally
BUG: 195548201
Change-Id: Iebf512104be2a8fa0dfb614af12d95ed6a3625eb
2021-08-19 12:30:40 -04:00
Andrii Kulian
14c735d9e9 Merge "Update split controller to latest extension interface" into sc-v2-dev 2021-08-18 01:06:10 +00:00
Jeff DeCew
7945079a77 Merge "Make foreground color selection in SmartReplyView and RemoteInputView match Notification." into sc-qpr1-dev am: 0c43fe4e92
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15549415

Change-Id: I4b2d8f1c866b4d0e823ed338f58a55a3c395dd80
2021-08-17 19:39:52 +00:00
Jeff DeCew
0c43fe4e92 Merge "Make foreground color selection in SmartReplyView and RemoteInputView match Notification." into sc-qpr1-dev 2021-08-17 18:59:51 +00:00
Andrii Kulian
ce4afed050 Update split controller to latest extension interface
Bug: 190433398
Bug: 190433972
Test: Manual
Change-Id: I215bd5925f35c2a798b7f82ac8753d86cf9b594c
2021-08-16 20:24:48 -07:00
Jeff DeCew
262b278197 Merge changes I09b3999a,I590be0ba into sc-qpr1-dev am: 10c7e2b811
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15549414

Change-Id: I9597ee3b59967386c95bb5aa2129ed5ea7b5e58d
2021-08-16 19:38:07 +00:00
Jeff DeCew
2bd5f502fd Make foreground color selection in SmartReplyView and RemoteInputView match Notification.
Fixes: 196585371
Test: post colorized notification with luminance between .2 and .5; validate that smart replies and remote input use black text to match the notification.
Change-Id: I5ea69181755ed5c2b48352a0379ae4e898202e21
Merged-In: I5ea69181755ed5c2b48352a0379ae4e898202e21
2021-08-16 14:37:42 +00:00
Jeff DeCew
d8054270e7 Use tertiary accent color for expander with unread count.
Fixes: 196586577
Test: visual inspection
Test: atest android.app.NotificationTest
Change-Id: I09b3999ad1c51615fbf7c8027dc65e6750721f18
2021-08-16 14:19:13 +00:00
Makoto Onuki
96ae65cf6f Merge "Clarify how FGS restriction won't apply STICKY FGS restarts" into sc-dev am: 0c1dc2fc76 am: 911ed7c949
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15484572

Change-Id: I2dd4e7f72dfa8e5e6220fa9fbb5afc200009ee9b
2021-08-11 22:01:51 +00:00
Makoto Onuki
0c1dc2fc76 Merge "Clarify how FGS restriction won't apply STICKY FGS restarts" into sc-dev 2021-08-11 21:17:20 +00:00
Louis Chang
5eff403fff Renaming to initial TaskFragment token
Also adding comments to explain that it could be changed after
creation.

Bug: 194860679
Test: wm presubmit
Change-Id: I72b099a6134701377a73cbe76bb9d0cb501aa507
2021-08-09 14:55:32 +08:00
Ruslan Tkhakokhov
a4a55908ff Merge "Handle empty <cloud-backup> section in android:dataExtractionRules" into sc-dev am: b72bf2927e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15462078

Change-Id: I634558a7453972b8f4ea089c641692b485315a77
2021-08-06 23:43:53 +00:00
Makoto Onuki
5031c3a4f6 Clarify how FGS restriction won't apply STICKY FGS restarts
Fix: 195780554
Test: build
Change-Id: Ic627a89ac863729d36554070d04c22254747f014
2021-08-06 21:43:31 +00:00
Ruslan Tkhakokhov
21f45cd998 Handle empty <cloud-backup> section in android:dataExtractionRules
Currently the <cloud-backup> section in android:dataExtractionRules is
ignored unless it contains rules. Instead, we should interpret it as
'everything other than cache and no-backup dirs is eligible for cloud
backup'.

Bug: 195095045
Test: 1. atest BackupEligibilityHostSideTest
      2. Use a test app with empty <cloud-backup> section to manually
      test:
          2.1. Empty section - everything is backed up
	  2.2. Empty section but "disableIfNoEncryptionCapabilitites"
	  set to "true" - data only backed up if the transport supports
	  encryption.
Change-Id: Ic8066721a46bda688f9211c51a0f2497e9caf93b
2021-08-06 12:16:05 +00:00
Riddle Hsu
a44fcb0dd4 Fix NPE when calling recreate in onCreate am: 6c675a3a48
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15435289

Change-Id: Ia5aaf4ded7149db9c984ca1aa409d3b494a304c6
2021-08-04 05:38:43 +00:00
Andrii Kulian
94a6a10f90 Merge "Intercept activity start requests in client organizer" into sc-v2-dev 2021-08-04 02:23:59 +00:00
Riddle Hsu
6c675a3a48 Fix NPE when calling recreate in onCreate
ActivityClientRecord#activity is assigned after calling
Activity#onCreate. A use case is that the app uses
support library to set night mode in onCreate.

Bug: 195418295
Test: Invoke Activity#recreate() in Activity#onCreate.
Change-Id: I6319cd6ee94fc2603979da47303963d04168db04
2021-08-04 10:16:41 +08:00
Andrii Kulian
94354a9a7f Intercept activity start requests in client organizer
This allows applying split rules to activity start requests for
different processes and covers APIs like 'startActivityAsUser',
not requiring app developers to use dedicated APIs to start to side
instead.

When the client organizer observes a new activity being started, it
creates a new TaskFragment first and modifies the activity start
options to target that container.

Bug: 194140227
Bug: 190433398
Test: Manual, using reference implementation and sample app.
Change-Id: Ice3de8ec725d327266ec38052129b4158608855e
2021-08-03 14:38:02 -07:00
Nate Myren
7ebbcf1685 Merge "Add attribution info to start callbacks" into sc-dev am: 5d97f29218
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15446590

Change-Id: If5ddeb244befcaea57a3e53f741b94ec5bfd6dd0
2021-08-03 20:06:56 +00:00
Nate Myren
5d97f29218 Merge "Add attribution info to start callbacks" into sc-dev 2021-08-03 19:56:02 +00:00
Nate Myren
e2942cb666 Merge "Revert sync app op chain changes" into sc-dev am: 50ff5ac8b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15424412

Change-Id: I63c16fa22d36295b9992740ea95ae69342f22307
2021-08-03 15:34:46 +00:00
Nate Myren
06d07d54db Add attribution info to start callbacks
Add attribution flags and chain IDs to start callbacks, and have the
PermissionUsageHelper listen for starts. This ensures that, if another
start happens while an op is already running, and has chain information,
then this chain information will be recorded.

Test: manual
Bug: 194198234
Change-Id: I0ab1aa0969b70e18001f4a814ea5689f9329a019
2021-08-03 08:25:31 -07:00
Nate Myren
50ff5ac8b8 Merge "Revert sync app op chain changes" into sc-dev 2021-08-03 15:16:35 +00:00
Nate Myren
86c337659a Revert sync app op chain changes
These changes cause some noted app ops to be swallowed due to one-way
app ops.

Fixes: 187721493
Test: atest AppOpsLoggingTest
Change-Id: I3b761b65b2e06138fc1d130bf80587f8885bb1d5
2021-08-02 12:50:44 -07:00
Louis Chang
332036a29e Sending TaskFragment token to client for the launching activity
Activity#onCreate is called before receiving the TaskFragment
appeared event in the client process. So, the client split
controller created another split and resulted in unexpected
behaviors.

Bug: 194860679
Test: start activity to side
Test: wm presubmit

Change-Id: Iac34bd39376940c5c0224c8687ad9858a4190e20
2021-08-02 09:42:36 +08:00
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