Commit Graph

20608 Commits

Author SHA1 Message Date
Mathew Inwood
f715fddd3c Merge "API changes as requested by API council." into sc-dev 2021-04-21 08:40:16 +00:00
Ben Lin
6e6e6b5162 Merge "Add Activity#onPictureInPictureUiStateChanged and PictureInPictureUiState." into sc-dev 2021-04-20 17:45:38 +00:00
Hui Yu
fae5e14059 Merge "Allow FGS started from MediaButtonReceiver to have while-in-use permissions." into sc-dev 2021-04-20 17:04:09 +00:00
Shashwat Razdan
e7f4889beb Merge "Addressing the feedback received in the API review." into sc-dev 2021-04-20 16:01:42 +00:00
Jeff DeCew
eba7be7876 Merge "CallStyle actions have minimum width" into sc-dev 2021-04-20 13:46:14 +00:00
TreeHugger Robot
fd1ba27630 Merge "Avoiding system server dump stuck by pipe buffer full." into sc-dev 2021-04-20 09:16:00 +00:00
TreeHugger Robot
ae88ce7e0a Merge "Fix the ActivityLifecycleTests#testLocalRecreate flakiness" into sc-dev 2021-04-20 08:07:30 +00:00
Shashwat Razdan
8c63ca6581 Addressing the feedback received in the API review.
API Review bugs list is here: https://b.corp.google.com/issues?q=blockingid:176851064

Test: CTS tests:

Fixes:185226923
Fixes:185226755
Fixes:185226674
Fixes:185226597
Fixes:185226790
Fixes:184585058
Fixes:184585080
Fixes:184585117
Fixes:184585343
Fixes:184585079

Change-Id: Idacee5f95ce104d1fb6de40a04ac2b74691f977e
2021-04-20 08:06:25 +00:00
Louis Chang
f3ae7ab1ea Fix the ActivityLifecycleTests#testLocalRecreate flakiness
IACC#activityTopResumedStateLost was reported to ATMS later than
IACC#activityPaused sometimes because one is one-way binder call
while the other one is two-way binder.

Also make IACC#activityTopResumedStateLost a two-way binder

Bug: 185810414
Test: atest ActivityLifecycleTests
Change-Id: Ib87de693f5ebcfd836208924aa8fc2a035ca7c82
2021-04-20 13:55:50 +08:00
TreeHugger Robot
e354625105 Merge "Rename destSpecs to targetSpecs" into sc-dev 2021-04-20 01:21:06 +00:00
Tang Ding
8bbe093657 Avoiding system server dump stuck by pipe buffer full.
Problem:
RenderThread blocked during dumping gfx info.

Root Cause:
Though dumpGfxInfo() uses an async binder invocation ,When the caller is system server, this invocation is not IPC that means it is not asynchronous, it will keep waiting if dumpGfxinfo output size larger than  16*4KB as reader thread start by transferpipe.go cannot be executed because write pipe waiting. Ensure this invocation is asynchronous to prevent writer waiting if buffer cannot be consumed.

Solution:
Send write action to handler thread so reader thread can be started to consume the data in buffer.

Fix: 185806813
Test: dumpsys gfxinfo
Change-Id: I37b1c1881a857970019eddfb762ae620e0353744
2021-04-19 15:46:38 -07:00
Tony Mak
b004404a72 Merge "Add some TestAPIs for replacing some @hide API usages in ExtServices's test" into sc-dev 2021-04-19 21:07:41 +00:00
Hui Yu
36429f87de Allow FGS started from MediaButtonReceiver to have while-in-use
permissions.

1. Create a generic FgsTempAllowList class, mFgsStartTempAllowList and
 mFgsWhileInUseTempAllowList are instantiated from FgsTempAllowList.
2. For mFgsWhileInUseTempAllowList, the uid on this list is allowed to
have while-in-use permission when the FGS is started from background for
a duration of time.
3. When media button is pressed, the targetUid is added to
mFgsWhileInUseTempAllowList, for the duration of 10 seconds, this way the
targetUid can start FGS from background and have while-in-use permission.
4. When checking for ProcessRecord.
mAllowBackgroundActivityStartsTokens, it is the caller app's
ProcessRecord should be checked instead of the service's ProcessRecord.

Bug: 182481312
Test: use b/167998084 reproduce steps, make a voip call, the
 receiver side screen is unlocked, the receiver side uses bluetooth
