Moves Task-level policy into configuration update
This moves most of the configuration policy logic out of
updateOverrideConfig and into the configuration update via
the new resolveOverrideConfiguration stage. The advantage
of this is that the TaskRecord configuration is more
adaptive: for example, minimal task bounds enforcement
is now done during resolve, so the task's override bounds
can be retained even when the task is drawn bigger. This
also fixed some issues with minimal task bounds (ie. it
no-longer relies on exact size-match).
As part of this, a bunch of logic was pulled out of the
StackWindowController and moved/rewritten in TaskRecord.
This was done so that the policy logic would be more
adaptive to changes in their parents and to help with
our ATM/WM merge goal.
This also presented an opportunity to move more resize
logic into the separate displayed bounds paradigm.
Bug: 113900640
Test: go/wm-smoke + wmtests
Change-Id: Ie27020616983646b274b073f17accea627399df0
Previously a Device Owner or an affliated Profile Owner of the DO can silently
install APKs via PackageInstaller APIs. This CL additionally grants delegates
of DO the same access.
Bug: 112982695
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegation
Change-Id: I777ee6aa1ecd036ee56270fc6b4e86b74d1042a6
1. Add UsageStats Event types:
ACTIVITY_RESUMED is synonym to existing MOVE_TO_FOREGROUND.
ACTIVITY_PAUSED is synonym to existing MOVE_TO_BACKGROUND.
ACTIVITY_STOPPED when an activity becomes invisible on the UI.
2. In UsageStats.java, add API getLastTimeVisible() to report last time the
app is visible (ACTIVITY_RESUMED or ACTIVITY_PAUSED), add API getTotalTimeVisible()
to report total time the app is visible.
The existing API getLastTimeUsed() can report last time the app is in
foreground (AKA have focus).
The existing API getTotalTimeInForeground() can report total time the
app is in foreground (AKA have focus).
3. UsageStats.getTotalTimeVisible() can report screen usage for
split-screen mode and picture-in-picture mode.
4. Because in the same package, activity can be instantiated multiple times,
In UsageEvents.Event class, add a member mInstaceId for activity's
instance ID, add interface getInstanceId() to retrieve the instance ID.
Bug: 112002260
Test: frameworks/base/services/tests/servicestests/src/com/android/server/usage/UsageStatsDatabaseTest.java
atest frameworks/base/core/tests/coretests/src/android/app/usage/UsageStatsTest.java
Change-Id: Ibcef2488e9620804c9f9220b027f976e8fa0c98b
Allow apps to specify whether users should be able to edit smart replies
before sending them.
Bug: 111438374
Test: atest RemoteInputTest
Test: mp /vendor/google_experimental/users/cinek/Notify, post a notification with "Edit choices before send"
Change-Id: I9a37216916f05152d8ab7061ffa121948de0976a
For apps that aren't the default gallery or music app, the new storage
model in Q only allows them to read media they don't own. We
recognize there's a valid use-case for editing or deleting media
that an app doesn't own, but we want to get the user involved to
confirm the access grant.
This is implemented using a RecoverableSecurityException, so
existing apps can continue gracefully handling a SecurityException
that they recognize. Apps that have become aware of the new
permissions model can extract the RemoteAction and invoke it to
get the user involved and gain access.
Bug: 111892459
Test: atest android.appsecurity.cts.ExternalStorageHostTest#testMediaEscalation
Change-Id: Ib34374197c8c1f5236ba8a1062065914e0a9e9f9
* DELEGATION_NETWORK_LOGGING
Allow delegated apps to control and retrieve network logging
* DELEGATION_CERT_SELECTION
Allow delegated apps to automatically select client certificates for apps.
* DELEGATION_PACKAGE_INSTALLATION
Allow delegated apps to silently install packages.
Also introduce DelegatedAdminReceiver which is analogue of the existing
DeviceAdminReceiver and enables delegated apps to receive system callbacks
related to their delegated capabilities.
This CL introduces the three new delegation scopes as well as some
implementations changes required to support these three delegations.
it also implements the actual logic around DELEGATION_NETWORK_LOGGING
and DELEGATION_CERT_SELECTION. Handling DELEGATION_PACKAGE_INSTALLATION
will be implmented in a subseqent CL.
Bug: 112982695
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegation
Test: Manual with TestDPC-replica
Change-Id: I508fdda0572041cf121d0e297c93d51e981545e3
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.
In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.
Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
This change adds the ability to add listeners to observe role holder
changes. This will be used by the new role management UI and other
system components that used to put the default app in settings and
observe settings change.
Bug: 110557011
Test: manual
Change-Id: I2a8eb39220081e3be801adb970b60c55ebc297c7
Add system APIs isManagedKiosk and isUnattendedManagedKiosk. These will
be defined in the CDD.
The intention is to have privacy and security-approved definitions that
future features (removing user consent dialogs, stronger APIs) can use
specifically for publicly-accessible dedicated devices.
We use 'kiosk' rather than 'publicly-accessible dedicated device' for
ease-of-use, which is actually consistent with ChromeOS.
Bug: 111384878
Test: Each use will have its own CTS tests. The definitions themselves
will be in CDD. Currently tested by calling the methods in TestDPC.
Change-Id: If080a3b9dae285bc28823e6004750908009130d2
Bug: 112292976
Test: atest RestoreSessionHostSideTest
Change-Id: Ic453be3ffed43a48839b3bcaf19438d9987eb201
RestoreSession#restoreSome is used from pixelmigrate to start a systemRestore
of packages selected by user, currently this needs to be done via reflection.
Also improve dumpsys output for priorities.
Also now "evaluated priority" is always printed, for easier debugging.
Bug: 111360323
Test: atest CtsJobSchedulerTestCases
Change-Id: Iee74eda5fb290cf46e7c8fdd74a0804d03328d29
Permissions that have the new wellbeing protection flag will be granted
to the wellbeing app, as defined by the OEM in the system resource.
The ACCESS_INSTANT_APPS permission is updated to use the wellbeing
flag. The SUSPEND_APPS permission will also follow the same model now.
Bug: 119330345
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Test: atest com.android.server.pm.SuspendPackagesTest
Test: atest com.google.android.suspendapps.permissionpolicy.gts.SuspendAppsPermissionPolicyTest
Change-Id: Iffedc7704824292be48a4ef198fff97c1e5c39da
When passing input/output streams between shell command
and caller via UiAutomation, the stream could be closed
by the instrumentation test. Don't throw an exception
if the write failed (due to race). Just log the error.
Change-Id: I601589c6dc36fe51f5cc57276084a11f0be3d57d
Fixes: 119848628
Test: atest CtsAppTestCases:ActivityManagerProcessStateTest