Commit Graph

12054 Commits

Author SHA1 Message Date
Lucas Dupin
80f05cee86 Merge "Fix slice permissions to allow uri grants" 2017-11-01 22:32:29 +00:00
Jason Monk
b40dad566a Fix slice permissions to allow uri grants
Also bypass when caller is self.

Test: bind own app's slice.
Bug: 68751119
Change-Id: I7b4b0f2a81bf6168cb81b03056c6b75e17808036
2017-11-01 16:14:01 -04:00
Bryce Lee
e83f34cde7 Remove orientation restriction to only fullscreen activities.
This changelist removes checks that enforce that only fullscreen,
opaque activities may request orientation changes. An application
may itself be compatible with the change and update their SDK level.
However, it is possible they use a library that has not itself been
updated and still leverages this feature for non-fullscreen
activities.

Change-Id: Ie1d300e3531fc8c588d2124dea698e4a876713c2
Fixes: 68684796
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
2017-10-31 20:25:15 -07:00
Winson Chung
b43a529e5b Merge changes Icb5ea78e,I1cf97299
* changes:
  Move more calls to the lib.
  Migrating some animation spec logic to shared lib
2017-11-01 00:42:27 +00:00
TreeHugger Robot
aaad26df79 Merge "Allow dnd access for secondary users" 2017-10-31 20:17:35 +00:00
Charles He
11e7d7d650 Merge "AM: make LockTask truly multi-task-aware." 2017-10-31 20:08:56 +00:00
Winson Chung
aa35745690 Move more calls to the lib.
- Move the task stack listener wrapper into the shared lib, along with some
  other AM calls.

Bug: 67510855
Test: Launch recents

Change-Id: Icb5ea78ec42d4b76a1c531ce336dd9a3f07a9629
2017-10-31 12:19:45 -07:00
TreeHugger Robot
687b37cd52 Merge "Add App Op for changing WiFi State." 2017-10-31 12:47:35 +00:00
TreeHugger Robot
73f6b8a6fc Merge "Renamed moveTaskToDockedStack to setTaskWindowingModeSplitScreenPrimary" 2017-10-30 23:45:31 +00:00
Winson Chung
a17d0ac384 Merge "2/ Add API to start overview activity with assist callbacks" 2017-10-30 20:51:06 +00:00
Winson Chung
941dcba6e3 Merge "1/ Refactor out logic to fetch assist data asynchronously" 2017-10-30 16:22:26 +00:00
Charles He
ff9b4dff6c AM: make LockTask truly multi-task-aware.
LockTask was first designed to be single-task only. It was later
expanded to multi-task use cases in a rather flawed manner. Many aspects
of the implementation overlook the implications of more than one locked
tasks, and sometimes completely ignore the LockTask-unaware apps.

For example, LockTask-unaware apps are not registered in
LockTaskController's list of locked tasks, although they can be launched
in LockTask mode as long as they are whitelisted. As a consequence,
these unregistered tasks are not finished when their whitelist
authorization is removed.

In this patch, we make sure LockTask-unaware apps are also registered,
and introduce the notion of a root task, thus providing a genuine
multi-task experience with LockTask.

Bug: 66130096
Bug: 66132035
Test: bit FrameworksServicesTests:com.android.server.am.LockTaskControllerTest
Test: cts-tradefed run cts-dev -m DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
Test: manual, by using TestDPC > Start kiosk mode
Change-Id: I68a26d2198fa3991f85ae1e7a6acae5981c34db5
2017-10-30 13:35:08 +00:00
Julia Reynolds
92febc3c58 Allow dnd access for secondary users
Test: runtest systemui-notification
Change-Id: Ie63b767bcd25b7b3e7cac08afcf3351adc97263f
Fixes: 68060759
2017-10-30 13:08:28 +00:00
Péter Visontay
23567494d0 Merge "Fix some paths (in comments) pointing to old locations of C++ Binder interfaces." 2017-10-30 11:27:32 +00:00
TreeHugger Robot
99981920a3 Merge "Provide a way for jobs to estimate network traffic." 2017-10-28 00:41:53 +00:00
Matthew Ng
bf15587d0d Renamed moveTaskToDockedStack to setTaskWindowingModeSplitScreenPrimary
Renamed a few functions related to moveTaskToDockedStack to use the new
notion of split screen primary windows instead of docked stack. Most of
the calls that use moveTaskToDockedStack are renamed.

