Don't use the notification ID to determine if it's being
canceled or not.
Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: I0ddcb7de57800c5f8b69100353ba7f71157a5448
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
Test: m -j update-api. Build and flash and test back behavior throughout
the system.
Bug: 227500290
Change-Id: Ibdb13d02e044741d05d99f1cad96e43dc0129fe4
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
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
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
This is being done in response to developer feedback. See the
attached bug for more info.
Bug: 226407732
Test: Javadoc change
Change-Id: I4e15e75db695eec650836da17074b1a2aae0fd5d
* changes:
Add new onUidProcAdjChanged callback to be consumed by the camera service.
Modify UidRecord.CHANGE_PROCSTATE such that it behaves like a bit mask.
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
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)
Deprecate also the shadow radius for PiP in Task
Bug: 206508708
Test: Verify the PiP enter/exit/move/resize transitions
Change-Id: I8ff83dd4e626a3455373fed6c908cf131ecae8fe
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
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
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
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
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
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
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
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