Commit Graph

296 Commits

Author SHA1 Message Date
Kweku Adams
7e4fc4dcf0 Add delay between quota check alarms.
Since we don't need to mark existing jobs as in quota immediately when
the quota status changes, adding a min delay between quota check alarms
will prevent the system from possibly spinning on checking quotas.

Bug: 154444435
Test: atest CtsJobSchedulerTestCases
Test: atest QuotaControllerTest
Change-Id: I5b5efe9c973090c0f413812afc7479f012768c44
2020-04-21 13:46:08 -07:00
TreeHugger Robot
f9a1e1cb78 Merge "Update privacy filter for incident report protos." into rvc-dev 2020-04-17 15:10:21 +00:00
Evan Rosky
2556dbf3ed Merge "Clean-up displayed-bounds" into rvc-dev 2020-04-16 00:23:01 +00:00
Wenjie Zhou
27030cd14e Update privacy filter for incident report protos.
Bug: 153380903
Test: manual build
Change-Id: Iff1910d619983910c1e57e9ac335053415f6fa1a
2020-04-15 16:46:32 -07:00
Evan Rosky
6ecd67c0fa Clean-up displayed-bounds
Nothing uses this anymore and it is always empty, so clean-up
the code around it so we don't continue to complicate things
with other bounds.

Bug: 151862790
Test: builds/tests pass
Change-Id: Ib7b9247cc0b125ed019680342be7fc5ffb6245de
2020-04-15 14:05:00 -07:00
Kweku Adams
128656b50e Treat car mode as the user interacting with the device.
Car mode may be activated without the user plugging the device into the
car. In this scenario, the user is "interacting" with the device via the
car and so JobScheduler should treat the device as in active use and not
activate JS idle jobs.

Bug: 147846851
Test: atest CtsJobSchedulerTestCases
Change-Id: Ied22ba86b79dac5c5d3db8e646fd5504a9e25645
2020-04-13 08:07:17 -07:00
Vishnu Nair
dddc9f5051 Support DisplayAreas in protos
Dump WindowContainers and their children without hard coding the hierarchy.

Bug: 149672519
Test: open wm trace in winscope

Merged-In: If5a7bd88728054e50aaacee138d9ae78513e94fe
Change-Id: If5a7bd88728054e50aaacee138d9ae78513e94fe
2020-03-09 15:02:32 -07:00
TreeHugger Robot
3201a3aab3 Merge "Reduce individual quota alarms set." into rvc-dev 2020-02-27 23:58:48 +00:00
Mike Ma
36eeacc058 Merge "Fix PowerIncidentTest" into rvc-dev 2020-02-27 18:13:31 +00:00
Kweku Adams
35d05acc8c Reduce individual quota alarms set.
Switch QuotaController to track all of the pending in quota alarms
internally and only set one alarm for the whole group.

Bug: 150156067
Test: atest CountQuotaTrackerTest
Test: atest CtsJobSchedulerTestCases
Test: atest QuotaControllerTest
Change-Id: Ie415ed0c4f224ac8c37110962009c310e6a6a051
2020-02-27 10:06:50 -08:00
Mike Ma
14eef1368c Fix PowerIncidentTest
ag/9684175 changed mScreenBrightnessSettingMinimum,
mScreenBrightnessSettingMaximum and mScreenBrightnessSettingDefault
to float without changing proto dump and cts.

Bug: 149895022
Exempt-From-Owner-Approval: Minor change to fix CTS test
Test: atest CtsIncidentHostTestCases:com.android.server.cts.IncidentdTest#testIncidentReportDumpExplicit
Change-Id: Ief85ba8299626a3d92fb43db162a1b6864c8eae0
2020-02-27 09:38:10 -08:00
Evan Rosky
73a7fe9479 Clean-up old docked-stack implementation from WM
Bug: 133381284
Test: Existing tests pass. Manually use sysui
Change-Id: I44155d74df1489fa391c60a05d1f8098986cefb7
2020-02-25 21:13:16 +00:00
Trung Lam
fda6d3386a Adding back contact phone number to protobuf after PDD review approval.
Test: Built and tested on device.
Bug: 142712281
Change-Id: I80808a10e6cea030e3cb415785ee20b7667d4c39
2020-02-19 21:58:28 -08:00
Evan Rosky
2d88183bde Merge "SystemUI Split via TaskOrganizer" 2020-02-19 18:43:36 +00:00
Evan Rosky
af9f27cdc2 SystemUI Split via TaskOrganizer
Use the early TaskOrganizer concepts to implement Split-screen
in system-ui.

