1408 Commits

Author SHA1 Message Date
Andrii Kulian
77b165f0af Merge changes I2ac2cdba,I6ade7874
* changes:
  Fix crash when removing a display with activities
  Add positionChildAt method to WindowContainer
2016-12-28 20:41:34 +00:00
Jorim Jaggi
95f50d7314 Merge "Reenable test for presubmit" 2016-12-28 14:00:14 +00:00
Andrii Kulian
6cc1a1d65c Fix crash when removing a display with activities
When secondary display is removed current behavior is to
move its stacks to the primary display. This requires app
windows to be reparented, and there was a check missing
for app windows in DisplayContent.reParentWindowToken.

Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Test: #testMoveStackBetweenDisplays
Bug: 33677605
Change-Id: I2ac2cdba273134438c63385887a09c37d42017bb
2016-12-27 23:52:59 -08:00
Andrii Kulian
d276563b38 Add positionChildAt method to WindowContainer
Added method to change the position of a child among siblings.
It accepts int value, which can either specify a target position
or POSITION_TOP/POSITION_BOTTOM.
When child is moved to top or bottom, there is an option to also
perform same action on parents. This will effectively move the
entire branch of the hierarchy tree to top/bottom.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests
Test: #testPositionChildAt
Test: #testPositionChildAtIncludeParents
Test: #testPositionChildAtInvalid
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackContainersTests
Test: bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
Change-Id: I6ade787487055f1c9a305afea64270c243196614
2016-12-27 19:52:44 -08:00
Lorenzo Colitti
6e22c50d7b Don't loop forever on zero-length ICMPv6 ND options. am: 2f157c421a
am: 9bfda163e2

Change-Id: Ice002fa65828eb738323425597dec1549c0f9a42
2016-12-23 08:32:03 +00:00
Lorenzo Colitti
9bfda163e2 Don't loop forever on zero-length ICMPv6 ND options.
am: 2f157c421a

Change-Id: Id8fbe5361b8a826677638213eed565be333f2c4d
2016-12-23 08:26:29 +00:00
Lorenzo Colitti
2f157c421a Don't loop forever on zero-length ICMPv6 ND options.
Bug: 33828433
Change-Id: Ie1905167126c8c8f3896eaa5e36cd006ca354e99
2016-12-23 13:54:50 +09:00
Daniel Nishi
bca4c7fc0d Fix a bug where the package stats query timeout may crash. am: cf76a16e66
am: e76b9dcb62

Change-Id: I341041c0edec8706cc449527b1dd130384a4ab01
2016-12-22 21:15:43 +00:00
Daniel Nishi
e76b9dcb62 Fix a bug where the package stats query timeout may crash.
am: cf76a16e66

Change-Id: Ibc146f89412387eb05a164c2a1969210fcea4262
2016-12-22 21:09:53 +00:00
Daniel Nishi
cf76a16e66 Fix a bug where the package stats query timeout may crash.
This adds a null-check to verify that we got real data before
trying to use it and increases the timeout time to reduce the
likelihood of timing out.

Test: FrameworkServicesTests
Bug: 33836034
Change-Id: Ia1ad4aba05c5c4fb8688fc9fc94df344f736e396
2016-12-22 11:32:33 -08:00
Jeremy Joslin
7af07643f3 Clear and restore the calling ID. am: 29ed4a99bf am: 3588b8d44c
am: 3f32d12be0

Change-Id: I2cbf3ca1ff0a743de1b08fad467027ec59333def
2016-12-22 19:21:45 +00:00
Alex Klyubin
aedc94bf11 resolve merge conflicts of a9888fc to master
Change-Id: I6ad00bf5bc1b18406b7fc8969c35bf7970fd1967
2016-12-22 11:20:26 -08:00
Jeremy Joslin
3f32d12be0 Clear and restore the calling ID. am: 29ed4a99bf
am: 3588b8d44c

Change-Id: I43b6f2899b5d82d4781937766907d6d7afa6b2bd
2016-12-22 19:10:46 +00:00
Alex Klyubin
a9888fc0c4 resolve merge conflicts of febd982 to stage-aosp-master am: 5c53fdb893
am: b824658494