Test: go/wm_smoke
Bug: 68017311
Change-Id: I73df051a9261d213b3415ac132962d91ec632e0a
2017-10-27 17:09:39 -07:00
Mady Mellor
dedcab0bac Merge "Unhide slice view APIs" 2017-10-27 22:28:47 +00:00
Winson Chung
ec1ef09c23 2/ Add API to start overview activity with assist callbacks
- Only the recents component package can launch the overview activity
  directly, and if an assist data receiver is provided, then assist data
  will be proxied to the caller.

Bug: 67864419
Test: com.android.server.am.RecentTasksTest
Test: com.android.server.am.AssistDataRequesterTest
Test: CtsVoiceInteractionTestCases
Change-Id: Icdd7e6716a84c11e9262ce5453f7d39ae7d8ce77
2017-10-27 13:49:37 -07:00
Winson Chung
da2818fe89 1/ Refactor out logic to fetch assist data asynchronously
- This logic will also be used when the recents component is started to
  fetch assist data associated with the current activity.

Bug: 67864419
Test: com.android.server.am.AssistDataRequesterTest
Test: CtsVoiceInteractionTestCases

Change-Id: I4cb3c2536a104d7071bc0a1fd6e31dfc2c0ce8d0
2017-10-27 13:49:26 -07:00
Mady Mellor
800ba36336 Unhide slice view APIs
Test: to be added
Change-Id: I10e6c3259a3cde6f02c968b24f891b1215e12b1b
2017-10-27 13:33:56 -07:00
TreeHugger Robot
599ef4698b Merge "New Autofill API: FillResponse.disableAutofill(duration)" 2017-10-27 19:38:32 +00:00
Peter Visontay
cee763269a Fix some paths (in comments) pointing to old locations of C++ Binder interfaces.
Test: None (comment changes).

Change-Id: I372e38bbb73c9d0a289089b239fa669f130252ba
2017-10-27 18:15:33 +01:00
Felipe Leme
17292d1a25 New Autofill API: FillResponse.disableAutofill(duration)
This API is useful to improve the autofill performance for the scenarios where
the service knows it cannot autofill an app or activity.

Bug: 67867469

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testFillResponseAuthWhenAppCallsCancel

Change-Id: I58e3eb5714db840104e699d614e750c03e26e8ca
2017-10-27 09:40:59 -07:00
TreeHugger Robot
bfc6a2bc36 Merge "Notification: Fix PendingIntent whitelisting" 2017-10-27 15:34:49 +00:00
Adrian Roos
fb92184ebc Notification: Fix PendingIntent whitelisting
Fixes several issues with the way PendingIntents are being whitelisted
from background check with Notifications. Most visibly, this causes the
whitelisting not to work on Notifications that use the DecoratedContentViewStyle,
but there are some conditions where the whitelisting breaks for regular
notifications too.

- After a Notification is rebuilt with Notification.Builder, the set
  of PendingIntents in the notification was not rebuilt.
  This broke the whitelisting whenever a PendingIntent is added after
  the Notification was already sent once. Workaround for broken platform
  releases: always use  a fresh Notification object, or clone before
  sending.

- Fixes PendingIntent.writePendingIntentOrNullToParcel to invoke the
  OnMarshalListener.
  This broke whitelisting for any PendingIntents attached to custom
  RemoteViews. Workaround for broken platform releases: Also attach
  the PendingIntent to the Notification's extras.

- Changes RemoteViews to keep the parcel cookies that were present
  during unparceling, such that they can be reapplied when it gets
  cloned.
  This broke whitelisting for any PendingIntents attached to a
  DecoratedContentViewStyle *even if added to extras*. Workaround
  for broken platform releases: none.

- Fixes Notification.whitelistToken mistakenly being static.
  There's an unlikely race condition where the field could be
  overriden with null by an incoming notification right as another
  notification is sent out. Workaround for broken platform releases:
  none.

Test: runtest -x core/tests/coretests/src/android/app/NotificationTest.java && runtest -x core/tests/coretests/src/android/widget/RemoteViewsTest.java
Bug: 68218899
Change-Id: I02e44040604a1d24422340611ae9e0332a611800
2017-10-27 15:46:40 +02:00
Charles He
ab57e18da1 Merge "DPM: introduce setLockTaskFeatures()." 2017-10-27 07:57:06 +00:00
Greg Kaiser
637c1ba196 Merge "Merge "ActivityManager: Change documentation of low RAM" into oc-mr1-dev am: c1158f762a" into oc-mr1-dev-plus-aosp
am: 4d9f5543fd