headset button to pick up the call, "dumpsys activity -a" shows the FGS
has "allowWhileInUsePermissionInFgs=true" and "isForeground=true".

Change-Id: Ic80aefe4202fe2210881bb8eea24b6e34cb1e7d0
2021-04-19 10:34:28 -07:00
TreeHugger Robot
0e47206b0a Merge "Use the existing wallpaper command API to send wake/sleep events to the wallpaper." into sc-dev 2021-04-19 15:50:33 +00:00
Mathew Inwood
c89513ac27 API changes as requested by API council.
Bug: 183512729
Test: m
Merged-In: Ie465c49ff02065e78a2e8e211a13350a0ff7f0a4
Change-Id: Ie465c49ff02065e78a2e8e211a13350a0ff7f0a4
2021-04-19 14:02:52 +00:00
Neil Fuller
05ccc44cb4 Merge "Add the ability to override time origin priorities" into sc-dev 2021-04-19 11:19:43 +00:00
Josh Tsuji
d5da89479e Use the existing wallpaper command API to send wake/sleep events to the wallpaper.
This is already used for similar events such as icon drops and user taps. Using it to indicate that the user has woken/slept the device (and passing along location information) makes sense!

This was previously rolled back since WallpaperManager can be null in Car environments. This CL now checks if WallpaperManager is null.

Bug: 169693662
Test: locally with modified wallpaper, it receives events
Change-Id: Ie9d21b4ff4a1edf871540481bc0c4216ed686b7f
2021-04-18 23:12:02 -04:00
TreeHugger Robot
8d8d75af36 Merge "Revert "Use the existing wallpaper command API to send wake/sleep events to the wallpaper."" into sc-dev 2021-04-17 08:53:40 +00:00
Yuncheol Heo
a35b769999 Revert "Use the existing wallpaper command API to send wake/sleep events to the wallpaper."
This reverts commit bde980759e.

Reason for revert: b/185615919

Change-Id: I4906f109de478361790e459c117bd5d6a88a778c
2021-04-16 21:15:06 +00:00
Almaz Mingaleev
e2b7cb3df2 Merge "Add copy builder to TimeZoneCapabilities." into sc-dev 2021-04-16 17:45:54 +00:00
Jeff DeCew
24220aae09 CallStyle actions have minimum width
This ensures that the major action buttons have a minimum visual emphasis in the layout.

Bug: 179178086
Test: manual
Change-Id: I58744ada45d789a9acb53b0f4965354835595b19
2021-04-16 13:08:40 -04:00
Neil Fuller
d13937900c Add the ability to override time origin priorities
Add the ability to override time detector "origin priorities" config
with device_config. This is primarily intended for use by tests to set
the device into known states, regardless of the static xml OEM partner
config.

For example, to test the new "external" suggestion code in CTS, even a
device that does not support it "out of the box" can be set to just use
external suggestions and verify the associated code paths are working.
Previously, external time suggestions were untestable on devices that
didn't use it "out of the box".

Similarly, carrier acceptance tests could use this to just set "nitz"
from the priority list and ensure that NITZ behavior is working as
expected.

An initial TimeDetectorShellCommand implementation has also been written
to provide help that lists the device_config key, and expose settings
state. The set_auto_detection_enabled command can be added after bug
172891783 is complete.

This change also makes the origin priorities more dynamic. i.e. config
overlays like locale or MCC-based resource configs could now also affect
the origin priorities, previously the string was read once and cached
forever.

Bug: 183239968
Bug: 172891783
Bug: 172230856
Test: build / treehugger only
Change-Id: Ic67f35aa6d417bbbb4172643c10a796d484ccd1f
2021-04-16 17:54:17 +01:00
Josh Tsuji
11b83652e9 Merge "Use the existing wallpaper command API to send wake/sleep events to the wallpaper." into sc-dev 2021-04-16 14:59:23 +00:00
Josh Tsuji
bde980759e Use the existing wallpaper command API to send wake/sleep events to the wallpaper.
This is already used for similar events such as icon drops and user taps. Using it to indicate that the user has woken/slept the device (and passing along location information) makes sense!