Change-Id: Ic1dd2aef96889f0f68a55093cfb04b4d90f34818
2016-12-22 19:06:09 +00:00
Jeremy Joslin
3588b8d44c Clear and restore the calling ID.
am: 29ed4a99bf

Change-Id: Ie5752ca772e6f5c8fed8092d23e0604f44598b24
2016-12-22 19:01:43 +00:00
Alex Klyubin
b824658494 resolve merge conflicts of febd982 to stage-aosp-master
am: 5c53fdb893

Change-Id: Ib0878f0f17c3799ff9ffb92d7e85904fc91fdab7
2016-12-22 19:01:13 +00:00
Alex Klyubin
5c53fdb893 resolve merge conflicts of febd982 to stage-aosp-master
Change-Id: I40c27e3159b8f7acd60c6fa42509bb23d146b937
2016-12-22 10:20:23 -08:00
TreeHugger Robot
43769ddb2c Merge "Add DISALLOW_ADD_MANAGED_PROFILE to existing device owners" 2016-12-22 10:29:31 +00:00
Jeremy Joslin
29ed4a99bf Clear and restore the calling ID.
Clear and restore the calling identity in IPC methods after asserting
the caller has the required permissions.

Fixed 2 tests in NetworkScoreServiceTest that were failing due to a
recent refactor.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33781319
Change-Id: I562713df3d9455cdc02bf80a687940fb9daecd8f
Merged-In: Icd79751d12dcfe4af8026980aaa1f7bd463468dc
2016-12-21 13:39:10 -08:00
Jeff Sharkey
febd982cdd Merge "Avoid Calendar's unexpect change in snapToCycleDay()" 2016-12-21 21:11:20 +00:00
Amin Shaikh
9926363b09 Merge "Expose ScanResult#untrusted as a @SystemApi." am: a93e57f1ac am: a3943850ab
am: 471093b58e

Change-Id: I129d3abd329d9e00de1177ca39cf3ce0ff06946b
2016-12-21 20:10:30 +00:00
Amin Shaikh
471093b58e Merge "Expose ScanResult#untrusted as a @SystemApi." am: a93e57f1ac
am: a3943850ab

Change-Id: Id763d2f82e10dd5843258ef09d0e65824e2c2de6
2016-12-21 20:02:03 +00:00
Amin Shaikh
a3943850ab Merge "Expose ScanResult#untrusted as a @SystemApi."
am: a93e57f1ac

Change-Id: I9cac16dbceb36d6ff72e92d2ab8de20bd8d70e36
2016-12-21 19:56:19 +00:00
Amin Shaikh
3d18c621cb Expose ScanResult#untrusted as a @SystemApi.
- Expose ScanResult#untrusted to inform NetworkRecommendationProviders
  that a ScanResult does not correspond to a saved network.
- Add static construction methods and assertions to RecommendationResult

Test: runtest frameworks-services

Bug: 33490132
Change-Id: If7006040f63843c1c468c9d95c5c017383c5c5dd
Merged-In: If7006040f63843c1c468c9d95c5c017383c5c5dd
2016-12-21 11:46:22 -08:00
Shunta Sato
d18ffd8223 Avoid Calendar's unexpect change in snapToCycleDay()
Symptom:
Calendar object's certain field is unexpectedly changed after
using Calendar.add() method.

Detail and sample:
Following patch causes this issue.
- Switch network cycle calculation to use Calendar.
  https://android.googlesource.com/platform/frameworks/base/+/f2bead5

Call of Calendar.add() method might make a smaller field value
invariant. The smaller field means such a field of
Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND and so on
if Calendar.MONTH field is focused.
According to above, sometimes correct Calendar value won't be
acquired by original code.
To avoid unexpected change, it requires initialization toward
each smaller field after Calendar.add() call.

Solutions:
Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE,
and Calendar.SECOND fields is set to 0 after added value to
Calendar.MONTH field.

Bug: 32724903
Author: Shigeki Yokomichi <shigeki.x.yokomichi@sonymobile.com>
Change-Id: I7af6391653be21786b662b2f8eaad10c413733c1
2016-12-21 12:44:30 -07:00
Allen Hair
b0d5ade11c Enable multi-dex for coverage builds to fix breakage
am: 77a51d1274

