Commit Graph

23140 Commits

Author SHA1 Message Date
Sudheer Shanka
ffa1d57dae Inform Application thread to block for network rules to be updated.
Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ie37173d0d3f4034a74b834550920530166cd4201
2022-04-09 22:39:12 +00:00
Sudheer Shanka
6889563b7e Merge "Inform AMS about the uid blocked reasons." into tm-dev 2022-04-09 05:13:36 +00:00
Joanne Chung
5ed1be6c4c Merge "Disable these four test cases of HotwordDetectionServiceBasicTest" into tm-dev 2022-04-09 01:47:43 +00:00
Sudheer Shanka
73380fec52 Inform AMS about the uid blocked reasons.
This will be used to let the application thread
know whether or not to block for network rules to
be updated when coming to the foreground.

Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I9bff481a0026fb57af8dbee580e617c8410f9ebe
2022-04-08 13:45:54 -07:00
Prabir Pradhan
6b3c6cae3f Revert "Change input injection security model to require INJECT_..."
Revert "Update WindowInputTests after changing injection permiss..."

Revert "Change input injection security model to require INJECT_..."

Revert submission 17125748-require-inject-events-permission

Reason for revert: b/228203157, b/228194124, b/228583652
Reverted Changes:
Ib0d66eff3:Change input injection security model to require I...
Ief1a2f10c:Update WindowInputTests after changing injection p...
Ie2d8d0c3d:Change input injection security model to require I...

Change-Id: I4e77238f00ccd6379486ba77613430fbf166821c
2022-04-08 17:49:17 +00:00
Joanne Chung
d9e3762e33 Disable these four test cases of HotwordDetectionServiceBasicTest
We disable these four test cases temporarily from presubmit.
We will add back after fixing test fail.

Bug: 225076204
Test: atest CtsVoiceInteractionTestCases

Change-Id: I0cdc92cb37db305df75947502e3569bfc38795a3
2022-04-09 00:05:36 +08:00
Prabir Pradhan
8e03ce9a9d Instrumentation: Wait for finish when injecting pointer events
The input injection mode for pointer events in sendPointerSync() was
accidentally changed to WAIT_FOR_RESULT instead of WAIT_FOR_FINISH in
ag/17506923, causing test failures. Change it back to WAIT_FOR_FINISH.

Bug: 228203157
Bug: 228201593
Test: atest HoverTest
Change-Id: I2d3a77621290509d5be6279ee450e1881bd9d84d
2022-04-08 13:05:12 +00:00
Ricky Wai
417df3f1e9 Merge "Add hidden flag in ActivityOptions to ignore PendingIntent creator foreground state" into tm-dev 2022-04-08 11:13:22 +00:00
Prabir Pradhan
605556d50e Merge "Remove exception for injecting pointer event from sendTrackballEventSync" into tm-dev 2022-04-06 14:36:57 +00:00
Antoan Angelov
42121eea73 Merge "Update javadoc for role holder updater action" into tm-dev 2022-04-05 18:57:50 +00:00
Shivam Agrawal
87550b067a Merge changes from topic "embedding-race-condition" into tm-dev
* changes:
  Send Split Info Callback before Activity#onCreate
  Revert "Removing TaskFragment token from LaunchActivityItem"
2022-04-05 18:36:49 +00:00
Prabir Pradhan
be382c32b3 Remove exception for injecting pointer event from sendTrackballEventSync
Starting from T, a MotionEvent's default source is SOURCE_CLASS_POINTER.
This means injecting a newly obtained MotionEvent into
sendTrackballEventSync would cause the exception to be triggered.

Adding such an exception doesn't make sense in T, since it adds the
additional precondition to sendTrackballEventSync that the MotionEvent's
source must correctly configured. This precondition did not exist before,
so we remove the exception.

