Commit Graph

7128 Commits

Author SHA1 Message Date
Andreas Gampe
4c88a8c684 Zygote: Allow arbitrary-length wrap property names
The restriction on system property key length has been lifted.
Update the invoke-with code to first check the full-length property.
Then fall back to the truncated version for backwards-compatibility.

Test: m
Test: manual with long package name (Maps)
Change-Id: I9f714af093a6017307cfef18c84de769f0de7c3e
2017-05-15 19:51:29 -07:00
Paul Duffin
4455130610 Moved c.a.i.u.Predicate[s] into legacy-test
These classes are only used by android.test classes that are
being removed. As their name suggests they should not be in the
Android API at all so it makes sense to remove them. Especially
as there is java.lang.function.Predicate available now.

It appears as though Predicate was only added in to the API
because it was used by a method in the API as the directory in
which it and Predicates live was not on the list of classes to
explicitly index. Moving it into legacy-test meant that they are
now being indexed explicitly which means that Predicates needs
to be hidden.

Keeps running the tests as part of the existing target.

At runtime apps targeted at the API version before these are
removed will have the legacy-test library automatically added
to their classpath so they should see no effect. Apps that
target a later API will have to include those classes from the
android.legacy.test.jar which will contain all the android.test
classes that depend on it as well.

Bug: 30188076
Test: make checkbuild
Change-Id: Ia8502ec77ac11f85e078d70b68df214a9435eee7
Merged-In: I6f6f5f16fe93bd80227a450c6254166632fc6813
2017-05-15 15:17:48 +01:00
Hugo Benichi
00a16e077a NetworkStatsFactory: no double looping on stats + stacked interfaces
This patch uses the associative structure of the stacked/base interface
collection to avoid the two nested for loops over stacked/base
interfaces and all stats entries when correcting 464xlat traffic stats.

Consequently the list of stats entries is iterated only once.

Test: runtest -x frameworks/base/../NetworkStatsFactoryTest.java
Bug: 33681750
Change-Id: I84ae997fb693b909f431764697627b9957131732
2017-05-10 09:14:14 +09:00
Hugo Benichi
e1bb3a14d1 NetworkStatsFactory: fix double accounting on IPv6 only networks
For 464xlat scenarios on IPv6 networks, the clatd interface setup
introduces double counting of apps ipv4 traffic. NetworkStatsFactory was
accounting for this on the tx path, but not on the rx path. Also it did
not accounted for the 20 bytes added by the IPv6 header.

This patch subtract correctly the rx and tx traffic from the root uid on
the underlying interface, and also adds correctly the 20 bytes cost per
packet on the stacked interface for 464xlat traffic.

Test: added several new unit tests, based on synthetic data and real
      data also.
Bug: 33681750
Change-Id: I2675643b220acbc6110179fa937d4c313b6f5e32
2017-05-09 22:46:14 +09:00
Hugo Benichi
495a17b332 Move byte logics from ApfFilter into BitsUtil
This patch extracts into BitUtils byte manipulation helper methods
and unsigned type manipulation helper methods from ApfFilter into
an independent and reusable structure.

Test: $ runtest frameworks-net
Change-Id: I0f33af10457a63dbde5983f14353a79b8cd877d9
2017-04-22 10:07:03 +09:00
Hugo Benichi
9910dbc682 Add BitUtils bit packing methods (Connectivity metrics: add transports pretty printing)
This patch is a partial cherry-pick from commit
df456e13a1 for the BitUtils and
NetworkCapabilities classes.

Bug: 34901696
Test: none

(cherry picked from commit df456e13a1)

Merged-In: Id04f9080e7f75608deeb49306aec34941e71794c
Change-Id: I64eae49f646365b7cd1683a689315fe03bf0bdd9
2017-04-22 09:58:42 +09:00
Eugene Susla
8ab86a6dc6 Add BitUtils (from "Support multiple filters per association request")
This patch is a cherry-pick of the BitUtils class from commit
36e866b8e0.

(cherry picked from commit 36e866b8e0)

Test: none
Change-Id: Iaf33929f6841db273a92d650e84287bf2964fa3d
Merged-In: I0a978787551a1ee5750ec5544b241d3bbfed5a7c
2017-04-20 12:16:48 +09:00
Mukesh Agrawal
ad2684ca3d Merge changes I5c16c650,I3151fb6b
am: 55efea25f3

Change-Id: Ifaaae29780d905ffe9f82645d6d17dad478ba6a9
2017-03-29 18:30:00 +00:00
mukesh agrawal
47e1c7a005 StateMachine: make toString() terser
The current implementation of the toString()
method calls dump(). This causes two problems:

