Commit Graph

23109 Commits

Author SHA1 Message Date
Shan Huang
1b284d865f Merge "Deprecate Activity#onBackPressed and Dialog#onBackPressed." into tm-dev 2022-03-31 00:17:02 +00:00
Evan Rosky
b4749ccefa Merge "Hook up shell-transitions screenshotting for recents" into tm-dev 2022-03-30 23:52:15 +00:00
Hongwei Wang
b2a5b198cd Merge "Handle PiP shadow radius in WMShell" into tm-dev 2022-03-30 22:23:51 +00:00
Evan Rosky
353fe11e5d Merge "Add alternative to deprecated API" into tm-dev 2022-03-30 22:23:05 +00:00
Evan Rosky
f0dfb84bcd Add alternative to deprecated API
Bug: 217742181
Test: N/A, just comment change
Change-Id: Icf995b30ff12fc65d6b7455bb18e92882ad9f58f
2022-03-30 20:15:45 +00:00
Kathy Chen
2816d09df5 Merge "Remove oneway from IAmbientContextManager." into tm-dev 2022-03-29 23:51:04 +00:00
Austin Borger
45081ab6a0 Merge changes from topics "b124224342", "change_procstate_flag" into tm-dev
* changes:
  Add new onUidProcAdjChanged callback to be consumed by the camera service.
  Modify UidRecord.CHANGE_PROCSTATE such that it behaves like a bit mask.
2022-03-29 21:52:36 +00:00
Kathy Chen
2efc9e5466 Remove oneway from IAmbientContextManager.
The AIDL interface is implemented by the system server. We need exceptions to propogate back to the calling app.

Test: cts test
Bug: 225108951
Change-Id: I0fcf58f3ecc204eb63644fa736b44f5a5b394be6
2022-03-29 13:09:03 -07:00
Austin Borger
db9165baf2 Add new onUidProcAdjChanged callback to be consumed by the camera
service.

The camera service needs to know when individual process oom adj scores
are changed in order to address bug #124224342. When two separate
processes are displayed in split screen and focus is switched between
them, both proc states will remain the same while their oom scores
change. This is a problem if both have access to the camera - we want
only one owner of the camera stream at any given time and for the app
in focus to be the one to own it.

This patch adds a new IUidObserver registration level for individual
process oom score changes. In addition a new callback has been added to
IUidObserver to track these changes.

Change-Id: I68d964f474d20f819f54b614a4e314ce00aac8fb
Bug: 124224342
Test: -- ActivityManagerServiceTest
      -- ActivityManagerProcessStateTest
      -- ActivityManagerFgsBgStartTest
      -- UidObserverControllerTest
      -- NetworkPolicyManagerServiceTest
      -- ShortcutManagerTest2
      -- HintManagerServiceTest
      -- VibrationSettingsTest
      -- CameraEvictionTest#testCamera2AccessCallbackInSplitMode (x100)
2022-03-28 19:46:45 -07:00
Jerry Chang
64d76ce090 Merge changes from topic "splitscreen_singletop" into tm-dev
* changes:
  Consolidate split screen rotation in shell transition
  Add a single-top root task for split screen
2022-03-29 02:13:29 +00:00
Hongwei Wang
2708c3a74d Handle PiP shadow radius in WMShell
Deprecate also the shadow radius for PiP in Task

Bug: 206508708
Test: Verify the PiP enter/exit/move/resize transitions
Change-Id: I8ff83dd4e626a3455373fed6c908cf131ecae8fe
2022-03-28 16:43:46 -07:00
Sharon Su
589c1ad6ba Merge "Add more status code to cinematic effect response." into tm-dev 2022-03-28 20:39:33 +00:00
Shan Huang
f66c4d611b Deprecate Activity#onBackPressed and Dialog#onBackPressed.
Test: m -j update-api
Bug: 195946584
Change-Id: I680884520074751e1c5fd0c7bd906a5f11f30236
2022-03-28 17:36:25 +00:00
Pavel Grafov
66de8ccfc8 Merge "Simplyfy DPM binder by using WifiSsidPolicy." into tm-dev 2022-03-28 15:32:01 +00:00
Sharon Su
26aff6fbcb Add more status code to cinematic effect response.
Bug: 213238425
Test: cts

