Commit Graph

14580 Commits

Author SHA1 Message Date
TreeHugger Robot
9dc97a8c67 Merge "Fix javadoc error when building SDK" 2018-12-13 11:40:16 +00:00
Evan Rosky
6474e30926 Merge "Move policy handling into ATM hierarchy [4/n]" 2018-12-13 03:42:41 +00:00
Evan Rosky
1ac8446c69 Move policy handling into ATM hierarchy [4/n]
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
2018-12-12 16:41:30 -08:00
Rubin Xu
fd4a3b441b Implement DELEGATION_PACKAGE_INSTALLATION
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
2018-12-12 23:22:59 +00:00
Rubin Xu
6e2ee03497 Fix javadoc error when building SDK
Test: make -j110 PRODUCT-sdk_phone_armv7-sdk
Bug: 112982695
Change-Id: I09f1fcf7ae40adb78ff2fdd235498b666b96cfdb
2018-12-12 21:50:59 +00:00
TreeHugger Robot
559ff8acbc Merge "New API for getting the screen lock complexity" 2018-12-12 21:12:43 +00:00
Hui Yu
b8f2dff7c6 Merge "UsageStats tracking of screen usage." 2018-12-12 20:51:00 +00:00
Yueming Wang
a5abb4a711 Merge "Correct the doc for startViewCalendarEventInManagedProfile." 2018-12-12 19:14:38 +00:00
yuemingw
06891909bc Correct the doc for startViewCalendarEventInManagedProfile.
Bug: 118456236
Test: manually
Change-Id: Ie66dd25ae742246c41837dc0dee1b34ab4ae42dd
2018-12-12 19:12:15 +00:00
Yueming Wang
3dc2f1ef59 Merge "Add API to view calendar events cross profile." 2018-12-12 19:07:05 +00:00
Hui Yu
03d1240ef3 UsageStats tracking of screen usage.
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
2018-12-12 10:07:14 -08:00
Rubin Xu
eb45862718 Merge "Add three new delegation capabilities for profile/device owner" 2018-12-12 17:47:12 +00:00
Bernard Chau
e958655829 New API for getting the screen lock complexity
Return parent profile screen lock complexity if unified challenge is used

Bug: 111173457
Test: atest FrameworksCoreTests:PasswordMetricsTest
      atest FrameworksServicesTests:DevicePolicyManagerTest
      atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.PasswordComplexityTest
      manual test with sample app

Change-Id: I99f8bd644c5119590f49add98f216c4a527d6f2d
2018-12-12 17:43:49 +00:00
Milo Sredkov
fe2f96e01a Merge "Add setEditChoicesBeforeSending to RemoteInput" 2018-12-12 16:22:57 +00:00
Jeff Sharkey
8baa2c074f Merge "Mechanism for apps to gain write access to media." 2018-12-12 16:12:29 +00:00
Milo Sredkov
b2af7f978a Add setEditChoicesBeforeSending to RemoteInput
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
2018-12-12 14:25:19 +00:00
Adrian Roos
e77ff79fdb Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi" 2018-12-12 13:43:34 +00:00
Jeff Sharkey
e99566eda8 Mechanism for apps to gain write access to media.
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
2018-12-11 17:34:11 -07:00
yuemingw
369f96dd98 Add API to view calendar events cross profile.
Bug: 118456236
Test: .manual by TestDPC
cts test will be added later
Change-Id: I0d36586ea6017dea446abd8e609c2712ba88e93c
2018-12-11 22:20:33 +00:00
Hai Zhang
aa38fbeee2 Merge "Add listeners to observe role holders changes." 2018-12-11 22:13:53 +00:00
Rubin Xu
99a66a9032 Add three new delegation capabilities for profile/device owner
* 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
2018-12-11 21:16:31 +00:00
Adrian Roos
66f859135b API: Clean up redundant and ineffective usages of SystemApi and TestApi
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
2018-12-11 20:38:02 +01:00
TreeHugger Robot
1982ca78e3 Merge "Changed activity --intelligence option to --contentcapture" 2018-12-11 19:27:34 +00:00
Hai Zhang
31d06ba6b3 Add listeners to observe role holders changes.
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
2018-12-11 11:18:43 -08:00
TreeHugger Robot
b4815ebf76 Merge "[Multi-user] Change BackupManager AIDL to accept userId in methods" 2018-12-11 18:49:39 +00:00
Chandan Nath
cd44f75895 [Multi-user] Change BackupManager AIDL to accept userId in methods
Bug: 120120742

