Commit Graph

8395 Commits

Author SHA1 Message Date
Hugo Benichi
a2161c5ccb Merge changes Ia47e566b,Ib94d79a9
am: b9e2ddfc10

Change-Id: I0cac456f778db78d76d2225b79ce42526a6d2d19
2017-09-26 11:46:30 +00:00
Hugo Benichi
67c5e03b54 Extract RingBuffer class from NetdEventListenerService
This patch takes out the ring buffer array added for NFLOG wakeup packet
events logging and extract it into its own class for reuse. This new
RingBuffer class has the two minimal useful functions append() and
toArray().

Bug: 65164242
Bug: 65700460
Test: runtest frameworks-net, with new unit test
Change-Id: Ib94d79a93f4e99661b7d0fac67117b91d57af980
2017-09-26 14:14:16 +09:00
Nicolas Geoffray
79d4ef6caa Merge "Special handling of priv-apps in Zygote."
am: 46af70cad9

Change-Id: I1dbf2313c9ee1c014854630eac5f1429548ae7f6
2017-09-19 11:56:05 +00:00
Nicolas Geoffray
46af70cad9 Merge "Special handling of priv-apps in Zygote." 2017-09-19 11:47:58 +00:00
Narayan Kamath
66d7275d39 Merge changes Id931d441,I83faf974
am: 89c94f67b4

Change-Id: Ifc090e141092bcee11704e45d6f97f642040d002
2017-09-14 23:57:14 +00:00
Narayan Kamath
ac0b4be198 Zygote: Improve logging and error handling during connections.
Before this change, we were throwing a checked exception on success
and returning on failure. This made it hard to figure out where / when
something was going wrong. This change switches things around to throw
a RuntimeException when something goes wrong and to return a Runnable
on success. This lets us make stronger assertions in both the parent
and the child process about their state and expected return values.

This change also upgrades the severity of several errors that we would
earlier just ignore. We will now reject the command and terminate the
connection to the client when we encounter these errors such as:

- Malformed arguments
- Any ZygoteSecurityException, such as thown thrown by
  applyUidSecurityPolicy and applyInvokeWithSecurityPolicy.
- Any error in setting up pipes etc. to facilitate communication
  with child processes.

(cherry picked from commit bf99d06003)

Bug: 13618569
Test: Manual
Merged-In: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
Change-Id: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
2017-09-13 18:40:59 -07:00
Narayan Kamath
a3d4230b92 Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

(cherry picked from commit 24a3306c32)

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

Merged-In: I83faf974c9a70a6ab18323f692c1981784e4c56a
Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-09-13 18:37:05 -07:00
Nicolas Geoffray
1f88ad66e1 Special handling of priv-apps in Zygote.
If pm.dexopt.priv-apps is set to false, disable verifier and
only allow loading oat files from system.

bug: 30972906
bug: 63920015

Test: works as expected when pm.dexopt.priv-apps is true or false
Change-Id: Ib9e80c9b7b4106e82c0b9d1c7fbb8065c190ac1f
2017-09-13 14:21:00 +01:00
Nicolas Geoffray
1bf40f63b3 Missed these renames in last commit.
Test: builds
Change-Id: I6c2d03accc55aef8381f38f9b182f2367e25a915
2017-09-13 12:59:21 +01:00
Nicolas Geoffray
8dbb5e51c8 resolve merge conflicts of e017dae587 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7008986501028ec9bee0505d41aae3ff27872b50
2017-09-13 11:08:36 +01:00
Nicolas Geoffray
81edac4037 Rename debugFlags to runtimeFlags.
Also now pass the flags to the forked process through --runtime-flags instead
of converting to command line arguments and converting back to an integer.

bug: 30972906
bug: 63920015

Test: builds

Change-Id: I7f10c43dd916ca2d3b9b5141f17261eb7b64f49a
2017-09-12 15:54:23 +01:00
Julia Reynolds
a1bd36ada7 Merge "Let the foreground service channel be blocked" into oc-dr1-dev
am: 6614a2e5d0