Change-Id: I26dfc53b22817953839d9882398a502ea7293c08
(cherry picked from commit 85d76e06ce)
Merged-In: I26dfc53b22817953839d9882398a502ea7293c08
2022-03-26 05:16:18 +00:00
Sharon Su
affee4a5e1 Merge "Update WallpaperEffectsGeneration api, including annotations on data classes and allow the same uid process to call returnCinematicResponse API." into tm-dev 2022-03-25 17:05:09 +00:00
Pavel Grafov
8d2caa2b01 Simplyfy DPM binder by using WifiSsidPolicy.
WifiSsidPolicy is parcelable, so there is no need to marshall it
explicitly as a deny- or allow-list using separate getters and
setters.

Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
test: atest WifiSsidRestrictionTest
Bug: 218495535
Change-Id: Iee06acb6b136766fb16cef2d60a46bd7373b5c56
2022-03-25 12:59:11 +00:00
Mark Renouf
fe4b81853e Merge "Remove permission token from startActivityAsCaller" into tm-dev 2022-03-25 02:32:08 +00:00
Jerry Chang
d6b42472ea Add a single-top root task for split screen
Make direct children of a created-by-organizer task organizable.
Add a single-top root task which the split divider bar can attach to. So
we can remove the special logic of the divider bar z-ordering in the
followup patch.

Bug: 207185041
Fix: 215322621
Test: atest ZOrderingTests
Test: atest com.android.wm.shell.splitscreen
Test: manual check the divider bar z-order setup with pip window and
      assistant voice plate
Change-Id: Ia36d7529ef52685be4516b6f6ea5d7179fc26fd6
2022-03-25 00:58:09 +00:00
Sharon Su
bb146eff49 Update WallpaperEffectsGeneration api, including annotations on data classes and allow the same uid process to call returnCinematicResponse API.
Test: Manual test on device
Bug: 218570612
Change-Id: Ie12b570f1e6400ab9e289b882e5821921a609e0a
(cherry picked from commit 1611a8d1c5)
Merged-In: Ie12b570f1e6400ab9e289b882e5821921a609e0a
2022-03-24 23:08:08 +00:00
Antonio Kantek
f9cb8fa27b Merge "Update setInTouchMode javadoc" into tm-dev 2022-03-24 21:07:40 +00:00
Evan Rosky
da6af4048d Hook up shell-transitions screenshotting for recents
shell-transitions doesn't use IRecentsAnimationController, so
instead add a companion takeTaskSnapshot to ATMS and use that
in the RecentsAnimation adapter.

Bug: 226446305
Test: go to recents, start select-mode on live tile
Change-Id: I35a1e7be02a01767802eca02b6ba045a7c8309b0
2022-03-24 13:43:38 -07:00
Alex Johnston
c7df8de886 Merge "Require TRIGGER_LOST_MODE permission for sendLostModeLocationUpdate" into tm-dev 2022-03-24 17:20:56 +00:00
Hui Yu
63258db33d Merge "[Bugfix] Don't delete mPendingUids if PendingTopPid is added later than updateOomAdj started" am: 8f321a616b am: c9c23976a9 am: a0be2d5cc5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2036403

Change-Id: I278a9e0c7cf4f42431a40c054738873888bf033f
2022-03-24 17:17:09 +00:00
Hui Yu
a0be2d5cc5 Merge "[Bugfix] Don't delete mPendingUids if PendingTopPid is added later than updateOomAdj started" am: 8f321a616b am: c9c23976a9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2036403

Change-Id: Ie87188285f12c8d533ce053c1626a8080e04b67c
2022-03-24 16:46:13 +00:00
TreeHugger Robot
e61854471e Merge "RESTRICT AUTOMERGE Rename PermissionController resource constants" into tm-dev 2022-03-24 16:05:32 +00:00
Hui Yu
5e90a571ce Merge "Increase startForeground() timeout to 30 seconds." into tm-dev 2022-03-24 15:42:37 +00:00
Riddle Hsu
5ff11183cc Merge "Drop task snapshot with invalid hw buffer" into tm-dev 2022-03-24 14:23:49 +00:00
Issei Suzuki
215a637b6c Merge "Add ActivityOption to remove insecure keyguard when activity is launched." into tm-dev 2022-03-24 13:42:34 +00:00
Alex Johnston
f7a1a20815 Require TRIGGER_LOST_MODE permission for sendLostModeLocationUpdate
Changes:
* Use TRIGGER_LOST_MODE permission to gate the
  DevicePolicyManager API sendLostModeLocationUpdate