1. toString() may return a large string. This
   is at odds with the advice in the documentation
   for Object.toString(), which says that the
   returned String should be concise, and easy
   to read.
2. The dump() method is overriden by many of the
   StateMachine subclasses. Some of those subclasses
   have dump() implementations that are expensive,
   and/or have dependencies on other objects.

To resolve these problems, we simpify
StateMachine.toString().

Along the way: remove a stale comment about
implementing dump() using toString().

Note: only ran the StateMachine tests, since some
other tests are already failing.

Bug: 36661851
Test: tests/utiltests/runtests.sh \
      -e class com.android.internal.util.StateMachineTest
Change-Id: I5c16c650f01178c4d018b6a65e4aa95fb905aff6
2017-03-28 18:21:36 -07:00
Andreas Gampe
1d9c3ba10d Merge "Zygote: Preserve capabilities in WrapperInit"
am: 1ae7af10ff

Change-Id: Ia1ffb03d6e03b098cc634ef2deb3785c6bb87202
2017-03-21 18:54:22 +00:00
Andreas Gampe
220aba254b Zygote: Preserve capabilities in WrapperInit
Preserve the capabilities a zygote fork has across the sh exec in
WrapperInit. Use ambient capabilities.

Test: m
Test: adb shell setprop wrap.com.android.bluetooth logwrapper && adb shell kill `pid com.android.bluetooth`
Merged-In: I3526d6a31aaadf082365c9ce31da0950e17677eb
Change-Id: I3526d6a31aaadf082365c9ce31da0950e17677eb
2017-03-21 08:39:26 -07:00
tony.ys_liu
959628a32e Merge "Set system server's class loader for wrap.system_server"
am: 8d2d6bfa12

Change-Id: Iba4af152c9f29ad6e8c9bb1b0a1047e96d287c6b
2017-03-16 15:42:53 +00:00
tony.ys_liu
34738174ba Set system server's class loader for wrap.system_server
Root Cause: systemServer's class path is not set
  after set wrap.system_server property, and restart system_server,
  it shows a java.lang.RuntimeException:
    Missing class when invoking static main com.android.server.SystemServer

Solution: Correctly pass and parse a passed classpath.

Bug: 34692265
Test: adb root && adb shell stop && adb shell setprop wrap.system_server logwrapper && adb shell start
Change-Id: Ia6707dc05fa627af6cc28360d26b894487a6eff1
2017-03-15 16:33:04 -07:00
Hiroshi Yamauchi
55310df6bc Merge "Fix the reset of boosted zygote thread priority."
am: 83aceea07d

Change-Id: I6ebd30a631ae10ada65b3279ec66c41d3f50fb1f
2017-03-13 17:42:50 +00:00
Hiroshi Yamauchi
04ed650083 Fix the reset of boosted zygote thread priority.
This fixes the unexpected priority 112 of the daemon threads
(eg. HeapTaskDaemon). The problem was that when the zygote main
thread's priority is reset, it directly calls setpriority() and fails
to update the priority value in java.lang.Thread, which in turn causes
any threads created by the thread to unexpectedly inherit the boosted
priority. Calling java.lang.Thread.setPriority instead fixes.

(cherry picked from commit 1e3db871e5)

Bug: 35801778
Bug: 28866384
Test: angler master userdebug boots and thread priorities checked.

Change-Id: I68a6ed7244a9067acc2749feca7f88422bf44b02
2017-03-13 10:31:30 -07:00
Mukesh Agrawal
0a2d5cf7db Merge "StateMachine: add getLogRecMaxSize()"
am: 22e43471ed

Change-Id: Iaab7955c0721e240487e8c842e994c90141d6013
2017-02-24 19:32:03 +00:00
mukesh agrawal
8ed82ec198 StateMachine: add getLogRecMaxSize()
Add the getLogRecMaxSize() method, so that
WifiStateMachine tests can verify the log
record buffer size, without having to fill
the buffer.

Bug: 35399013
Test: compile
Change-Id: Ib1bd8d670b7b39e9f740a4dd92ea67463b179ce2
2017-02-23 17:40:01 -08:00
Paul Duffin
fd61eb1e39 Merge "Deprecate TestSuiteBuilder and related classes."
am: a26000b8f5

Change-Id: Ia9d491bd72f2a9f08838e298aaf4de5de28c7d4f
2017-02-23 13:44:24 +00:00
Paul Duffin
253ad40649 Deprecate TestSuiteBuilder and related classes.
Deprecates com.android.internal.util.Predicate in favour of
java.util.function.Predicate.