Change-Id: I5d1e93740b2a53c7cb85fc105bca6863f7e27577
2017-08-17 23:13:26 +00:00
Julia Reynolds
c23a2e67ac Let the foreground service channel be blocked
And update the channel name

Change-Id: Ic4b909d31b38b9e1ee05f9b3e4e5c91efc6752b1
Fixes: 36891897
Test: manual
2017-08-17 14:11:45 -04:00
Luis Hector Chavez
64f1d42e6c Merge "Improve container capability bounding in containers" am: 586fd52b34 am: ed05287c55
am: 755baf92b4

Change-Id: I07eb375c2b86651fd7d65f944b19161d2c977df4
2017-08-16 22:11:14 +00:00
Luis Hector Chavez
755baf92b4 Merge "Improve container capability bounding in containers" am: 586fd52b34
am: ed05287c55

Change-Id: I6068105d31418ec7b1c89f099bf635618147c227
2017-08-16 21:43:28 +00:00
Luis Hector Chavez
ed05287c55 Merge "Improve container capability bounding in containers"
am: 586fd52b34

Change-Id: I7c67b571164e67b3e4a8ae9c9a2701e338693a4b
2017-08-16 21:32:13 +00:00
Treehugger Robot
586fd52b34 Merge "Improve container capability bounding in containers" 2017-08-16 21:16:50 +00:00
Luis Hector Chavez
72042c99a6 Improve container capability bounding in containers
This change stops relying on the ro.boot.container property for dropping
a subset of capabilities and instead relies on the effective capability
mask of the Zygote process, prior to forking.

When Android is running in a pid/mount/net/user namespace, even if a
particular capability is present, some operations that require that
capability check whether it is allowed in the init namespace (instead of
in the current namespace), so they would fail even with the capability
granted within the namespace. So, explicitly dropping the capabilities
from the beginning allows for clearer signalling of which operations can
be expected to work instead of failing silently for mysterious reasons.

Bug: 63579953
Test: aosp_bullhead-eng still boots
Test: Running Zygote without CAP_SYS_MODULE makes it such that
      system_server does not request it.

Change-Id: I1d18d13341bcc04e701fd14092e7e94961728620
2017-08-16 08:21:58 -07:00
Hugo Benichi
1ada5660ce Merge "More OWNERS file for core networking team" am: 2827f21740 am: 1da7985327
am: 63fdcd08f8

Change-Id: Ie901f6770c2aa9b95f6ccdd9a78bee8d44a0d041
2017-08-16 12:23:15 +00:00
Hugo Benichi
63fdcd08f8 Merge "More OWNERS file for core networking team" am: 2827f21740
am: 1da7985327

Change-Id: Ieb04d616adf0969d2f4f468bf93fdc4b0aac75c5
2017-08-16 12:10:19 +00:00
Hugo Benichi
1da7985327 Merge "More OWNERS file for core networking team"
am: 2827f21740

Change-Id: Icae3bc4dbb2cd094c728d98aea02d4009aaa0e0b
2017-08-16 11:57:50 +00:00
Hugo Benichi
b8f1e4e6e4 More OWNERS file for core networking team
Test: build
Change-Id: I7cef188e29f487025aee04ab0c1a003bb32a7048
2017-08-16 18:40:07 +09:00
Christofer Åkersten
28cc38c435 Merge "Inherit theme dark/light scheme for MediaRouter dialogs/button" into oc-dr1-dev
am: 8cbb5ffd5b

Change-Id: I4572f4f221c6b50cf41ddb094cf7bb9d2d48bfbd
2017-08-09 17:41:48 +00:00
TreeHugger Robot
8cbb5ffd5b Merge "Inherit theme dark/light scheme for MediaRouter dialogs/button" into oc-dr1-dev 2017-08-09 17:31:48 +00:00
Christofer Åkersten
fb09ecfdd7 Inherit theme dark/light scheme for MediaRouter dialogs/button
Bug: 64291950
Test: manual
Change-Id: I20694ce512a794a3c6574108b80dcfb4979b3b39
Merged-In: I20694ce512a794a3c6574108b80dcfb4979b3b39
2017-08-09 16:28:50 +09:00
Andrew Sapperstein
3a7771064a Merge "Make accessibilityInversionEnabled public" into oc-dr1-dev
am: 3108a06656