Bug: 223148704
Test: atest android.devicepolicy.cts.LostModeLocationTest
Change-Id: If15388a377c75b7581c9c2a35b3d9828f78e13fc
Merged-In: If15388a377c75b7581c9c2a35b3d9828f78e13fc
2022-03-24 12:29:28 +00:00
Riddle Hsu
5df3f27df3 Drop task snapshot with invalid hw buffer
The notifyTaskSnapshotChanged may not be always called after
Binder.clearCallingIdentity. And because there was commit
67b0902 that avoids keeping unnecessary buffer in remote
processes, it may mis-close the buffer in system server if
the calling pid isn't cleared on binder thread.

e.g. there are several suspects from ActivityTaskManagerInternal
Though it might be the responsibility of the caller to clear
binder identity before calling internal interfaces.

Instead of adding clearCallingIdentity every where:
1. Explicitly set the listener as local to skip closing the buffer
   so it is independent of which thread is calling.
2. Protect the persister when using the buffer.

Bug: 192143094
Bug: 220659717
Bug: 223950159
Bug: 225794452
Test: atest TaskSnapshotPersisterLoaderTest
Change-Id: I94e8e706e56a73fffe8189023bcef5efd797a24c
2022-03-24 08:44:31 +00:00
Antonio Kantek
afb41741b9 Update setInTouchMode javadoc
Update the javadoc for Instrumentation#setInTouchMode indicating that
starting from Android Tiramisu, this method will only take effect if the
instrumentation was sourced from SHELL or ROOT owned processes.

Test: m
Fixes: 222652344
Change-Id: I8af79acb11f17233f395412670c9f171aec80c59
2022-03-23 21:34:28 -07:00
huang chaopeng
2da542d368 [Bugfix] Don't delete mPendingUids if PendingTopPid is added later than updateOomAdj started
Analysis:
1.Doing updateOomAdjInnerLSP in backgroud, and it would last for a long
time
2.Now start a new Activity, windowManager save the latest topUid into PendingStartActivityUids
3.updateOomAdj task in step.1 done, and then delete all uids in PendingStartActivityUids
4.The topApp will be rejected by AppOps due to the deleting in step.3

Signed-off-by: huang chaopeng <huangchaopeng@oppo.corp-partner.google.com>
Change-Id: I52c7c2a8d6cb86b27b1f008cb56f670ce7698dc9
2022-03-24 10:47:35 +08:00
Sudheer Shanka
12e997720b Avoid checking for idle state when the app is in top state.
When we know that an app moved to a procstate that is considered
an interaction event, the app will not be in idle state. So, avoid
calling into UsageStatsService for idle state in this case.

Bug: 209338078
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I5648db595d2fd10a151da13e472fd905bcafe182
2022-03-23 18:25:18 +00:00
Mark Renouf
05a2ef2647 Remove permission token from startActivityAsCaller
The call is protected by the signature permission
START_ACTIVITY_AS_CALLER. This will remove the need for additional data
to be passed from system server.

Bug: 222082547
Bug: 226354782
Test: atest ActivityTaskManagerServiceTests, atest ChooserActivityTest,
      manual testing
Change-Id: I94f34a68e390569ec14dfebb1902a7c30558864f
2022-03-23 14:55:01 +00:00
kholoud mohamed
4b2931194e RESTRICT AUTOMERGE Rename PermissionController resource constants
Bug: 217388602
Test: N/A
Change-Id: I61b052ef831d38379adf6164cb881a1c9b2ea46a
2022-03-23 14:19:02 +00:00
Rubin Xu
a441d81b3a Merge "Secure REMOTE_BUGREPORT_DISPATCH" into tm-dev 2022-03-23 11:26:52 +00:00
Matt Pietal
e7ed33a577 Merge "Use new DevicePolicyManager#logoutUser() methods" into tm-dev 2022-03-22 12:40:54 +00:00
Rubin Xu
a4131c50d0 Secure REMOTE_BUGREPORT_DISPATCH
In remote bugreport collection, Shell sends REMOTE_BUGREPORT_DISPATCH to
DevicePolicyManagerService which in turn notifies Device Owners that a
bug report is ready for collection. There existed a threat where a
malicous user could spoof the REMOTE_BUGREPORT_DISPATCH broadcast via
ADB to send a crafted bugreport to the Device Owner. Securing
REMOTE_BUGREPORT_DISPATCH is not as easy as it appears: putting a
permission on REMOTE_BUGREPORT_DISPATCH does not work since both the
legitimate sender and the malicious user are UID_SHELL. Instead, we
introduces a nonce which was sent from DPMS to Shell when bugreport is
triggered, and DPM will only accept REMOTE_BUGREPORT_DISPATCH when
a matching nonce is seen.

