Commit Graph

12027 Commits

Author SHA1 Message Date
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
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
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
Felipe Leme
686128ef59 Minor logging improvements on Autofill.
Test: manual verification

Fixes: 67898895

Change-Id: Ic97d51a388a426b3ff9e74520f52036257a5c1ce
2017-10-17 14:02:58 -07:00
TreeHugger Robot
0d1dfd2c7b Merge "Update UsageStatsManager Javadoc to match implementation" 2017-10-17 17:13:29 +00:00
TreeHugger Robot
b52a5d3331 Merge "Updated TaskDescription to pass drawable resource ID (1/2)" 2017-10-17 01:38:42 +00:00
Jason Monk
d18651fa89 Unhide slice data APIs
Test: CTS
Change-Id: Ie2a05e30e5ac6c830b6a9a14b2d207b7e2fbe9da
2017-10-16 14:38:18 -07:00
Matthew Ng
54bc942fe4 Updated TaskDescription to pass drawable resource ID (1/2)
Depreciated the TaskDescription constructor when passing a bitmap and
added constructors to support passing drawable resource ID. Passing
drawable IDs allow users to use drawables such as AdaptiveIcons
instead of creating and passing a bitmap. Later SystemUI checks for
either bitmap, file name or resource ID to get a drawable to display.

Test: run-test CtsActivityManagerDeviceTestCases android.server.am
.TaskDescriptionTest
Change-Id: Ib944687249acf9fb6bbf9a9a109930cc04539e14
Fixes: 36298959
2017-10-16 10:56:24 -07:00
Lucas Dupin
049978e61d Fix wallpaper placement + performance improvement
Wallpaper would have the wrong placement during
first frame because it would be center aligned
in a surface that's not big enough.

Also removed old OpenGl implementation, in favor of new
hardware accelerated canvas.

Change-Id: Ic9c9eaa817e1f6494aa5431d8278f2c28b2c45a9
Fixes: 66926914
Test: set wallpapaer with different offsets, orientations and devices
2017-10-16 10:05:20 -07:00
Winson Chung
29eea40277 Merge changes Id963434f,I103ccc69,I770cd430
* changes:
  Remove events bus code from task loading code.
  Pull out TaskStackListener into its own class.
  Remove unused recents fast-toggle/paging code.
2017-10-13 23:45:55 +00:00
Winson Chung
2db3557064 Pull out TaskStackListener into its own class.
Bug: 67510855
Test: Code removal
Change-Id: I103ccc690f577dbeba9c3568614d9f4041fff7df
2017-10-13 14:25:26 -07:00
TreeHugger Robot
02a20b7025 Merge "Added new ViewNode properties for Autofill (minEms, maxEms, maxLength)." 2017-10-13 18:13:04 +00:00
Charles He
fe932c78ec Merge "AM: introduce ActivityOptions.setLockTaskMode()." 2017-10-13 13:38:06 +00:00
TreeHugger Robot
fac6655cf5 Merge "New Autofill API: SaveInfo.setTriggerId()" 2017-10-12 22:39:49 +00:00
Charles He
2bf2832047 AM: introduce ActivityOptions.setLockTaskMode().
This new API allows any activity to be launched into LockTask mode, as
if the package of the activity has declared "lockTaskMode =
if_whitelisted" in its manifest.

The lockTaskLaunchMode logic is also moved from TaskRecord to
ActivityRecord, in order to accommodate the new path from
ActivityOptions.

Bug: 66124180
Test: cts-tradefed run cts-dev --module DevicePolicyManager -t com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
Test: bit FrameworksServicesTests:com.android.server.am.LockTaskControllerTest
Test: manual, with TestDPC's kiosk mode
Change-Id: I786bf194ed20a212bbad1f3cdb9394cc77aa4d77
2017-10-12 23:03:30 +01:00
Winson Chung
5fa397533f 4/Clean up use of hidden recent task flags
- Remove flags to control which recent tasks are returned -- they are now
  trimmed with the expected behaviour when the task list is modified.
- Remove unused logic related to force-resetting a task based on inactive
  time.
- Remove SysUI logic related to excluded recent tasks since it is already
  handled
- Clean up task list subsetting now that returned list is guaranteed to
  only be visible tasks
- Only use AM interface to fetch recent tasks instead of through AM

Bug: 34270611
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
Change-Id: I3f60ce507563152b5704c63985af621b02d0e7c8
2017-10-12 11:37:17 -07:00
Winson Chung
fb44d212f2 3/Removing unnecessary filtering logic for recent tasks in SystemUI
- Remove all code related to last-stack-active-time, quiet profile task
  handling, and visible task range filtering