Change-Id: Ife18d443d4c6a7ffcdb183cee3f7317efafbab38
2016-12-21 18:44:08 +00:00
Allen Hair
77a51d1274 Enable multi-dex for coverage builds to fix breakage
Test: m PRODUCT-bullhead-userdebug showcommands dist EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests
Change-Id: I6a324cbd0dc078ad2903345a069385d9f0d179ff
(cherry picked from commit aeaee4c5fe9a71949ddd701f2590559819bfe072)
2016-12-21 17:22:33 +00:00
Calin Juravle
e83feea26a Merge "Record data about dex files use on disk" 2016-12-21 13:34:20 +00:00
Calin Juravle
0f3fa9e3cc Merge "Add logic for recording dex files use on disk" 2016-12-21 11:03:11 +00:00
Esteban Talavera
548a04b8f8 Add DISALLOW_ADD_MANAGED_PROFILE to existing device owners
For device owners set pre-O, that restriction will not
be set via setDeviceOwner(). Therefore set it during
first boot after O OTA.

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services

Bug: 31952368

Change-Id: I7db9b14c49a75ae2760e6923a1f3f7cde0e2784b
2016-12-21 10:57:12 +00:00
Daniel Nishi
f1312cd68e Augment diskstats dumpsys to have categorization and apps.
am: 090b2d9d6c

Change-Id: I2c923293a1baf91b14ab50e25c880bfeb191403d
2016-12-21 02:23:50 +00:00
Daniel Nishi
a9d8602787 Add a file collector to the platform.
am: be770dce08

Change-Id: I2b908b6df1ad305207fca596d6c865dfeaecd5c9
2016-12-21 02:23:05 +00:00
Daniel Nishi
f5e2f1ae38 Add an app size collector.
am: c7d9de59bf

Change-Id: I83bdc3b47eda2658d7467b7c298652e39ad3f238
2016-12-21 02:21:31 +00:00
TreeHugger Robot
639f95dd13 Merge changes from topic 'diskstats-mr2' into nyc-mr2-dev
* changes:
  Augment diskstats dumpsys to have categorization and apps.
  Add a file collector to the platform.
2016-12-21 02:14:54 +00:00
Jeremy Joslin
8f5521aa67 Clear and restore the calling ID.
Clear and restore the calling identity in IPC methods after asserting
the caller has the required permissions.

Fixed 2 tests in NetworkScoreServiceTest that were failing due to a
recent refactor.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
BUG: 33781319
Change-Id: Icd79751d12dcfe4af8026980aaa1f7bd463468dc
2016-12-20 15:44:06 -08:00
TreeHugger Robot
0e4b9cd97d Merge "Expose ScanResult#untrusted as a @SystemApi." 2016-12-20 22:30:35 +00:00
Daniel Nishi
090b2d9d6c Augment diskstats dumpsys to have categorization and apps.
This adds a new service which opportunistically saves the
file system categorization information and the app sizes. This
information is fetched during a diskstats dumpsys call from a file
stored on the disk. This allows us to keep the dumpsys running quickly
while adding information which is costly to calculate.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Id59e84b9ad38a9debf3e46e5133ef06f7353829d
2016-12-20 13:32:51 -08:00
Daniel Nishi
c7d9de59bf Add an app size collector.
The app collector gets a list of app sizes for packages on a given
storage volume. This information will be exposed as part of an
expansion of the diskstats dumpsys.

When the collector runs, it sets up a handler on a BackgroundThread
which asks the PackageManager for the package sizes for all apps and
all users. The call for the information is blocked using a
CompletableFuture until the call times out or until we've received
all of the package stats. After the stats are all obtained, the
future completes.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: I3a27dc4410effb12ae33894b561c02a60322f7b0
2016-12-20 13:28:14 -08:00
Daniel Nishi
be770dce08 Add a file collector to the platform.
The file collector takes in a file path and recursively
classifies and provides the amount of storage provided by
each classification. This information can be surfaced in
Settings or to fulfill storage telemetry calculations.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Iff03260859cd4bbd11e7d60b1825115aad540d48
2016-12-20 13:24:14 -08:00
TreeHugger Robot
74dfc6b177 Merge changes from topic 'diskstats-update'
* changes:
  Augment diskstats dumpsys to have categorization and apps.
  Add a file collector to the platform.
