Commit Graph

13082 Commits

Author SHA1 Message Date
TreeHugger Robot
3844e1d83c Merge "Unload wallpaper bitmap and release HwuiContext" into pi-dev 2018-03-28 01:59:26 +00:00
TreeHugger Robot
11866a4242 Merge "Hide activities when AOD comes in" into pi-dev 2018-03-28 01:11:42 +00:00
TreeHugger Robot
1c73370df4 Merge "Sending MY_PACKAGE_SUSPENDED to suspended apps" into pi-dev 2018-03-28 00:45:23 +00:00
Lucas Dupin
41c25cee06 Unload wallpaper bitmap and release HwuiContext
To decrease sysui memory usage

Test: adb dumpsys meminfo
Fixes: 74534423
Change-Id: I3cb4a5927e8d6b20a7aeba3fda253f0ba4cc18f6
2018-03-27 16:30:07 -07:00
Dianne Hackborn
00f3c4333e Merge "Work on issue #74404949: Screen state usage API" into pi-dev 2018-03-27 22:40:51 +00:00
TreeHugger Robot
17b6490ce1 Merge "Regularize some wallpaper APIs" into pi-dev 2018-03-27 21:50:31 +00:00
Dianne Hackborn
ced54398cc Work on issue #74404949: Screen state usage API
Add usage stats tracking of screen time.  There are two new
events, one for when the device is an interactive state, the
other for when it is non-interactive.  Also add a whole new
usage stats API for retrieving aggregated data that is associated
with general events, not particular packages.  In this case
it allows you to find the time the device spent interactive
and non-interactive and the count of the transitions in to
each of those states.

Bug: 74404949
Test: atest CtsUsageStatsTestCases:UsageStatsTest\#testInteractiveEvents

Change-Id: Ibe6d55e2aecb0c8519b1358644378ec5c7a4250d
2018-03-27 13:27:20 -07:00
Lucas Dupin
47a65c79c9 Hide activities when AOD comes in
Display timeout does not lock the keyguard, which means that
activities won't immediatelly disappear.

We need to factor AOD into to equation to make sure that
the user won't see phantom activities under the status bar
window when the display times out.

Fixes: 73120928
Test: open Settings, wait for display timeout
Test: Wait for display timeout, press power, see launcher
Test: Launch maps, start navigation (FLAG_SHOW_WHEN_LOCKED)
Test: Go to AOD, press power button: activity is occluding keyguard
Test: Press home: bouncer shows up
Test: Unlock: maps goes into pip mode
Test: Go to AOD and back to lock screen: keyguard visible
Test: Expand maps, go to AOD, back to lock screen: maps is occluding keyguard
Change-Id: I9b7512313af2f851d8788ec53de7880bce3bed2c
2018-03-27 12:12:14 -07:00
Andrii Kulian
dbac87dd40 Merge "Use transaction for local activity relaunch" into pi-dev 2018-03-27 17:24:42 +00:00
TreeHugger Robot
a9975804a2 Merge "API council requested tweaks to JobInfo." into pi-dev 2018-03-27 16:25:23 +00:00
Jeff Sharkey
8474ca0246 API council requested tweaks to JobInfo.
Split network estimates into separate download/upload values, and
add missing accessor methods.

Test: none
Bug: 74945408, 74032541, 74032817
Change-Id: I4c92b8a867690dc4f048701f13142655c3370958
2018-03-27 08:41:42 -06:00
Eric Sandness
9f36c26f83 Merge "Permission Check For DPM.isDeviceProvisioned" into pi-dev 2018-03-27 12:25:53 +00:00
Yueming Wang
3cc7c4fc76 Merge "Add javadoc to explain ApnSetting conflict." into pi-dev 2018-03-27 10:19:13 +00:00
Eric Sandness
1ad8367249 Merge "Permission Check For DPM.getUserProvisioningState" into pi-dev 2018-03-27 09:52:58 +00:00
Eric Sandness
df30c7d2e0 Permission Check For DPM.isDeviceProvisioned
Require the caller of DPM.isDeviceProvisioned() to hold the MANAGE_USERS
permission.  The only callers should be within the framework itself, or
apps involved in device provisioning which already hold this permission.