This includes changes to both FW and SystemUI. The changes to
FW involve removing the use of split-screen specific behavior (like
minimize dock and direct ordering) and also reducing things that
care about primary vs secondary. It also changed ActivityStack
to inherit bounds from parent** when in split-mode so that sysui
only needs to manipulate the tile and/or reparent stacks to
effect their geometry.

This means a lot of layout logic moves to SystemUI. The bulk of
the work done in ActivityStack which is split-screen related is
moved into SplitDisplayLayout. This basically takes a snapshot of
display configuration and manages the sizes of splits and their
snap targets.

Intermediate dragging of divider bar now only moves root task leashes
around rather than talking to WM. This includes position as well
as crop (which used to be stack crop). Once the user releases
the divider bar, it will calculate (based on snaps) the new
root task sizes and update their configurations via
WindowContainerTransaction. Because the interim updates are only
on the leashes, no configuration updates occur until the end.

Entering/Exiting split-mode is now handled by SplitScreentaskOrganizer#
onTaskInfoChanged. This is effectively a state-machine that
looks at the current split task membership vs. previous and then decides
when to move things into/out-of split tasks and how to coordinate with the
DividerView.

Minimized dock is relegated to a purely system-ui concept. To
accomplish this, **the home *stack* is set to the minimizedhomebounds
by systemui. This means that it's relative position to its parent is
negative! This allows us to leave the split sizes constant, have
their children inherit the "actual" split sizes, but keep the
home stack unchanging in its minimized size. We just adjust the crop
negative to reveal it.

IME handling is done through the same mechanism as app-driven IME
animation... only Divider receives the control instead of the app.
This allows synchronized animation of split tasks with IME. To
account for insets, though, when IME is opened, the bottom stack
will be repositioned in WM.

Bug: 133381284
Test: Manual, use split-screen, rotate device, launch unresizable
      apps in split, use divider snap to close/maximize apps, etc.
Change-Id: I7133e151a1037c42b275b97857936437a7a6725f
2020-02-18 16:19:39 -08:00
Kweku Adams
5a84168376 Add missing information to dumpsys.
The dynamic battery saver information was not being logged in the
dumpsys, which made debugging an issue harder. Adding the information to
make future debugging easier.

Bug: 142473857
Test: atest android.os.cts.PowerManagerTest
Change-Id: I81cb724efd454f578d99b8abaa4eca3b6bad587a
2020-02-18 12:30:33 -08:00
Jorim Jaggi
2a3002a54f Revert "SystemUI Split via TaskOrganizer"
Revert "Update CTS tests for tile-based split-screen"

Revert submission 9964969-sysui_split_screen

Reason for revert:
- Random SysUI crash (ag/10335781)
- Breaks IME tests with new_insets set to 2
- Crashes SysUI in split screen with new_insets set to 2.

Reverted Changes:
I103f68030: SystemUI Split via TaskOrganizer
If6740b7ee: Connect split-screen things to systemui divider
I44f497e7d: Update CTS tests for tile-based split-screen

Change-Id: Ife6878044ff19905ed97b599d8c67f80cb8e399e
2020-02-17 17:10:11 +01:00
Trung Lam
f1514f832f Added missing protobuf for PeopleService data persistence.
Change-Id: I85c1b717f1209f48d24260674cb58d522c19aac5
Test: Built and ran on device.
Bug: 149050408
2020-02-15 10:48:43 -08:00
Julia Reynolds
30965c45ce Log conversation id in notification history
So we can clean up the history when a conversation is deleted
and link to the correct notification settings screen

Test: atest
Bug: 149505730
Change-Id: I0784ae80b0fd0a1c00e9b63dfce1104b274df6ce
Exempt-From-Owner-Approval: impatience
2020-02-15 12:41:40 +00:00
Mike Ma
f907bcf09c Merge "Implement dumpsys bluetooth_manager --proto" 2020-02-14 23:31:51 +00:00
Evan Rosky
bed2d1b57c SystemUI Split via TaskOrganizer
Use the early TaskOrganizer concepts to implement Split-screen
in system-ui.

This includes changes to both FW and SystemUI. The changes to
FW involve removing the use of split-screen specific behavior (like
minimize dock and direct ordering) and also reducing things that
care about primary vs secondary. It also changed ActivityStack
to inherit bounds from parent** when in split-mode so that sysui
only needs to manipulate the tile and/or reparent stacks to
effect their geometry.