- Remove the notion of firstActiveTime since that was only used to filter
  tasks in SystemUI, also convert lastActiveTime to elapsed real time since
  it is only used in the system to order active tasks, and in SystemUI as
  a part of the TaskKey for caching purposes (it is no longer used to
  determine the last visible task based on time)

Bug: 34270611
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
Change-Id: I44d494a521f60f302e0976fcf33490fe837f7cdb
2017-10-12 11:26:15 -07:00
Felipe Leme
2fe3ade813 New Autofill API: SaveInfo.setTriggerId()
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.SimpleSaveActivityTest#testExplicitySaveButton
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.SimpleSaveActivityTest#testExplicitySaveButtonWhenAppClearFields
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65118073
Fixes: 67006548

Change-Id: Id12179086567d014f35fe4177b041745fb19bafd
2017-10-12 09:55:45 -07:00
Siarhei Vishniakou
1174802b4c Merge "Do not send KEYCODE_VOICE_ASSIST to apps." 2017-10-12 16:06:52 +00:00
Beverly Tai
1e26cacc71 Merge "Add alarm + media/other to NotifManager.Policy" 2017-10-12 13:20:51 +00:00
Siarhei Vishniakou
191cf1b140 Do not send KEYCODE_VOICE_ASSIST to apps.
Prevent KEYCODE_VOICE_ASSIST from being sent
to the apps. Move the key handling logic from
interceptKeyBeforeDispatching to
interceptKeyBeforeQueueing for KEYCODE_ASSIST
and KEYCODE_VOICE_ASSIST.

Allow the launch of assistant with KEYCODE_ASSIST

Remove dead link from the docs.

Test: bit CtsViewTestCases:.KeyEventInterceptTest
Bug: 64776073
Change-Id: I6ab596ffb0448923d71da3fc93ccdd26de8d517f
2017-10-11 19:11:10 -07:00
TreeHugger Robot
f65d166959 Merge "Removed remaining use of static stack ids." 2017-10-11 21:27:05 +00:00
Bernardo Rufino
68a365fe55 Canonicalize notification channel sounds for backup am: 2d7a4a3f67
am: 4229c3fcbd

Change-Id: Ie900b1e7a613e6e7d94cd5c3224954f71fdd1a5d
2017-10-11 17:59:17 +00:00
Bernardo Rufino
4229c3fcbd Canonicalize notification channel sounds for backup
am: 2d7a4a3f67

Change-Id: I47c5aba70bd6713f5cd2432b1141d0772fa1e672
2017-10-11 17:50:06 +00:00
Wale Ogunwale
44f036fd5a Removed remaining use of static stack ids.
Replace by windowingMode and activityType.

Test: Existing tests pass.
Test: go/wm-smoke
Bug: 64146578
Change-Id: I2ff026de3ead1a3e7136df17c68ed37d7aae5495
2017-10-11 07:40:46 -07:00
Bernardo Rufino
2d7a4a3f67 Canonicalize notification channel sounds for backup
Canonicalize for backup and canonicalize and uncanonicalize for restore
(see comment).

Test: Set custom notification sound, make backup, remove notification
sound from device (from Ringtones and make sure to update media content
provider), restore => Observe default instead of random number. Do the
same without removing the sound and observe restores successfully.
Test: runtest systemui-notification
Bug: 66444697

(cherry picked from commit c27bb6ad34)

Change-Id: I32c186d0d7479b01f6cc67cce9bc5cb66264a064
2017-10-11 15:22:32 +01:00
Charles He
e7a7a29d2e Merge "StatusBar: add DISABLE2_GLOBAL_ACTIONS." 2017-10-11 08:07:21 +00:00
TreeHugger Robot
b6777755ec Merge "Document job scheduler wakelock policy" 2017-10-10 23:19:45 +00:00
Christopher Tate
6818d367a9 Document job scheduler wakelock policy
And clarify some other descriptions, particularly getAllPendingJobs().

Bug: 19536175
Test: m offline-sdk-docs
Change-Id: I769eb8eb7bdca77f6f143c0d18a3beccc183d5dc
2017-10-10 14:07:43 -07:00
Charles He
9851a8da99 StatusBar: add DISABLE2_GLOBAL_ACTIONS.
We add a new StatusBarManager flag to disable the global actions dialog
(a.k.a. the power button menu), which is required in certain kiosk mode
scenarios.

Bug: 65813398
Test: runtest systemui
Test: manual, by using a modified version of TestDPC and
      DevicePolicyManagerService

Change-Id: Ib7da2f4837281e98e558afcc30be8bae6f2e179a
2017-10-10 21:04:42 +01:00