Bug: 62343414
Test: Set TestDPC as Device Owner and use it to reset password
Test: com.android.server.devicepolicy.DevicePolicyManagerTest
Test: com.android.server.locksettings.LockSettingsServiceTests
Test: com.google.android.gts.devicepolicy.DevicePolicyManagerTest
Change-Id: Ie53deb5ba8679a5b431f2a8da60ec9710c44d56f
2018-03-27 09:13:11 +00:00
yuemingw
6586f05457 Add javadoc to explain ApnSetting conflict.
As per discussion with Amit, it's better to define "conflict"
of ApnSetting in DevicePolicyManager API javadoc.

Bug: 72153573
Test: not required.
Change-Id: I765dace36a3c9c491c988dc0a87479cdec620e37
2018-03-27 08:29:05 +00:00
Andrii Kulian
914aa7da7f Use transaction for local activity relaunch
To know that onPostCreate callback should be executed we should use
TransactionExecutor for the entire transaction. It will fill
PendingActions object during the launch and the callback will be
triggered after onStart.
This CL changes local activity relaunch to use Lifecycler
infrastructure. We should immediately execute local recreate
requests, because if we wait until the scheduled message to be
handled, we may already be in a different state and final state
request in the scheduled relaunch transaction will already be
obsolete.

Bug: 72029061
Bug: 64610483
Bug: 76088057
Bug: 73747058
Test: ActivityLifecycleTests
Change-Id: Ia53ecd199c83d030932c4493064e58568805f2a5
2018-03-26 23:40:01 -07:00
Suprabh Shukla
2fd43ba63e Sending MY_PACKAGE_SUSPENDED to suspended apps
Added new broadcast actions MY_PACKAGE_SUSPENDED and
MY_PACKAGE_UNSUSPENDED, which are sent to the package that is affected
by the suspend state change. A suspended package also receives a bundle
of app extras to pass more information. This makes it easier for
packages to deal with being suspended/unsuspended.

Also updated some existing documentation to make it clearer.

Test: atest com.android.server.pm.SuspendPackagesTest

Bug: 75036698
Change-Id: I772cf0c023669bc946e07ced4ebccfa74f6835b2
2018-03-26 18:01:13 -07:00
Jason Monk
fc704e2fd7 Merge "Security fixup for Slices" into pi-dev 2018-03-26 21:44:38 +00:00
Christopher Tate
105540da41 Regularize some wallpaper APIs
Specifically:

  + support clearing wallpapers, with similar permissions to setting
  + support adjusting padding, with similar permissions as defining
    wallpaper dimension hints (which behave somewhat similarly)

Bug: 62343054
Test: atest CtsPermissionTestCases:NoWallpaperPermissionsTest
Change-Id: Ia25f2791a20564c58096a25e6e189aa3b06b411c
2018-03-26 11:26:50 -07:00
Benjamin Franz
3ff20e2257 Merge "Expose hidden API to check whether a given package is state protected" into pi-dev 2018-03-26 09:15:41 +00:00
TreeHugger Robot
6da53af9c5 Merge "Guarding collisions in TimeSparseArray" into pi-dev 2018-03-24 22:36:21 +00:00
Suprabh Shukla
2811d92483 Guarding collisions in TimeSparseArray
TimeSparseArray - used to store UsageEvents - can keep at most one event
per millisecond, which can result in an event being replaced by another
event that occurred close enough that the system records it at the same
millisecond.

Test: atest android.app.usage.TimeSparseArrayTest

Fixes: 73832306
Change-Id: I860a101ab098f65d5c5832758832f43572865690
2018-03-23 17:51:20 -07:00
Andrii Kulian
603b911e48 Merge "Revert "Use transaction for local activity relaunch"" into pi-dev 2018-03-23 23:36:02 +00:00
Wale Ogunwale
444885b10d Merge "Don't show unsupported sdk warning in test harness." into pi-dev 2018-03-23 23:32:54 +00:00
Amith Yamasani
8808edb063 Merge "Provide app launch count in UsageStats" into pi-dev 2018-03-23 19:13:22 +00:00
Jason Monk
ac11238291 Security fixup for Slices
- Allow slice providers to override grant flow
 - Remove overriding caller, that was a terrible idea
 - Move where the same app check happens to allow for CTS