This means a lot of layout logic moves to SystemUI. The bulk of
the work done in ActivityStack which is split-screen related is
moved into SplitDisplayLayout. This basically takes a snapshot of
display configuration and manages the sizes of splits and their
snap targets.

Intermediate dragging of divider bar now only moves root task leashes
around rather than talking to WM. This includes position as well
as crop (which used to be stack crop). Once the user releases
the divider bar, it will calculate (based on snaps) the new
root task sizes and update their configurations via
WindowContainerTransaction. Because the interim updates are only
on the leashes, no configuration updates occur until the end.

Entering/Exiting split-mode is now handled by SplitScreentaskOrganizer#
onTaskInfoChanged. This is effectively a state-machine that
looks at the current split task membership vs. previous and then decides
when to move things into/out-of split tasks and how to coordinate with the
DividerView.

Minimized dock is relegated to a purely system-ui concept. To
accomplish this, **the home *stack* is set to the minimizedhomebounds
by systemui. This means that it's relative position to its parent is
negative! This allows us to leave the split sizes constant, have
their children inherit the "actual" split sizes, but keep the
home stack unchanging in its minimized size. We just adjust the crop
negative to reveal it.

IME handling is done through the same mechanism as app-driven IME
animation... only Divider receives the control instead of the app.
This allows synchronized animation of split tasks with IME. To
account for insets, though, when IME is opened, the bottom stack
will be repositioned in WM.

Bug: 133381284
Test: Manual, use split-screen, rotate device, launch unresizable
      apps in split, use divider snap to close/maximize apps, etc.
Change-Id: I103f68030a170e2fd3d8f2125b81cf33af412793
2020-02-14 09:25:43 -08:00
Mike Ma
2781d0b2d2 Implement dumpsys bluetooth_manager --proto
Add BluetoothManagerServiceDumpProto for protobuf dumpsys of bluetooth
manager service. Primarily used by incident service to capture an
incident report proto.

Command to invoke (any of the following after lunch and env setup):
$ adb shell dumpsys bluetooth_manager --proto
$ adb shell incident 3050
$ incident_report 3050

Bug: 146085372
Test: Execute the above commands and compare the output against normal
dumpsys

Change-Id: I7ccef334ffeae02316db3afff929998b544972b1
2020-02-13 16:10:03 -08:00
Kweku Adams
111b8221ff Removing unused flags.
We thought about batching based on constraints when JobScheduler was
first introduced (in Lollipop) but immediately disabled that behavior.
We haven't used the flags since then, and now that we're batching all
jobs that aren't in the ACTIVE bucket, these extra flags are not needed.

Bug: 141645789
Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
Test: atest CtsIncidentHostTestCases:JobSchedulerIncidentTest
Change-Id: I8df75007a0c8124ea35c7917a5413310fbdeff79
2020-02-11 12:06:26 -08:00
Trung Lam
6a1ec23cf7 Add protobufs for PeopleService data persistence.
Change-Id: I36d45e9ed5464802d0f7c4b405a666ff8ce83a21
Test: Built and ran on device.
Bug: 149050408
2020-02-08 23:41:49 -08:00
TreeHugger Robot
57829fb80b Merge "Remove job rescheduling limits." 2020-02-07 21:13:51 +00:00
Kweku Adams
7a1c76d6ac Remove job rescheduling limits.
We weren't using the limits and it's not clear what developers are
supposed to do if they were to ever hit the limits, so it's best to just
remove them altogether.

Bug: 141645789
Test: Android builds
Change-Id: Ib9695dc1af4c94248444a80fe02d284ee0a44559
2020-02-06 16:57:05 -08:00
TreeHugger Robot
43bb1463c8 Merge "Proto message for "dumpsys sensorservice --proto"" 2020-02-06 04:19:25 +00:00
Mike Ma
a47ad7266c Proto message for "dumpsys sensorservice --proto"
Add SensorServiceProto for protobuf dumpsys of sensorservice. Primarily
used by incident service to capture an incident report proto.
Also add a gensrc rule to generate cpp headers of frameworks proto to
be used by native services like sensorservice. Added "static" qualifier
to a few generated fields in the header to avoid linker conflict.

Command to invoke (any of the following after lunch and env setup):
$ adb shell dumpsys sensorservice --proto
$ adb shell incident 3053
$ incident_report 3053

Bug: 146086105
Test: Execute the above commands and compare the output against dumpsys
      sensorservice