Bug: 228194124
Test: atest android.app.cts.DialogTest
Change-Id: I039e30e6c768ce11c64d077d20373da12f27b72f
2022-04-05 18:04:40 +00:00
Jing Ji
e1eb2bf9a3 Merge "Add a parameter to the internal FGS notification listener" into tm-dev 2022-04-05 11:31:12 +00:00
Jing Ji
3d57c22c0e Add a parameter to the internal FGS notification listener
Don't use the notification ID to determine if it's being
canceled or not.

Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: I0ddcb7de57800c5f8b69100353ba7f71157a5448
2022-04-04 19:50:51 -07:00
Prabir Pradhan
edff385132 Change input injection security model to require INJECT_EVENTS permission
Previously, any app could inject input events into the system via the
IInputManager#injectInputEvent API. The injection was only allowed if
the input event targeted a window owned by the same UID as that of the
process calling the API. This had drawbacks metioned in the bug.

Here, we change the input injection security model so that the signature
permission INJECT_EVENTS is required to inject events. This permission
is given to the system and the shell, so input injection can still be
done through the 'adb shell input' command. We also allow injection from
instrumeted processes where the instrumentation source has the
permission. For exmaple, running a test from the shell allows for the
test to inject events.

We also add support for a targeted injection mode, where the input
injection succeeds only if the target window for the event is owned by
the provided UID. This allows us to support injection from the
Instrumentation class, which only allows for injection into windows
owned by the same UID. In contrast to this, injection from the
UiAutomation class will target all windows, including system and spy
windows.

Bug: 207667844
Bug: 194952792
Test: atest inputflinger_tests
Test: atest WindowInputTests
Test: manual with test app: app cannot inject navigation gestures
Change-Id: Ib0d66eff3fc2f061e7c0d3b7e139a841a9bcebc7
2022-04-04 19:22:51 +00:00
Sudheer Shanka
ec157586d7 Merge "Inform NPMS about the app coming to the TOP state early." into tm-dev 2022-04-04 09:56:02 +00:00
Shan Huang
69a3984aae Remove OnBackInvokedDispatcherOwner interface.
Test: m -j update-api. Build and flash and test back behavior throughout
the system.
Bug: 227500290

Change-Id: Ibdb13d02e044741d05d99f1cad96e43dc0129fe4
2022-04-01 20:27:34 +00:00
Vadim Caen
d0923a2197 Merge "Split animation methods out of OnBackInvokedCallback" into tm-dev 2022-04-01 20:13:30 +00:00
Vadim Caen
c627777dda Split animation methods out of OnBackInvokedCallback
This makes OnBackInvokedCallback SAM compatible

Bug: 227789359
Test: atest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationLegacyTest \
        CtsWindowManagerDeviceTestCases:android.server.wm.BackNavigationTests \
        WmTests:com.android.server.wm.BackNavigationControllerTests \
        FrameworksCoreTests:android.window.BackNavigationTest \
        FrameworksCoreTests:android.window.WindowOnBackInvokedDispatcherTest \
        CtsViewTestCases:android.view.cts.OnBackInvokedDispatcherTest
Change-Id: Iab86b0488f1b3048eb02042191acaeb6a645a0bc
2022-04-01 20:09:26 +00:00
Prabir Pradhan
baf0f20718 Merge "Remove injectInputAfterTransactionsApplied from WMS" into tm-dev 2022-04-01 19:39:15 +00:00
arangelov
7507f95d65 Update javadoc for role holder updater action
Bug: 226414338
Test: none
Change-Id: Ica161a71df9b8ba85bb8c120ca2e614ae21b9820
2022-04-01 19:06:55 +01:00
Ricky Wai
b8a05514f7 Add hidden flag in ActivityOptions to ignore PendingIntent creator foreground state
Bug: 227431919
Test: atest BackgroundActivityLaunchTest
Change-Id: I7192f65e747e6048d3a26ecb203767290fa5406e
2022-04-01 13:57:20 +00:00
Jim Blackler
a4dd0499bd Merge "Add loading boost intervention for games." into tm-dev 2022-04-01 09:39:44 +00:00
Sudheer Shanka
e69f7fdbb6 Inform NPMS about the app coming to the TOP state early.
It's possible for an app to come to the TOP state before
the oomAdj computation is done and we cannot wait for
oomAdj computation to complete and then inform NPMS about
the state change. So, inform NPMS early about the state
change when we know the app is going to the TOP state.

Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I5d582618652cead179c419f7fe084283dd89d514
2022-03-31 19:51:55 -07:00
jimblackler
ac10e4a396 Add loading boost intervention for games.
Bug: 207845905
Test: atest com.android.server.app.GameManagerServiceTests
Change-Id: I2d0b4988797fe21bd7aec6d5351273757ae1a3ce
2022-03-31 20:38:29 +00:00
Lee Shombert
b53dad8cb0 Merge "Put a binder cache on DevicePolicyManager APIs" into tm-dev 2022-03-31 15:09:47 +00:00
Prabir Pradhan
603fea1fab Remove injectInputAfterTransactionsApplied from WMS
Since we already have IWindowManager#syncInputTransactions, we can
remove the need to have an input injection API in the window manager
interface.