Change-Id: I13fa736dbb5d468381ea32e75c7a69f18edd546b
2017-08-09 00:19:56 +00:00
Andrew Sapperstein
5a71a0f520 Make accessibilityInversionEnabled public
Need to use it in Settings.

Bug: 64256644
Test: existing
Change-Id: I9f9d2655e35ee2ad0dc9f9980cc9993f7b084025
2017-08-08 13:57:49 -07:00
Jason Monk
561c120990 Merge "Move shutdown UI to sysui (when possible)" into oc-dr1-dev
am: de0c539dd4

Change-Id: Ide08868338f55a826f36ebc8f70c4d1decaefb70
2017-08-08 17:00:25 +00:00
Jason Monk
b4302182bc Move shutdown UI to sysui (when possible)
Test: click restart or power off in global actions
Change-Id: I0dc30a9772bbfb3cd3c3568f157e854fef87bf87
Fixes: 63576195
Fixes: 64125291
2017-08-08 09:13:51 -04:00
Colin Cross
2130e26bca Merge "Use class retention for VisibleForTesting annotations" am: 5724841581 am: 94d5456d0e
am: a5538805d9

Change-Id: I83547deec96de1a26318c30d9ed01865d1be4254
2017-08-07 19:56:23 +00:00
Colin Cross
a5538805d9 Merge "Use class retention for VisibleForTesting annotations" am: 5724841581
am: 94d5456d0e

Change-Id: I3309ee0b936eb9d36a453beb084be31e046c1bf5
2017-08-07 19:44:57 +00:00
Colin Cross
94d5456d0e Merge "Use class retention for VisibleForTesting annotations"
am: 5724841581

Change-Id: Iaa9262ad627b49d58b46760d7aecd3a985c3a79a
2017-08-07 19:32:21 +00:00
Colin Cross
5be3cbad27 Use class retention for VisibleForTesting annotations
The VisibleForTesting annotations are used by proguard to prevent
stripping code that is needed at runtime for tests.  The annotations
were marked with source retention, which worked fine with Jack's
proguard implementation.  When we switched back to javac + proguard,
the VisibleForTesting annotations are gone by the time proguard
sees the classes, so the annotated classes and methods can still
be stripped.

Move the VisibleForTesting annotation to class retention, which
matches guava's equivalent annotation.

Bug: 64365384
Test: m -j MtpDocumentsProvider &&
      javap -cp out/target/common/obj/APPS/MtpDocumentsProvider_intermediates/classes-proguard.jar com.android.mtp.MtpRoot

Change-Id: I63a467c2f0a21383eb9e4c9563fd6de2d994a373
Merged-In: I63a467c2f0a21383eb9e4c9563fd6de2d994a373
(cherry picked from commit 8e846143dd)
2017-08-07 11:07:15 -07:00
Amith Yamasani
26f8f5c868 Merge "Ignore isolated uid's process state in BatteryStats tracking" into oc-dr1-dev
am: 5a800cf069

Change-Id: I4b2e2dc81baea8078b0bca1db357e234bda27bf7
2017-08-03 23:18:32 +00:00
Amith Yamasani
5a800cf069 Merge "Ignore isolated uid's process state in BatteryStats tracking" into oc-dr1-dev 2017-08-03 23:07:32 +00:00
Lucas Dupin
89f58e156e Merge "Multi-user and WallpaperColors" into oc-dr1-dev
am: e09e5ef21b