Deprecates TestMethod and TestSuiteBuilder in favour of
Android Test Support Library.

Bug: 35089332
Test: make checkbuild
Change-Id: Id8b2be55925d7ca09750fc9681817793517ceb5d
2017-02-22 15:18:19 +00:00
Xiaohui Chen
0a804ff49c Merge "ReolverActivity: try auto launching single choice" into nyc-mr2-dev
am: daacf547ac

Change-Id: I06ca33714f6227f8cf86ecce29e1b87df80add6b
2017-02-16 19:29:18 +00:00
TreeHugger Robot
daacf547ac Merge "ReolverActivity: try auto launching single choice" into nyc-mr2-dev 2017-02-16 19:22:02 +00:00
Xiaohui Chen
393c8018a1 ReolverActivity: try auto launching single choice
We already does this on start.  Now we also do the same when
the list of options changes.

Test: locally on device
Bug: 34470067
Change-Id: Ib184d67b532c5afd584fb9cd52daac69a7c50d0a
2017-02-15 09:48:38 -08:00
Michael Kwan
e7c91f721c Merge "Fix incorrect values for VelocityTracker in SwipeDismissLayout." into cw-f-dev am: c61cd1a635
am: 83b072c48c

Change-Id: I77b0a0a30e60658dbcf3ab0806bd0227939b8ba8
2017-02-14 22:57:48 +00:00
Michael Kwan
83b072c48c Merge "Fix incorrect values for VelocityTracker in SwipeDismissLayout." into cw-f-dev
am: c61cd1a635

Change-Id: Ib1cff2ace082862c2a1c250170453b989f6697df
2017-02-14 22:53:41 +00:00
TreeHugger Robot
c61cd1a635 Merge "Fix incorrect values for VelocityTracker in SwipeDismissLayout." into cw-f-dev 2017-02-14 22:47:00 +00:00
Michael Kwan
390120b925 Fix incorrect values for VelocityTracker in SwipeDismissLayout.
The offset used to adjust MotionEvents for swipe velocity tracking
was incorrect, and caused issues when touch points where close
together. Fixed the offset used, which resolved swiping issues.

Bug: 34673753
Change-Id: Ide6060b511510bcf299e3db778e6ffc6afda5e19
2017-02-14 12:04:38 -08:00
Michael Kwan
49fa0405b1 Merge "Only modify window layout params when necessary." into cw-f-dev am: 9fbd981f23
am: a26e371c9b

Change-Id: I72bf9b5fa5dfaaa7573115ed5b6cca23a0be05f4
2017-02-14 01:00:23 +00:00
Michael Kwan
a26e371c9b Merge "Only modify window layout params when necessary." into cw-f-dev
am: 9fbd981f23

Change-Id: I36aa427a3023dcba2a29eccfc0b7aac43748e534
2017-02-14 00:55:32 +00:00
Michael Kwan
d56887f8fa Merge "Only modify window layout params when necessary." into cw-f-dev
am: 9fbd981f23

Change-Id: I14316841b80bdb25755e174528ef4bb271d3e005
2017-02-14 00:55:29 +00:00
Michael Kwan
9fbd981f23 Merge "Only modify window layout params when necessary." into cw-f-dev 2017-02-14 00:48:12 +00:00
Hakan Seyalioglu
aeb1f1241e DO NOT MERGE - Check exported status in chooser
am: 7bae18232e

Change-Id: Id29e65bd455c704738618f1dacfcad53b8d0b773
2017-02-14 00:41:55 +00:00
Hakan Seyalioglu
7bae18232e DO NOT MERGE - Check exported status in chooser
Relevant change in master is ag/1844170

bug: 34147053
Change-Id: Ic9d9d65c66325904c95ab3966bdcc16e7668278b
(cherry picked from commit e3286c3145)
2017-02-13 23:12:28 +00:00
Michael Kwan
134ad6ef3f Only modify window layout params when necessary.
Cancelling swipe-to-dismiss will trigger a check to ensure the window
is reset to its original state. Ensure that the reset is actually
required before setting the new layout attributes.

Bug: 34816397
Change-Id: Idf26ce7c8b63dc44a76effefcb32eb8d8665f605
2017-02-13 13:20:09 -08:00
Michael Kwan
6853de9729 Add tweaks to smooth out swipe to dismiss. am: 5758a9a94c
am: 2155f773db

Change-Id: Iab07b13f24b7ca32b6bbb6faf788a71fccb969ec
2017-02-13 19:38:32 +00:00
Michael Kwan
2155f773db Add tweaks to smooth out swipe to dismiss.
am: 5758a9a94c