Change-Id: I22fe4630047af7d79d6b0b7fbd5d36ea67bf948c
2017-10-27 01:52:11 +00:00
Greg Kaiser
6923d161eb Merge "ActivityManager: Change documentation of low RAM" into oc-mr1-dev
am: c1158f762a

Change-Id: Ifd4c56b13f3bdbc0ef12a9fac335203fa471ac50
2017-10-27 01:24:56 +00:00
Jeff Sharkey
caa3f8dc23 Provide a way for jobs to estimate network traffic.
The system would like better insight into the shape/size of network
traffic that jobs will be performing.  For example, the system may
choose to delay jobs with large network usage estimates when the
device has a poor network connection, in order to save battery.

This also paves the way for more interesting optimizations, such as
allowing small jobs to use surplus metered network quota to improve
the overall user experience.

For now, we use these estimates to perform a simple sanity check to
skip jobs that have no possible chance of finishing within the
10-minute job timeout on a given network.  (For example, a job
trying to upload 10MB over a 128Kbps EDGE network is a terrible
idea.)

Test: verified via DownloadManager
Bug: 67040695, 64133169
Change-Id: I9210168b6bda0f0364975a5c7ea25d953a096767
2017-10-26 13:12:14 -06:00
Winson Chung
3f0e59ac1e Formalize recents component in the system
- Add resource for recents component which can be overridden in an overlay
- Allow the static recents component access to APIs which would otherwise
  require privileged permissions
- Remove some unused TV recents code

Bug: 67864419
Test: com.android.server.am.RecentTasksTest
Test: #testNotRecentsComponent_denyApiAccess
Test: #testRecentsComponent_allowApiAccessWithoutPermissions

Change-Id: Ia4939b7d443a6058ab4bb41d8c194eb4611cbf80
2017-10-26 11:11:42 -07:00
Winson Chung
61c9e5a629 5/Organize and make running tasks code more efficient
- Move running task code from stack/supervisor into its own class
- Reduce work to calculate running tasks. Instead of creating RunningTaskInfo
  for every single task and then limiting to the requested set, calculate
  the set and then create the infos.
- Consolidate calculation of number of running activities in a task between
  the RecentTaskInfo and the RunningTaskInfo
- Remove unused flag argument, adding another method to instead filter the
  collection of running tasks to exclude certain activity types and windowing
  modes.  This allows us to fetch only the last running task in SystemUI and
  not have additional logic on our side.

Bug: 34270611
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
Change-Id: Iaba7487cea0545f69739da7cd3095b500a0df6fc
2017-10-26 11:11:33 -07:00
Greg Kaiser
e2c459eafb ActivityManager: Change documentation of low RAM
With OC-MR1, for Android Go, we're considering the definition of
"low RAM" to be <= 1GB of RAM.  So we update the definition in
this documentation.  Additionally, we remove the comments about
screen resolution, as various devices might make trade-offs in
terms of modem stack carveout vs. screen resolution, and those
don't concern us as much as just the total amount of RAM.

Bug: 68277942
Test: None.  This is a documentation change.
Change-Id: Ib02024a3e543f8fec11a1735de32ec58278db6e4
2017-10-26 10:43:20 -07:00
Kweku Adams
e6b00c2a16 incidentd: Updating PowerManagerService proto files.
Moving to the proto/.../server directory since PowerManagerService is in
com.android.server.
Extracting enums from other components into their own files.

Bug: 65750826
Bug: 65750806
Test: flash device and check incident.proto output
Change-Id: Ib91b7c08142fa66adf18b6e85106d4cbb5adf660
2017-10-25 15:04:55 -07:00
TreeHugger Robot
4193d0e135 Merge "Start removing remaining pm code to package manager" 2017-10-25 20:58:52 +00:00
Jeff Sharkey
0d5f5e2b97 Merge "Provide explicit Network via JobParameters." 2017-10-25 20:08:40 +00:00
Dianne Hackborn
c81983a0c3 Start removing remaining pm code to package manager
Everything is now moved out of the pm command except for
the various install commands.  I am going to hold of on
those since they require doing some resolution with the
current implementations in the package manager to make
sure they match and behave identically to the implementations
currently in the pm command.  But other than that, everything
in pm is now just redirecting over to "cmd package".

Also fix up some of the dumpsys output of a few other sevices
when asking to print the data for a particular package, so
the "pm dump" command gives a little more sane result.

Test: manual