2016-12-20 21:03:57 +00:00
Amin Shaikh
f9d47b79b2 Expose ScanResult#untrusted as a @SystemApi.
- Expose ScanResult#untrusted to inform NetworkRecommendationProviders
  that a ScanResult does not correspond to a saved network.
- Add static construction methods and assertions to RecommendationResult

Test: runtest frameworks-services

Bug: 33490132
Change-Id: If7006040f63843c1c468c9d95c5c017383c5c5dd
2016-12-20 12:22:08 -08:00
Daniel Nishi
77a78c6f44 Augment diskstats dumpsys to have categorization and apps.
This adds a new service which opportunistically saves the
file system categorization information and the app sizes. This
information is fetched during a diskstats dumpsys call from a file
stored on the disk. This allows us to keep the dumpsys running quickly
while adding information which is costly to calculate.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Id59e84b9ad38a9debf3e46e5133ef06f7353829d
2016-12-20 11:22:44 -08:00
Daniel Nishi
a59272eb5e Add an app size collector.
The app collector gets a list of app sizes for packages on a given
storage volume. This information will be exposed as part of an
expansion of the diskstats dumpsys.

When the collector runs, it sets up a handler on a BackgroundThread
which asks the PackageManager for the package sizes for all apps and
all users. The call for the information is blocked using a
CompletableFuture until the call times out or until we've received
all of the package stats. After the stats are all obtained, the
future completes.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: I3a27dc4410effb12ae33894b561c02a60322f7b0
2016-12-20 10:35:51 -08:00
Daniel Nishi
3c7febdbd8 Add a file collector to the platform.
The file collector takes in a file path and recursively
classifies and provides the amount of storage provided by
each classification. This information can be surfaced in
Settings or to fulfill storage telemetry calculations.

Bug: 32207207
Test: System server instrumentation tests
Change-Id: Iff03260859cd4bbd11e7d60b1825115aad540d48
2016-12-20 10:03:32 -08:00
Hugo Benichi
2abde827c5 DO NOT MERGE Stricter NetworkNotificationManagerTest
am: a865790a5b

Change-Id: I94ea5c6994d181e730ec4f49e98001eb81ed8740
2016-12-20 06:49:08 +00:00
Jeremy Joslin
71909ea39a Merge "Implement the request and recommend calls." am: 1e814b3928 am: b50fdc7faa
am: 949893f5b2

Change-Id: Ibd03bace49bc277a2777c8483da6b4ebfc56d217
2016-12-20 06:37:11 +00:00
Jeremy Joslin
949893f5b2 Merge "Implement the request and recommend calls." am: 1e814b3928
am: b50fdc7faa

Change-Id: I81f998b6934715f43797247f411919a4ceee5631
2016-12-20 06:32:42 +00:00
Jeremy Joslin
b50fdc7faa Merge "Implement the request and recommend calls."
am: 1e814b3928

Change-Id: I91c905ab2fc7e061462fb96c2c81a783aa93a391
2016-12-20 06:25:08 +00:00
Hugo Benichi
a865790a5b DO NOT MERGE Stricter NetworkNotificationManagerTest
This patch changes NetworkNotificationManagerTest to populate extraInfo
of NetworkInfo in order to catch regressions in malformed format Strings
of log statements in NetworkNotificationManager.

Test: verified that the test fails when reintroducing the format String
bug.
Bug: 33737715

Change-Id: If14063554b8246d9d80cd222cb41c30dee121c5a
2016-12-20 05:02:28 +00:00
Jeremy Joslin
d0d32e238e Merge "Implement the discovery of a network recommendation provider." am: 470d256519 am: 8fbeb1d74a
am: af811c2650

Change-Id: I18d4c618f78796cbbe6d895c5b2f888c4a9a55ff
2016-12-20 03:37:58 +00:00