Change-Id: I282ff37bd3e845464d0693d69fc0d82943cc9855
2020-02-05 10:10:47 -08:00
Chiachang Wang
b952ae3080 Merge "Update mapping for the rat type in data stall proto" 2020-02-04 06:41:52 +00:00
TreeHugger Robot
4afff3d6be Merge "Add ProtoLog to Vibrator Service with vibrator state." 2020-02-03 19:08:48 +00:00
Chiachang Wang
b15c099a80 Update mapping for the rat type in data stall proto
Previously, the radio technology definitions are refered to those
definitions in ServiceState. However, the definitions are
slightly different from the definitions of NETWORK_TYPE_* in
TelephonyManager which will cause the data is misjudged. Revise
to refer to the same definitions.

Bug: 147082857
Test: build
Change-Id: I12fb14a9b7e70d57ce043bfe2880b358eecea872
2020-02-03 14:44:37 +08:00
Wale Ogunwale
f342f06436 WM: Unify windows and activities proto dumps (88/n)
Can no longer be put off since we need to redo things for task/stack
merge.

Bug: 80414790
Bug: 143460940
Test: Existing tests pass.
Change-Id: Id6c60264220a42c290190e338945f1662a075b6f
2020-02-02 10:27:39 -08:00
Adrian Roos
22a20a8174 WM: Introduce DisplayArea (3/n)
Introduces the concept of a DisplayArea, corresponding to an area
on a logical display within which content can be placed.

DisplayAreas can contain more DisplayAreas, WindowTokens and ActivityStacks.

A future CL will expose an API which allows leashing a DisplayArea to transform
all its content simultaneously.

DisplayAreas are managed by a DisplayAreaPolicy, which creates and places the
areas, and decides which area a container is placed in.

This CL introduces the concept, but applies a no-op policy that maintains the
current orderings and does not apply any overrides.

Future work that remains:
- Writing the feature policies
- Adjusting Display & DisplayMetrics if the area is constraining its children.
- Moving the policy into an product-adjustable component

Bug: 147406652
Test: atest WmTests
Change-Id: If6fb1bba3b65ebf7ac9fdf99408c54bf77f602c9
2020-02-01 09:07:42 +00:00
Chris Ye
26f2aa08f6 Add ProtoLog to Vibrator Service with vibrator state.
Add internal Vibrator Service state indicates if device is vibrating,
dump the state in Vibrator Service ProtoLog.

Bug: 133457048
Test: "dumpsys vibrator --proto" to verify

Change-Id: Icc1b49430363a9ca7e04e240d8706427d75251ce
2020-01-31 20:45:52 +00:00
Wale Ogunwale
11dbc1bb40 Merge "Move Activity proto from activitymanagerservice.proto to windowmanagerservice.proto" 2020-01-29 04:40:59 +00:00
Hongwei Wang
35d59141e8 Removes default/movement PiP bounds from WM
Per discussion in go/pip-ctc-strategy, SysUI will not report
default/movements bounds to window manager.

Bug: 141200935
Test: atest PinnedStackTests
Change-Id: Ibdffe18640e167928285fb0efc5c88f82abe18e6
2020-01-27 20:14:39 -08:00
Jeff Chang
acc340d3c5 Move Activity proto from activitymanagerservice.proto to windowmanagerservice.proto
All activity related code is under the wm package,we should move all activity
related proto from activitymanagerservice.proto to windowmanagerservice.proto.

This CL consolidate ActivityRecordProto,AppWindowTokenProto and move to
windowmanagerservice.proto. For TaskRecordProto/TaskProto related will
handle in next step.

Bug: 143460940
Test: atest CtsWindowManagerDeviceTestCases
      atest FlickerTests

Change-Id: Icade24069677c1f1a9852dab69da7f1d94340709
2020-01-27 08:40:57 -08:00
Hui Yu
88910decff FGS background start restriction.
1. Background started foreground service shall not have
while-in-use permissions including location, camera and
microphone. Many exemptions have been applied including:
--FGS started by widget.
--FGS started by notification.
--FGS started by IME or other visible app.
--FGS started by ROOT_UID, SYSTEM_UID, NFC_UID.

2. Add a phenotype key KEY_DEFAULT_BACKGROUND_FGS_STARTS_RESTRICTION_ENABLED
to turn on/off this feature (default is on).