Ignore-AOSP-First: security fix

Bug: 171495100
Test: atest DeviceOwnerTest#testRemoteBugreportWithTwoUsers
Test: atest DeviceOwnerTest#testAdminActionBookkeeping
Test: atest BugreportManagerTest
Change-Id: I7649b4f22b74647d152d76bb46d5ca70bfa3617d
2022-03-22 12:28:36 +00:00
Pablo Gamito
ace23e0e89 Merge "Read custom background when creating ActivityOptions from bundle" into tm-dev 2022-03-22 10:47:56 +00:00
Dave McCloskey
c5a7ed29de Merge "Changes to support reducing noise in active unlock notifications." into tm-dev 2022-03-21 19:15:01 +00:00
TreeHugger Robot
43d732feb3 Merge "Update fields for SecurityLog WiFi events." into tm-dev 2022-03-21 17:45:57 +00:00
Dave McCloskey
6c707a47da Changes to support reducing noise in active unlock notifications.
1. Add additional trigger onUserMayRequestUnlock
  - point existing trigger points from SystemUI to this
2. Argument added to onUserRequestedUnlock to indicate if user wants to
   dismiss keyguard.
3. Callback for result of grantTrust calls.
  - curently only calls back if device was unlocked as a result of the
    call

See design: go/au-noise-reduction

Note: changes made to SystemUI are manually tested and may need
refactoring which is being skipped now to meet the API Freeze deadline.

Bug: 225231929
Test: atest TrustTests
Test: Manual interaction with wake & fingerprint sensor
CTS-Coverage-Bug: 213944235
Change-Id: I8d08229f09c9a1f2295b7eb464d12cad0c6b8303
2022-03-21 09:00:43 -07:00
Charles Chen
8c1fad0d74 Merge "Fix #testChangeFontScaleNoRelaunch flaky" into tm-dev 2022-03-21 08:51:45 +00:00
Antoan Angelov
a443dccaad Merge "Add DevicePolicyManager#getPolicyManagedProfiles system api" into tm-dev 2022-03-20 20:08:50 +00:00
Kholoud Mohamed
a8e9aa390d Merge changes from topic "apiFeedback" into tm-dev
* changes:
  RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
  RESTRICT AUTOMERGE move device policy resource APIs to a separate class
  RESTRICT AUTOMERGE hide device policy resources constants
2022-03-19 06:30:43 +00:00
Sudheer Shanka
4b61ecc716 Merge "Add ACCESS_BROADCAST_RESPONSE_STATS permission." into tm-dev 2022-03-19 05:14:21 +00:00
Nikita Ioffe
3b5de448c2 Merge changes from topics "presubmit-am-1dec1aa04236490e8d2a03998a4272b7", "sdk-sandbox-instr" into tm-dev
* changes:
  Add a way to instrument sdk sandbox processes
  Sdk Sandbox should be able to see it's client app
2022-03-19 02:09:15 +00:00
kholoud mohamed
b7aedc6f3d RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
Bug: 217388602
Bug: 218875965
Test: atest EnterpriseResourcesTests
Test: manual
Change-Id: I8af03136e67057d171e97cb5a43187aa6c7f4fe7
2022-03-19 00:22:17 +00:00
kholoud mohamed
7cb1133b16 RESTRICT AUTOMERGE move device policy resource APIs to a separate class
Bug: 217388602
Test: atest EnterpriseResourcesTests
Change-Id: I83b399f36dfe3ba93d625807659dee59d872097e
2022-03-19 00:22:04 +00:00