Bug: 227356680
Test: presubmit
Change-Id: I730d05eec85978d8813e0924ddb4dba26922ea9f
2022-03-31 15:01:15 +00:00
Pratyush More
530587fb9e Merge "Enhance Javadoc for LocaleManager#setApplicationLocales." into tm-dev 2022-03-31 14:05:23 +00:00
Shivam Agrawal
39c6eaa64d Revert "Removing TaskFragment token from LaunchActivityItem"
This reverts commit 6dc124025d
in tm-dev. The revert is necessary because SplitController
needs to access the initial task fragment token from the
activity client to ensure that split info callbacks are sent
before an activity is created.

Test: existing tests pass
Bug: b/218791665
Change-Id: I7d6506312b46af026ec19e4aad9d0f31482e175a
2022-03-30 22:33:28 -04:00
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
Lee Shombert
fdd45a5c80 Put a binder cache on DevicePolicyManager APIs
Bug: 190489030

Put a binder cache in front of IDevicePolicyManager APIs.  The
following APIs are cached:
 * getKeyguardDisabledFeatures()
 * hasDeviceOwner()
 * getProfileOwnerOrDeviceOwnerSupervisionComponent()
 * isOrganizationOwnedDeviceWithManagedProfile()
 * getDeviceOwnerOrganizationName()
 * getOrganizationNameForUser()
 * isNetworkLoggingEnabled()

The caches use a shared key which means that all are invalidated at
the same time.  This is slightly less efficient than API-specific
invalidation but it greatly simplifies the invalidation logic in the
server.  The cost of invalidating all caches at the same time is small
if invalidation happens infrequently (less than one an hour, on
average).

The test classes are modified to disable caches in the local process.

Test:
 * atest FrameworksServicesTests:DevicePolicyConstantsTest
 * atest FrameworksServicesTests:DevicePolicyEventLoggerTest
 * atest FrameworksServicesTests:DevicePolicyManagerServiceMigrationTest
 * atest FrameworksServicesTests:DevicePolicyManagerTest
 * atest FrameworksServicesTests:EnterpriseSpecificIdCalculatorTest
 * atest FrameworksServicesTests:OverlayPackagesProviderTest
 * atest FrameworksServicesTests:OwnersTest
 * atest FrameworksServicesTests:PolicyVersionUpgraderTest
 * atest FrameworksServicesTests:SecurityEventTest
 * atest FrameworksServicesTests:SystemUpdatePolicyTest
 * atest FrameworksServicesTests:TransferOwnershipMetadataManagerTest

Change-Id: Iead8644cb413b45f3b6f3da81ff00a61788941a2
2022-03-30 12:49:05 -07:00
Pratyush More
4aee00f85e Enhance Javadoc for LocaleManager#setApplicationLocales.
This is being done in response to developer feedback. See the
attached bug for more info.

Bug: 226407732
Test: Javadoc change
Change-Id: I4e15e75db695eec650836da17074b1a2aae0fd5d
2022-03-30 12:35:19 +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