Change-Id: Idb06a8e04ac1cb9bf73fe168217d5369bb412b4f
2017-08-03 22:56:54 +00:00
Lucas Dupin
26fb43c034 Multi-user and WallpaperColors
Test: set different wallpapers for different users and switch between them.
Test: re-ran cts tests at cts/tests/app/src/android/app/cts/WallpaperManagerTest.java
Change-Id: Ic06d1dc6db26869a2948590863ca9b8ac81c630e
Merged-In: Ic06d1dc6db26869a2948590863ca9b8ac81c630e
Fixes: 63513694
2017-08-02 23:18:26 +00:00
Geoffrey Pitsch
7662de2771 Merge "Disable AOD when accessibility color inversion is on." into oc-dr1-dev
am: 861b35e1df

Change-Id: I4ee3ad06138a66b47bca6e56fbbd0bd970d91e08
2017-08-01 14:08:36 +00:00
Geoffrey Pitsch
3ba2623ffe Disable AOD when accessibility color inversion is on.
White background drains too much to be always on.

Bug: 62918778
Test: Manual
Change-Id: I78b2f6a5951b108aff4f353dabe2493117032dce
2017-07-31 13:55:59 -04:00
Lucas Dupin
835f5e41de Merge "Scrim opacity must satisfy GAR" into oc-dr1-dev
am: f98facc3b8

Change-Id: I4c4eb814d8ea2152644665daf6fbd6eb28d81b06
2017-07-29 23:17:49 +00:00
Lucas Dupin
9324aa926a Scrim opacity must satisfy GAR
Change-Id: Ic0a2423d73f0a3439a0dc4de8eb6e4719dbf36e1
Fixes: 63365056
Test: runtest -x tests/Internal/src/com/android/internal/graphics/ColorUtilsTest.java
2017-07-28 10:07:04 -07:00
Lucas Dupin
98c63ca9ac Merge "Add theme variables to SysUI dump" into oc-dr1-dev
am: 4451b6ae19

Change-Id: I1549a77346b4c7c417ba2fa7a2b77a9b0ea2ea2a
2017-07-27 16:49:49 +00:00
Lucas Dupin
8a4522dceb Add theme variables to SysUI dump
Dumping current themes and scrim states to make debugging easier.

Bug: 63890571
Test: adb bugreport # look for new variables
Change-Id: Ia9bfd1b91d8d2c19930cb896d337ecdfa776e6cb
2017-07-26 21:48:06 -07:00
Amith Yamasani
fd3caf6a7d Ignore isolated uid's process state in BatteryStats tracking
Isolated UIDs keep coming and going, with their process states
being downgraded. But this shouldn't impact the process state
time tracking in battery stats, since the parent UIDs process state
reflects the overall state already.

This fixes incorrect TOP time reporting in Settings for apps like
Chrome.

Change-Id: I0e94b064cd19f1f2d951e1e88aaba06b5c1c26fe
Fixes: 62162308
Test: Use chrome for a while and observe output of dumpsys batterystats
2017-07-26 11:48:35 -07:00
Selim Cinek
49cdbaa25f Merge "Changing the way the media image scales" into oc-dr1-dev
am: e06e3f97fc

Change-Id: I667f1ec67a02c5ae264115a5b8bbe06dedda1d34
2017-07-25 23:04:53 +00:00
Selim Cinek
e06e3f97fc Merge "Changing the way the media image scales" into oc-dr1-dev 2017-07-25 22:45:55 +00:00
Lucas Dupin
667c29d0be Merge "Fix jank when switching themes" into oc-dr1-dev
am: a1f64b0a91

Change-Id: I60c1b404b4b3a673cd3bf44f36deed546965f9cc
2017-07-25 17:47:47 +00:00
TreeHugger Robot
a1f64b0a91 Merge "Fix jank when switching themes" into oc-dr1-dev 2017-07-25 17:40:02 +00:00
Ajay Panicker
a14a02e5fc Merge "Batterystats handles nested unoptimized ble scans" into oc-dr1-dev
am: aaf3860941

Change-Id: I3ea0257deb116f89aa62afd49fd4daefb8a782d5
2017-07-25 02:19:18 +00:00
Ajay Panicker
aaf3860941 Merge "Batterystats handles nested unoptimized ble scans" into oc-dr1-dev 2017-07-25 02:11:26 +00:00