Test: 1) atest RunFrameworksServicesRoboTests
2) atest $(find \
frameworks/base/services/tests/servicestests/src/com/android/server/backup \
-name '*Test.java')
3) atest CtsBackupTestCases
4) atest CtsBackupHostTestCases
5) atest GtsBackupTestCases
6) atest GtsBackupHostTestCases
7) Toggle Backup/'Backup Now' in Settings
8) 'adb shell bmgr' enabled/backupnow flow

Change-Id: I5dba38f6a24e07947d1b0948f9caefeca011205d
2018-12-11 17:06:30 +00:00
Alex Kershaw
8a8430bff0 Merge "Add isManagedKiosk system APIs." 2018-12-11 17:02:25 +00:00
Alex Kershaw
2418ea970b Add isManagedKiosk system APIs.
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
2018-12-11 13:01:11 +00:00
Varun Shah
f17440439e Merge "Added a new "wellbeing" protection flag." 2018-12-10 22:46:14 +00:00
TreeHugger Robot
11468cdb86 Merge "Don't throw an exception if write failed" 2018-12-10 22:12:27 +00:00
Philip P. Moltmann
efcda865a5 Merge "Revert "Adds wrapper method to convert string ops to ints"" 2018-12-10 21:56:22 +00:00
Hai Zhang
f8b6203284 Merge "Add test for RoleManager." 2018-12-10 19:25:43 +00:00
Hui Yu
af4fcdcb91 Merge "Add manifest service attribute foregroundServiceType" 2018-12-10 18:59:49 +00:00
TreeHugger Robot
a5a81d2458 Merge "Add IMMS#showInputMethodPickerFromSystem." 2018-12-10 18:56:40 +00:00
Varun Shah
47f43001ed Merge "Added a new API for SUW: ActivityManager#switchUser(UserHandle)." 2018-12-10 18:33:36 +00:00
TreeHugger Robot
4c47901848 Merge "Add metrics for DevicePolicyManagerService methods (Part 1)" 2018-12-10 18:14:43 +00:00
Felipe Leme
b718e0301e Changed activity --intelligence option to --contentcapture
Test: adb shell dumpsys activity top --contentcapture
Bug: 111276913

Change-Id: Ie4986ba018b77ec5f03aa7fb4522b6b874ec7ebe
2018-12-10 09:58:37 -08:00
Makoto Onuki
e9d3ef1516 Merge "Prioritize FGS jobs over BFGS jobs" 2018-12-10 17:09:55 +00:00
Ruslan Tkhakokhov
473bf69769 Make restoreSome API be @SystemAPI
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.
2018-12-10 12:13:53 +00:00
TreeHugger Robot
2eb3473d0d Merge "Private DNS connectivity check" 2018-12-08 22:50:21 +00:00
Makoto Onuki
ec8b14d02e Prioritize FGS jobs over BFGS jobs
Also improve dumpsys output for priorities.

Also now "evaluated priority" is always printed, for easier debugging.

Bug: 111360323
Test: atest CtsJobSchedulerTestCases

Change-Id: Iee74eda5fb290cf46e7c8fdd74a0804d03328d29
2018-12-08 09:42:26 -08:00
TreeHugger Robot
e5bd844eaf Merge "Revert "Notify AutofillManager in onResume() IFF activity was not recreated."" 2018-12-08 16:25:27 +00:00
Varun Shah
5f303659c2 Added a new "wellbeing" protection flag.
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
2018-12-07 17:10:28 -08:00
arangelov
37a6217e5b Add metrics for DevicePolicyManagerService methods (Part 1)
CTS tests will be added in a later CL.

Bug: 119911940
Test: Manual
Change-Id: I040deec232e40b223821a5c521661310f78e6cba
2018-12-07 22:03:42 +00:00
Jeff Sharkey
53dc18ba95 Merge "Define app-op controlling legacy storage behavior." 2018-12-07 20:55:15 +00:00
Ben Lin
e55cd3e84a Revert "Notify AutofillManager in onResume() IFF activity was not recreated."
This reverts commit e579033d76.

Reason for revert: b/120160981, broke CTS

Bug: 120160981
Change-Id: I2caa58b155e24281ae02f96dc9c54458df15fc5a
2018-12-07 20:30:57 +00:00
Wei Wang
c90e979d6e Merge "Throttle jobs when thermal status is in THROTTLING_SEVERE and above" 2018-12-07 19:17:40 +00:00
Selim Cinek
691f5a71a2 Merge "Fixed a padding issue if there is no right icon but a reply icon" 2018-12-07 18:41:18 +00:00
Amith Yamasani
6283cb89ae Don't throw an exception if write failed
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
2018-12-07 10:12:13 -08:00
TreeHugger Robot
c3effa7b8d Merge "Add extra in DevicePolicyManager for provisioning trigger." 2018-12-07 17:43:22 +00:00