This does require an API modification to add the new string constants to WallpaperManager. This change is being requested by 1P apps (the Live Wallpapers, which are not bundled with the OS and thus can't use system APIs).

Bug: 169693662
Test: locally with modified wallpaper, it receives events
Change-Id: I0cc1bc70dbea509a049b08f8119ed875ffc2e8d5
2021-04-16 14:58:24 +00:00
Almaz Mingaleev
8533c0b3ca Add copy builder to TimeZoneCapabilities.
This method is added to change capabilities
more easily in Robolectric's TimeManager shadow class.

Bug: 159891384
Test: atest core/tests/coretests/src/android/app/time/*
Change-Id: I10b964666e93af9c2c4ead50088773a77521db65
2021-04-16 14:51:51 +00:00
Stanislav Zholnin
ea9ab1d98c Merge "Deduplicate discrete events for different attribution tags." into sc-dev 2021-04-16 10:08:16 +00:00
Stanislav Zholnin
16f0115c0e Merge "Deduplicate discrete operation before delivering result." into sc-dev 2021-04-16 09:16:45 +00:00
Ben Lin
ca25625601 Add Activity#onPictureInPictureUiStateChanged and PictureInPictureUiState.
This adds a new API on Activity such that app developers can get signals
when certain PiP UI states change, e.g. stash/unstashed. The idea is that
when PiP is stashed, the activity will get a signal to do anything they
wish, such as pausing/resuming video-like contents.

Bug: 182409584
Test: atest PinnedStackTests#testPictureInPictureStateChangeCallback
Change-Id: I308f3f1c3af8d1a54b63311fb3beaee77d6c7922
2021-04-15 13:42:17 -07:00
Donald Chai
1430546720 Merge "Fix typo" am: 6b5e6bba9b am: f3fcd261ee am: afa759cd3e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1676087

Change-Id: I4314a44429c15068058251d52d3cfaa34e3213b5
2021-04-15 19:27:06 +00:00
Donald Chai
afa759cd3e Merge "Fix typo" am: 6b5e6bba9b am: f3fcd261ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1676087

Change-Id: I933a3bba4bf54759c015772455372be3a2ab64f1
2021-04-15 18:37:11 +00:00
Hongwei Wang
e7cfb0bb28 Merge "Fix back stack for PiP from multi-activity Task" into sc-dev 2021-04-15 17:34:19 +00:00
Alex Johnston
a1ef67897d Merge "PasswordPolicy.getMinMetrics PIN" into sc-dev 2021-04-15 15:21:01 +00:00
Alex Johnston
3fd4388757 PasswordPolicy.getMinMetrics PIN
* If the password quality is NUMERIC
  or NUMERIC_COMPLEX, the credential
  type should be CREDENTIAL_TYPE_PIN

Bug: 184103377
Test: atest com.android.server.devicepolicy.PasswordPolicyTest
      atest android.app.admin.PasswordMetricsTest
      atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest
      atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.password
      CtsVerifier > Device owner tests > policy transparency test
      > set password quality
Change-Id: Ibad35d22c34b6cd9ed34b2e671b38503becd7da5
2021-04-15 15:20:12 +00:00
Ashwini Oruganti
aeb5dbf1c5 Merge "Enforce the PI mutability flag requirement for test apps" into sc-dev 2021-04-15 15:13:23 +00:00
Stanislav Zholnin
f2a4eb5908 Deduplicate discrete events for different attribution tags.
Test: in development
Bug: 176965672
Change-Id: Ia9fa0eefaba21d93eb9c28163939fb0490a008d6
2021-04-15 12:33:30 +01:00
Stanislav Zholnin
54a17ad39d Deduplicate discrete operation before delivering result.
Before returning result from the API, we go through the list
of all AttributedOpEntries and those which have the same
timestamp are merged into single AttributedOpEntry without
losing any information (it is still possible to query
AttributedOpEntry with different flags / uidstates and get
all the same information).

This CL addresses issue with duplication due to accesses
with different flags / uidstates.

Test: in development
Bug: 176965672
Bug: 183961838
Change-Id: I319dd321a3bfddf0855c10213c49824e9599eb66
2021-04-15 11:23:43 +01:00
Charles Chen
ac8d924dc3 Merge "Introduce WindowProviderService" into sc-dev 2021-04-15 05:43:08 +00:00
Charles Chen
49cd50b3fd Introduce WindowProviderService
A Window Provider Service is a Window-Context-like Service which handles
UI
components and is able to obtain the latest configuration.
The differences between a Window Context and a Window Provider Service
is that:
1. It is always associated with the primary display before
   attachWindowToken() or WM#addView is called. It is suggested to
render UI
   components after calling the APIs mentioned above.
2. A window context registers the listener in constructor and
   unregisters it in finalize(), while a window provider service
   registers the listener in onCreate() and unregisters in onDestroy().
3. Like the API Context#createWindowContext(int windowType, Bundle
options),
   the users of a Window Provider Service need to override
provideWindowType and
   provideOptions to pass the attributes.
4. When there's a configuration updates from the server side,
   the Service#onConfigurationChanged callback will be invoked.(TBD)
It is suggested to use window context when possible. This class is to
migrate the
Service to show UI components to the window context concept. We can't
migrate them
to WindowContext directly because developers are used to use this kind
of Service as
the container of UI components and may change its property at runtime.
An example is that keyboard developers may apply a new theme by
InputMethodService#getResources#setTheme(newTheme).

Bug: 159767464
Test: atest WindowContextTests#testWindowProviderServiceLifecycle

Change-Id: I7d537fd2d128efa28aa6e771d77aa105fb497672
2021-04-15 02:45:36 +00:00
Jeff DeCew
fe8298fde3 Merge "Fix notification background color" into sc-dev 2021-04-14 23:33:43 +00:00
Donald Chai
979191a80b Fix typo
Change-Id: I2fccfa4d88e157eccaa822105484ae56297bc1c9
2021-04-14 23:26:30 +00:00
Hongwei Wang
7f64b14478 Fix back stack for PiP from multi-activity Task
Details in design doc go/pip-and-back

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/g8lbXnC8ln0t54ARxfPELo
Bug: 184758170
Test: ensure back stack works for Netflix, see video
Test: atest PinnedStackTests
Test: atest RootWindowContainerTests
Change-Id: I9e2f8d0d50dd107ff30fd7afe6273d8347aac803
2021-04-14 15:00:31 -07:00
Ashwini Oruganti
8b71ad9ab4 Merge "Add an excludedPermission arg to filter the set of apps that a broadcast gets sent to" into sc-dev 2021-04-14 20:30:06 +00:00
Tony Mak
ccb5678569 Add some TestAPIs for replacing some @hide API usages in ExtServices's test
Added a builder class for UsageStats and StorageVolume. This allows
us to create these data classes for testing.

Currently, a test in ExtServices creates these objects by using some
hidden APIs. Those tests are part of the mainline test suite, we should
not use hiden APIs there. Otherwise, the test APK cannot be installed on
older platforms.

Test: atest ExtservicesUnitTest

Bug: 182546925
Change-Id: I32939dedfa55233dfb27337cee8818a9dc25d786
2021-04-14 20:41:56 +01:00
Jeff DeCew
451f3ff377 Fix notification background color
This color isn't shown; merely used for color contrast calculations

Test: manual
Bug: 184982648
Change-Id: I6b2b49287f282fd748f075181cfa37217491b012
2021-04-14 14:33:02 -04:00
Antoan Angelov
f78b620609 Merge "Update EXTRA_PROVISIONING_SUPPORTED_MODES values to flags" into sc-dev 2021-04-14 14:08:19 +00:00
Jeff DeCew
42cef834c7 Merge "Clean up MessagingLayout notifications" into sc-dev 2021-04-14 12:47:24 +00:00
Pavel Grafov
7ecbda5d91 Merge "API review: change getKeyPairGrants return type" into sc-dev 2021-04-14 09:58:49 +00:00
Paul Hu
68c58b9ccd Merge "Add [get|set]MaxManifestReceiverApiLevel to test api for CTS" into sc-dev 2021-04-14 04:52:38 +00:00
Bill Yi
4167bf213c Merge RQ2A.210405.006 to aosp-master - DO NOT MERGE
Merged-In: I735b41ed53ce7d374b5d36c4aee79f73d0334234
Merged-In: I9999bfe514fffa9f300643e74942db5ae556670a
Change-Id: If4b670a158e561d8feb03e12aef2d295c5109d43
2021-04-13 19:36:45 -07:00
Jeff DeCew
f9139ded2a Merge "Add CallStyle.setIsVideo(boolean)" into sc-dev 2021-04-14 00:37:12 +00:00