Test: CTS
Bug: 69168488
Change-Id: I61c81c0665a08420b7bc83e3660657b62b2cd6a8
2018-03-23 15:08:11 -04:00
Eric Sandness
3780c09c76 Permission Check For DPM.getUserProvisioningState
Require the caller of DPM.getUserProvisioningState() to hold the
MANAGE_USERS permission.  All callers should be apps involved in device
provisioning, which already hold this permission.

Bug: 62343414
Test: Run Device Owner sync auth provisioning manually
Test: Set up work profile with managed account manually
Test: com.android.server.devicepolicy.DevicePolicyManagerTest
Test:
com.android.managedprovisioning.finalization.UserProvisioningStateHelperTest
Test: com.google.android.setupwizard.tests.activity.QrScanControllerTest
Change-Id: Ib85433586d4dfb89019ca223fb925aca3d4bbf67
2018-03-23 18:59:41 +00:00
Andrii Kulian
46312b3999 Revert "Use transaction for local activity relaunch"
This reverts commit 77d7360597.

Reason for revert: b/76088057

Bug: 72029061
Bug: 76088057
Change-Id: Ib1212740bcd5dd0fe8de87521e716c17b93c30cd
2018-03-23 18:33:35 +00:00
Petr Cermak
8e2731bfef Annotate RemoteInput#SOURCE_* with @IntDef
This patch addresses a request from the API Council (http://b/74409378).
It defines a new RemoteInput.Source annotation for RemoteInput source
constants.

Bug: 74409378
Test: atest RemoteInputTest
Change-Id: I78a006b6a600ea0c0603b2591d1a29596074a44e
2018-03-23 15:51:12 +00:00
TreeHugger Robot
51856fde2b Merge "Updated the styling for notifications" into pi-dev 2018-03-23 00:02:35 +00:00
TreeHugger Robot
6affc07065 Merge "APIs to suspend packages with SUSPEND_APPS permission" into pi-dev 2018-03-22 22:15:31 +00:00
Wale Ogunwale
402de825e7 Don't show unsupported sdk warning in test harness.
Also, added test api AM.alwaysShowUnsupportedCompileSdkWarning
that allows for forec showing the warning for an activity
component running in a test harness.

Change-Id: I72f6a8425cb6adc6060c70b2165aa82b459769f7
Fixes: 75455658
Test: atest CtsActivityManagerDeviceTestCases:PrereleaseSdkTest
2018-03-22 15:03:32 -07:00
Nathan Harold
8a047a0c52 Merge "Add AppOp for IpSec Tunnels" into pi-dev 2018-03-22 21:14:36 +00:00
Amith Yamasani
bc813eb26e Provide app launch count in UsageStats
This counts the number of times the app was launched from outside
the app and ignores intra-app activity transitions.

Introduce a new permission for registering to observe app usage.

Fixes a bug where Settings couldn't force the app into another
bucket if it was recently launched.

Bug: 74335821
Fixes: 76100712
Test: Manual test using Settings
Test: UsageStatsTest to verify permission change
Change-Id: Ibd343c1cfa37089a3ac6fc30ba3194e21a9be499
2018-03-22 13:51:57 -07:00
Suprabh Shukla
021b57ab8d APIs to suspend packages with SUSPEND_APPS permission
Changed the existing hidden api setPackagesSuspendedAsUser to a system
api setPackagesSuspended that can be called by apps with either
MANAGE_USERS or SUSPEND_APPS permission. Additionally, the suspending
app can now specify optional extra information meant to be used by the
suspended apps and the launcher to deal with this state.

The following other APIs are added:
 - isPackageSuspended(): Apps can query whether they are in a suspended
 state
 - @SystemApi getPackageSuspendedAppExtras(String): Apps with permission
 SUSPEND_APPS can get the appExtras passed to PM when suspending the
 app.
 - @SystemApi setPackageSuspendedAppExtras(String, PersistableBundle):
 Apps with permission SUSPEND_APPS can update app extras for a
 suspended package.
 - getPackageSuspendedAppExtras(): Apps can call to get the appExtras
 passed in to PM when they were suspended.

Test: Can be run via:
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.SuspendPackagesTest

Bug: 74336673
Change-Id: I3b9ed2c8478b34ee2e8986f5f5fddb2839d102e3
2018-03-22 12:59:57 -07:00
Benjamin Franz
7cc9a817d4 Expose hidden API to check whether a given package is state protected
Bug: 75997475
Test: manual
Change-Id: I5e0da781af6d148aed2247175e8ee5d9f244ebe1
2018-03-22 18:10:06 +00:00
Julia Reynolds
ae2f368907 Merge "Fix index error" into pi-dev 2018-03-22 11:39:28 +00:00
TreeHugger Robot
dcccfd9742 Merge "ScheduledJobStateChanged: add stop reason" into pi-dev 2018-03-22 01:30:52 +00:00
Selim Cinek
c7f5a827d6 Updated the styling for notifications
The new notifications now have different font weights
and colors to make the shade more readable.

Fixes: 69168591
Test: runtest systemui
Change-Id: I0b635724fa122d292841e56efa84aa57fa364300
2018-03-21 17:03:38 -07:00
Nathan Harold
1bb42067f0 Add AppOp for IpSec Tunnels
Add a new AppOp to allow bound system services
such as TelephonyDataServices and potentially
VPN providers to access the IPsec tunnel
management APIs. Since this is not directly
user-facing, and not all System apps should have
this privilege, the access is only granted via
an AppOp or to the system itself.

Bug: 66955045
Test: compilation (still WIP)
Change-Id: I0b0528c75c622d8538baeec019c3672cbed5d899
2018-03-21 15:23:39 -07:00
TreeHugger Robot
32ca41d028 Merge "Remove am/wm.proto which is redundant. The naming convention is defined in core/proto/README.md" into pi-dev 2018-03-21 21:24:19 +00:00
Julia Reynolds
5a366fbd81 Fix index error
Change-Id: I93cf18b35060a09a3b8f4be8e0b9b4682d390b25
Fixes: 76101440
Test: runtest systemui-notification
2018-03-21 15:57:40 -04:00
TreeHugger Robot
2f81559d29 Merge "Return a boolean from the mandatory backup transport setter." into pi-dev 2018-03-21 19:34:52 +00:00
TreeHugger Robot
1543171d3e Merge "Some Slices API refinement" into pi-dev 2018-03-21 17:06:40 +00:00
Lenka Trochtova
56681f761e Return a boolean from the mandatory backup transport setter.
Bug: 73813043
Bug: 64012357
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testGetAndSetMandatoryBackupTransport
Test: cts-tradefed run cts -m CtsBackupHostTestCase --test android.cts.backup.BackupDeviceOwnerHostSideTest

Change-Id: I7f47a41070b767a6be8b986be485b4ad782690cf
2018-03-21 15:48:41 +01:00
Jason Monk
1918ef7569 UsageEvents for slices pinning
Test: atest frameworks/base/services/tests/servicestests
Bug: 73455786
Change-Id: I6a37f5525c29d3f47aa37e262c8834840309ba44
2018-03-21 10:03:29 -04:00
TreeHugger Robot
6ed6340e3c Merge changes from topic "SoundTriggerJobService-steps" into pi-dev
* changes:
  Throttle number of sound trigger operations / day
  Add SoundTriggerDetectionService
  Expose SoundTriggerManager and SoundTrigger APIs
2018-03-21 03:27:56 +00:00
Selim Cinek
db0e4f1d73 Merge changes from topic "heads_up_redesign" into pi-dev
* changes:
  Added new appear and disappear animations for heads up
  Polished the heads up experience
  Removed the heads up scrim and replaced it with more elevation
  Insetting heads up notifications
  Ensured that the heads-up notifications are always rounded
2018-03-21 00:53:50 +00:00
Yi Jin
6c6e9cab42 Remove am/wm.proto which is redundant. The naming convention is defined
in core/proto/README.md

Bug: 72474563
Test: make sure the Android build
Change-Id: I2a90cbb6bb0b0c62fe4a0b81cb5bb3ea36381871
2018-03-20 17:39:32 -07:00