Change-Id: I64b9e88a7efb164b0e0160f8b25f770fb986efd6
2017-02-13 19:32:35 +00:00
Michael Kwan
ddc6e0b7ae Add tweaks to smooth out swipe to dismiss.
am: 5758a9a94c

Change-Id: Id10a31504aa5a579e8670e7a23d2d99a990ed6e5
2017-02-13 19:32:29 +00:00
Michael Kwan
5758a9a94c Add tweaks to smooth out swipe to dismiss.
Bug: 34673753
Change-Id: I5a9d420c70d124fc764803d505291e66818b1aa2
(cherry picked from commit 2e11adaac3)
2017-02-13 06:17:06 +00:00
Jesse Hall
516274249f resolve merge conflicts of b3a1417663 to nyc-mr2-dev-plus-aosp
Test: mmma frameworks/base
Change-Id: I2e1e04f55d05fd8aa33da304bdb951713b37793c
2017-02-10 17:15:15 -08:00
Jesse Hall
b3a1417663 Zygote: Restore GL preload
Preloading GLES drivers in Zygote was removed previously since it is
incompatible with updatable drivers. That caused some app startup
latency and system memory use regressions. This change re-adds GLES
driver preloading, but only on devices that don't support driver
updates.

Bug: 34611670
Bug: 35052548
Test: boot angler, systrace of Calculator app startup
Change-Id: Ibdc6b3c0ba4473574722641d4bfad4b375f908a3
(cherry picked from commit ba0370eef3)
2017-02-10 12:59:10 -08:00
Andreas Gampe
c28592da33 Merge "Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit" am: 851afe56b8 am: 0e01cae667
am: 74acde1bc5

Change-Id: I40d67fcde4d9263d5c75d5c3f782a860dcff93f8
2017-02-10 01:03:15 +00:00
Andreas Gampe
74acde1bc5 Merge "Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit" am: 851afe56b8
am: 0e01cae667

Change-Id: Ifaa7595efaef554a47e05e030ccaf16a53a3bfce
2017-02-10 00:58:42 +00:00
Treehugger Robot
851afe56b8 Merge "Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit" 2017-02-10 00:45:56 +00:00
Andreas Gampe
4e66db8d0c Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit
Move methods where they belong.

Test: m
Test: Device boots
Merged-In: I805c6493078e960ff5b70d84dd93d2da6c7aa797
Change-Id: I805c6493078e960ff5b70d84dd93d2da6c7aa797
2017-02-09 13:16:17 -08:00
Paul Duffin
8faed45024 Merge "Partial Revert "Replace com.android.internal.util.Predicate with java.util.function.Predicate"" am: 621ebe692f am: a2c92b0b88
am: c1a93884dc

Change-Id: Icce543cd86f83bff8c2e80bf7ef492d22c9cf2dc
2017-02-09 19:37:26 +00:00
Paul Duffin
c1a93884dc Merge "Partial Revert "Replace com.android.internal.util.Predicate with java.util.function.Predicate"" am: 621ebe692f
am: a2c92b0b88

Change-Id: I605588603280ff0b4ebc1088c6c1f1c933c1e657
2017-02-09 19:32:58 +00:00
Paul Duffin
57e490cf8c Partial Revert "Replace com.android.internal.util.Predicate with java.util.function.Predicate"
This partially reverts commit 3e5fbca0c5.

Bug: 35187548
Bug: 30188076
Bug: 35089332
Test: make checkbuild
Change-Id: I7ab4279aab604e3d56003b0a59867948aebabd28
2017-02-09 14:52:43 +00:00
Paul Duffin
c02f6bb64b Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" am: 78a20be77a am: 9e99b9ee45
am: 9250814fd2

Change-Id: Ifd924bdb62102657bf0c6d4b07ab919cf0f96c0c
2017-02-08 20:18:34 +00:00
Paul Duffin
9250814fd2 Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" am: 78a20be77a
am: 9e99b9ee45

Change-Id: I289950cff0cdc6b5ad301936c7b55eadee5fd0f8
2017-02-08 18:30:17 +00:00
Paul Duffin
78a20be77a Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" 2017-02-08 18:06:08 +00:00
Paul Duffin
d0a937e84b Merge "Fix problem with JavaDoc" am: 8f33fcdc4b am: 4929aafc1d
am: 290274df0d

Change-Id: I4e9ef88d6aa6c69a35b6b995ebf0b90214aef79d
2017-02-08 11:39:15 +00:00