Change-Id: I139e06e560203b72243d7eea9543c2240db0f8f8
2017-10-25 12:19:26 -07:00
TreeHugger Robot
d62ff511dc Merge "incidentd: Adding proto dump for AlarmManager." 2017-10-25 18:43:39 +00:00
Jeff Sharkey
76a0241eff Provide explicit Network via JobParameters.
On devices with multiple active networks, or rapidly switching
between networks, we need an API to tell jobs explicitly which
network to use.  (For example, the default route could meet all
job criteria, but we could have changed the default network by the
time we spun up the JobService.)

This also paves the way for us choosing to run jobs over
non-default networks.

Test: verified via DownloadManager
Bug: 64133169
Change-Id: Ic8d654707e39236c8da85a5e172161ac39e5f0b3
2017-10-25 11:23:22 -06:00
TreeHugger Robot
c3cdf7468f Merge "Fixing CTS regression" 2017-10-25 05:53:55 +00:00
TreeHugger Robot
998d84a0d9 Merge "App Bucketing for Standby" 2017-10-25 04:44:15 +00:00
Amith Yamasani
17fffee490 App Bucketing for Standby
Manage the standby bucket in AppStandbyController

Default implementation of bucketing based on simple timeout:
 ACTIVE, if recently used
 12 hrs to move to WORKING_SET
 2 days to move to FREQUENT
 7 days to move to RARE
 (subject to change)

RARE bucket equates to the old "idle" or "inactive" state for
an app.

Bug: 63527785
Test: AppStandbyControllerTests.java
Change-Id: I970d7afcdf47c31a9413da8fd4852066a13676a2
2017-10-24 19:24:15 -07:00
Winson Chung
f067ac734f Fixing CTS regression
- Ensure IllegalArgException is thrown when invalid maxNum of recents
  is requested.

Bug: 68215720
Test: android.app.cts.ActivityManagerTest
Test: #testGetRecentTasks
Change-Id: Idaccc97c609e3deede455fb285801e8cc56a02f9
2017-10-24 17:39:56 -07:00
Lucas Dupin
e0653fabe6 Fix SliceProvider threading
Binding a slice that lives in the same process would lead to a
deadlock since we'd sleep the main thread while waiting for it
to decrease the CountdownLatch. Now we're checking if we're
already in the main looper and only posting when necessary.

Test: run code in ag/3082570
Change-Id: Id7c4f9dd8d84bf0e513606cbe07bf87750c567e4
2017-10-24 17:52:58 +00:00
Charles He
e078db7539 DPM: introduce setLockTaskFeatures().
Add new DPM APIs to control which SystemUI features are enabled during
LockTask mode:
* setLockTaskFeatures()
* getLockTaskFeatures()
* int flags representing various configurable SystemUI features

Bug: 65813398
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Test: bit FrameworksServicesTests:com.android.server.am.LockTaskControllerTest
Test: cts-tradefed run cts-dev --module DevicePolicyManager -t com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
Change-Id: I0ee3cf6dbe2234ec29d1384195dadc0f290aa73b
2017-10-24 18:13:19 +01:00
Kweku Adams
61e0329207 incidentd: Adding proto dump for AlarmManager.
Test: flash device and check incident.proto output.
Bug: 65750801
Change-Id: If1e42c70908a0b11358cf48766c028e37c0329ae
2017-10-23 17:49:13 -07:00
Yueming Wang
302318bc9b Merge "Add setTime and setTimeZone API." 2017-10-23 17:29:09 +00:00
yuemingw
e43cdf7509 Add setTime and setTimeZone API.
Fix: 67497358
Test: wait for cts test in the following cl. For unitest:
 runtest -x services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Add setTime and setTimeZone API in devicepolicymanager.
Add unitest for each API.
Following design doc: https://docs.google.com/document/d/1NV93mr2CT157S_haru1QbKo9HLeP9iPM9eMiGfVmfCM/edit

Change-Id: I188c27b0b99137b6f01e42ae1ad49356ce0a81b2
2017-10-23 10:53:15 +01:00
Peter Visontay
1246d9ede9 Add App Op for changing WiFi State.
Test: -
Bug: 63907873
Change-Id: Ieb4b7b960a9fd0b2eb6bbb4a6ba755de4db2a214
2017-10-19 11:52:09 +01:00
TreeHugger Robot
b5a52f9026 Merge "Minor logging improvements on Autofill." 2017-10-18 01:21:09 +00:00
Jason Monk
8a77c22205 Merge "Unhide slice data APIs" 2017-10-17 21:59:15 +00:00