3. In dogfood, if a background started FGS with while-in-use permission
(any of location/camera/microphone) run into this restriction, the FGS
will not been granted these permission. we show a toast message to
alert user and ask them to write a bugreport using instruction at
go/r-bg-fgs-restriction. So we can have a statistic how many apps will
be impacted by this feature.
These is a flag Settings.Global.FOREGROUND_SERVICE_STARTS_LOGGING_ENABLED
to turn on/off the toast message (default is on, in dogfood)

Bug: 136219221
Test: atest android.app.cts.ActivityManagerProcessStateTest
atest android.app.cts.ActivityManagerApi29Test.java
atest android.app.cts.ActivityManagerFgsBgStartTest

Change-Id: Ibc8aaa6839a69136f9311bfacdbab9705b31b6a7
2020-01-24 20:58:47 -08:00
Yuliya Kamatkova
56f7c7f37c Merge "Add Activity#setLocusContext API. Plumb LocusID to the System Server. Add locus update event to the Usage Stats. Test: Build and run on a test device with a test app. Bug: 147594233, 147100454" 2020-01-24 21:10:54 +00:00
Yuliya Kamatkova
48c38076ef Add Activity#setLocusContext API. Plumb LocusID to the System Server.
Add locus update event to the Usage Stats.
Test: Build and run on a test device with a test app.
Bug: 147594233, 147100454

Change-Id: I1e058ac87244d47719606d8dcfaea2df4bff43d2
Signed-off-by: Yuliya Kamatkova <yuliyak@google.com>
2020-01-24 11:19:10 -08:00
Mike Ma
42e623587a Merge "Dump contexthub in protobuf format" 2020-01-23 19:45:54 +00:00
Mike Ma
ac0cae7c48 Dump contexthub in protobuf format
Add protobuf dumpsys of connmetrics. Primarily used by incident service
to capture an incident report proto.

Command to invoke (any of the following after lunch and env setup):
$ adb shell dumpsys contexthub --proto
$ adb shell incident 3051
$ incident_report 3051

Bug: 146086599
Test: $ incident_report 3051, then compare the content with "dumpsys
      contexthub"

Change-Id: I6c2ed76a1a17f9bfc60d07e68cd66d5eea00e9b0
2020-01-22 14:03:56 -08:00
Kweku Adams
3e26863dac Merge "Place additional constraints on restricted jobs." 2020-01-22 21:38:34 +00:00
Vinit Nayak
2c12aac7c5 Merge "Revert "Revert "Change screen rotation animation""" 2020-01-21 17:38:41 +00:00
Jing Ji
8055a3a446 Add support to get historical app process exit reason
Apps can call ActivityManager.getHistoricalProcessExitInfos() to
get the historical process exit reason now.

Also add the below command to support dumping of the information
$ adb shell dumpsys activity exit-info [package name]

Bug: 136036078
Test: atest ApplicationExitInfoTest
Test: atest CtsAppExitTestCases:ActivityManagerAppExitInfoTest
Change-Id: I634f247e42a7e8e4535eedd76cf84089abdf1129
2020-01-17 20:47:53 -08:00
Vinit Nayak
627ac309b5 Revert "Revert "Change screen rotation animation""
This reverts commit c17f3924c6.

Also cancel background surface color animation.

Change-Id: I82e436db653378f5097beee22594f64eaa2bb3bd
2020-01-17 15:23:10 -08:00
Kweku Adams
ae9d6beba5 Place additional constraints on restricted jobs.
Update JobScheduler to place additional constraints on jobs in the
RESTRICTED bucket:
These jobs can only run when the device is idle, charging, battery is
not low, and on an unmetered network (for connectivity jobs). They do
get one parole session per day where they don't need these additional
constraints met.

Bug: 145551233
Test: atest CtsJobSchedulerTestCases
Change-Id: Ic96841141ed7800295b0b1a54c697a30afc3cd70
2020-01-16 18:58:32 -08:00
TreeHugger Robot
1ea91ab30b Merge "Add API quotas to JobScheduler." 2020-01-14 22:55:48 +00:00
Kweku Adams
9239a1acd3 Add API quotas to JobScheduler.
Limit apps from calling schedule() and enqueue() to 500 times in a 1
minute window.

Bug: 135764360
Bug: 144363383
Test: atest CtsJobSchedulerTestCases
Change-Id: I141e66b612c296a4a4a9cd7c382cea08d5f61b04
2020-01-13 10:51:13 -08:00
TreeHugger Robot
df42638f04 Merge "Revert "Change screen rotation animation"" 2020-01-11 00:21:53 +00:00