1999 Commits

Author SHA1 Message Date
Lorenzo Colitti
c86013be93 Move some NetworkStats tests to tests/net.
This groups them together with the rest of the networking unit
tests. It also speeds up compile/test cycles ("runtest -x" of one
file goes from 1m15s to 30s).

Test: runtest frameworks-net passes on internal tree
Change-Id: I53cb0c51355fe4b4b30e451fa09fbbf58da39efd
2017-04-13 02:38:11 +09:00
Hugo Benichi
35786735df Merge "Improve utility of IntArray and LongArray" 2017-04-10 01:09:04 +00:00
Hugo Benichi
112962a6b0 Improve utility of IntArray and LongArray
This patch adds several utility methods to IntArray and LongArray to
make them more useful in the context of a Parcelable class.

More specifically, it is now possible to parcel and unparcel a
{Int, Long}Array with the following one liners:
  - mIntArray = IntArray.wrap(parcel.createIntArray());
  - parcel.writeIntArray(mIntArray.toArray());

This patch also
  - adds unit tests for IntArray and LongArray.
  - adds a method for setting a field at a given index.
  - adds a method for changing the effective array length.
  - adds missing bound checks for negative index values.

Test: added test coverage
Bug: 34901696
Change-Id: Ia0febf4dae048b0a45c75310b5d90b56499320da
2017-04-07 13:18:16 +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
mukesh agrawal
28882ed5d5 utiltests: add script to run tests
Make it easier to run the tests, so that more people
will run them.

Bug: 36698401
Test: tests/utiltests/runtests.sh \
      -e class com.android.internal.util.StateMachineTest

Change-Id: I3151fb6b2f609f45c7d8154b51f13cce58ccdc13
2017-03-28 18:21:35 -07:00
Wei Wang
4ff81206e0 Merge "Remove bg_non_interactive cgroup"
am: c6c19bd6c0

Change-Id: I35917ee0c52720138c901fd638e07f84ae4c3cf3
2017-03-21 22:19:41 +00:00
Wei Wang
3adba7202f Remove bg_non_interactive cgroup
Bug: 34193533
Test: mma
Change-Id: I0d255f47eaded15eda02a4654193a4e49c63a2c5
2017-03-20 22:16:29 -07:00
Paul Duffin
17e5a2d851 Merge "Refactor code incompatible with Mockito 2.7.13"
am: 2a3a4f81f9

Change-Id: I259dc2116f1ba7d409729d739404dca501f4a5e8
2017-03-10 20:43:07 +00:00
Paul Duffin
26e81d2a47 Refactor code incompatible with Mockito 2.7.13
Bug: 32912773
Test: make checkbuild
Merged-In: I96e3da967fad731fc8f39bde9db95f50ab7353fb
Change-Id: I445b32432eea8a1ccb2060a73460a882a9ebe76f
2017-03-10 14:19:18 +00:00
Joachim Sauer
260b81aaf2 Merge "Renaming Czech Republic to Czechia."
am: 33bade08de

Change-Id: Ie76ebb1bd53eb4993f0d01c7d3b5ba7dae9c6504
2017-03-08 17:40:13 +00:00
Joachim Sauer
33bade08de Merge "Renaming Czech Republic to Czechia." 2017-03-08 17:31:27 +00:00
Paul Duffin
b29311bbba Merge "Replace usages of littlemock with mockito"
am: 0a11c83016

Change-Id: I1456ae3d07d396080a817de01796eefc71230981
2017-03-08 14:59:26 +00:00
Paul Duffin
9df5d4f715 Replace usages of littlemock with mockito
Littlemock appears to have been created as an alternative to
Mockito that would work on Android. Given that Mockito does
now work on Android and Littlemock has had no activity since
Aug 2012 it seems prudent to switch over to use Mockito instead.

https://code.google.com/archive/p/littlemock/

This is being done as part of the work to upgrade Mockito.

Bug: 32912773
Test: Build and install affected APKs, test using am instrument
Change-Id: Id0e57880ea66c5681b664bbfb534c96410544665
2017-03-07 13:55:52 +00:00
Fredrik Roubert
45ded8f6ba Renaming Czech Republic to Czechia.
Bug: 34964100
Test: ?
Change-Id: Ifbf0a52d15e3d735404be49c6934775589ecdfd6
2017-02-23 17:30:14 +01:00
Colin Cross
3c2c2764d4 Merge changes I82aa8140,Ib62a5dd6,I2c4d64e2
am: 313e645801

Change-Id: Ia10d20ea4ebabc2cc84524950dec7570104b185f
2017-02-17 22:25:53 +00:00
Colin Cross
be2d3307e2 Revert "Remove support of disabling Jack."
This reverts commit ba068f48727dee2223b3be3b0359accb949e363d.

Test: builds
Change-Id: I2c4d64e26c2e4ceb710a39de2ee9749160d33a72
2017-02-16 11:41:42 -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
a2c92b0b88 Merge "Partial Revert "Replace com.android.internal.util.Predicate with java.util.function.Predicate""
am: 621ebe692f

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

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
9e99b9ee45 Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate"
am: 78a20be77a

Change-Id: I6f32dc27f70e4c22d25ec6bd2eec715700ebbd89
2017-02-08 18:14:50 +00:00
Paul Duffin
3e5fbca0c5 Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Merged-In: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
Change-Id: I58e4e35e7b7315033d893748f7c79e1ba6732f39
2017-02-07 16:57:54 +00:00
Aga Madurska
65f351d923 Use correct APIs to detect conditions for round scrollbars. am: 99485ef841
am: 50bc6a1998

Change-Id: Iab07814fd54b35705a20088e29c78a56ea943eba
2017-02-06 19:40:50 +00:00
Aga Madurska
9e7a8688c1 Use correct APIs to detect conditions for round scrollbars.
am: 99485ef841

Change-Id: I8aaa6bf17e253f6178b96c6743ff7779d5f3b7ef
2017-02-06 19:37:04 +00:00
Aga Madurska
50bc6a1998 Use correct APIs to detect conditions for round scrollbars.
am: 99485ef841

Change-Id: I8301a27b03d1ba64e48064057f112ebaf38eb6c2
2017-02-06 19:37:00 +00:00
Aga Madurska
99485ef841 Use correct APIs to detect conditions for round scrollbars.
Bug: 34876394

Test: Performed manually.

Change-Id: I9e690e99fd8d925c589ebd19d9c6754eeb63b1d8
2017-02-06 12:33:36 +00:00
The Android Automerger
6a688ca1ad Merge commit '88932754ffdcbffb3cb43e03991e5eb598c10458' into nyc-mr1-dev-plus-aosp
* commit '88932754ffdcbffb3cb43e03991e5eb598c10458':
  Captive portals: login activity probes like NetworkMonitor
  Logging improvements in CaptivePortalLoginActivity
  Captive portal systel log improvements
  Fix flaky IpPrefixTest.
  Removing bogus file added by mistake
  frameworks-test: adding missing @SmallTest
  Netd events: record connect() success/errno
  Add missing dependency.
  Show notification for always-on app VPN
2017-01-27 06:39:52 +00:00
The Android Automerger
7bc2aebd53 Merge commit '48a1136c8b3000c651e8bcd86325acd1dce6e4ec' into nyc-mr1-dev-plus-aosp
* commit '48a1136c8b3000c651e8bcd86325acd1dce6e4ec':
  Implement metered tracking for NetworkStats summary queries.
2017-01-27 06:39:41 +00:00
The Android Automerger
53095bb5bd Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp
* commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1': (35 commits)
  NetworkMonitor: send one DNS probe per web probe
  NetworkMonitor metrics: add first validation information
  APF: also drop any ICMPv6 RSs
  ConnectivityServiceTest: fix testAvoidBadWifiSettings
  Fix ConnectivityServiceTest testRequestBenchmark
  Switch over to new "time.android.com" NTP pool.
  Define API for metering network stats buckets.
  Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  Use @Ignore to explicitly disable a @Test method.
  Fixed NetworkStatsServiceTest and converted it to JUnit4.
  VPN network stat accounting changes.
  ConnectivityThread: use lazy holder idiom
  ConnectivityManager: use ConnectivityThread looper
  ConnectivityManager: a simpler CallbackHandler
  Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  Add a null check for the OnStartTetheringCallback.
  TokenBucket for rate-limiting and throttling
  IpConnectivityMetrics reads buffer size in settings
  CaptivePortalLogin: set mixed content policy to compatibility.
  Add IP conn metrics to dumpsys and bug reports
  ...
2017-01-27 06:39:05 +00:00
Hugo Benichi
3daf708e3c Fix flaky IpPrefixTest.
Test: IpPrefixTest passes
Bug: 32561414

(cherry picked from commit 32c687040301cb3601fd110281a742159a963aa9)

Change-Id: I42928da87f7f336900b3a95ebbf28563864da8d4
2017-01-26 18:52:51 +09:00
Stephen Chen
48a1136c8b Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 25147878974f82f875062e99cdee85dd33f3f078)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a
2017-01-26 18:52:32 +09:00
Jeremy Joslin
fe1ce2f90c VPN network stat accounting changes.
Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871

(cherry picked from commit 8b436d865c9f287e9ae491e5278cd8874f4a865b)

Change-Id: I06f01aa8fe5fdc06b2d36cfb9c68feb244c2e5de
2017-01-26 18:51:53 +09:00
Hugo Benichi
4bee7e4edb TokenBucket for rate-limiting and throttling
This patch adds a TokenBucket class that can accumulate and distribute
tokens over time.

Test: comes with unit tests.
Bug: 32198637

(cherry picked from commit 998493f0ee39ae0e9ffdea27f48f1b11b0807fcb)

Change-Id: I4012ae6d02f7004bceee9a2ba03914f2a2506031
2017-01-26 18:51:33 +09:00
Lorenzo Colitti
c869089383 Move FakeSettingsProvider to a common location.
(cherry picked from commit 7df1a82802cdf842d07a86a80383c7d5ea7ae53a)

Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I8d4d4de2937012dd33924f53e68f96241a9b2b4f
2017-01-26 18:50:48 +09:00
Adrian Roos
c0f4f0a1dc MessagingStyle: Fix buggy measure in MessagingLinearLayout
am: 4749930c37

Change-Id: Id664ebb3c07271ff5282daedd29c7f38e79c8776
2017-01-25 00:30:35 +00:00
Adrian Roos
4749930c37 MessagingStyle: Fix buggy measure in MessagingLinearLayout
Fixes a bug in MessagingLinearLayout where we would not
recompute the height of it after applying the computed
insets to the text views, leading to incorrect padding
and in rare cases a cut off message at the bottom.

Change-Id: If87a527555158e94e501832e9f49e380cc7da2bb
Test: runtest -x core/tests/coretests/src/com/android/internal/widget/MessagingLinearLayoutTest.java
Fixes: 31463075
(cherry picked from commit 4ac8f40d96196a2a36d7bda7d92eee9bbd4ee7e7)
2017-01-24 20:00:52 +00:00
Amin Shaikh
746a4de692 Merge "Add additional fields to RecommendationRequest." am: b8f0e69ef0 am: ac05acad45
am: b7b9c6f889

Change-Id: Ieade1643bfc4c9039d6d4f702bf3ec527679ce74
2017-01-20 23:30:39 +00:00
Amin Shaikh
b7b9c6f889 Merge "Add additional fields to RecommendationRequest." am: b8f0e69ef0
am: ac05acad45

Change-Id: I1062446bbd085b794bfe61843e670dc5af689d32
2017-01-20 23:23:39 +00:00
Amin Shaikh
ac05acad45 Merge "Add additional fields to RecommendationRequest."
am: b8f0e69ef0

Change-Id: I9a50c8aca36cf740abbc62af6879b4e6ea736855
2017-01-20 23:18:02 +00:00
Amin Shaikh
b50ade8bb0 Add additional fields to RecommendationRequest.
- Add networkId and timestamp for the last user selected network

Bug: 34467596
Test: runtest --path core/tests/coretests/src/android/net/RecommendationRequestTest.java
Change-Id: Ic81c1beede1a643cd428b6e5c57ed430a6b1ccc0
Merged-In: Ic81c1beede1a643cd428b6e5c57ed430a6b1ccc0
2017-01-20 09:37:59 -08:00
Jeremy Joslin
261b5c4c49 Merge "Pass more data through the recommendation request." am: 00514f1dc0 am: ddfbe07e96
am: ec630d0bf0

Change-Id: I20ce25072262a7aef36b9fdaa317210283ca495f
2017-01-20 02:07:53 +00:00
Jeremy Joslin
ec630d0bf0 Merge "Pass more data through the recommendation request." am: 00514f1dc0
am: ddfbe07e96

Change-Id: Ib831f420dd6ca976f9ce72476028b18ea61e2211
2017-01-20 02:02:03 +00:00
Jeremy Joslin
ddfbe07e96 Merge "Pass more data through the recommendation request."
am: 00514f1dc0

Change-Id: I97e11e876bcb7ccdb55a333b31f9970ae5edd001
2017-01-20 01:52:38 +00:00
Jeremy Joslin
122957b0b0 Pass more data through the recommendation request.
Expanding the API so it can accept the WiFi config of the currently
connected network (if any) and the set of connectable WiFi
configurations. Also renamed currentRecommendedWifiConfig to
defaultWifiConfig so the name was more representative of the
parameter's purpose and added more documentation throughout.

Test: adb shell am instrument -e class android.net.RecommendationRequestTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w com.android.networkrecommendation.tests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34387385
Change-Id: Ib8c3cab8f92b5c9da806070d32412f688690f82f
Merged-In: I1089b70303b0396def7e6bf3737fdc67e40c9dcd
2017-01-19 16:14:21 -08:00
Paul Duffin
43267b4b9e Merge "Prepare for removal of legacy-test from default targets" am: c74ccf1588 am: ab62fd67d8
am: 56a2ae1056

Change-Id: I0ede6895eb25f72a74af3ac4431a21960500bec5
2017-01-19 11:49:28 +00:00
Paul Duffin
56a2ae1056 Merge "Prepare for removal of legacy-test from default targets" am: c74ccf1588
am: ab62fd67d8

Change-Id: I923de1762a15fca7dc255f9dfe0ecce6f54d333c
2017-01-19 11:44:56 +00:00
Paul Duffin
ab62fd67d8 Merge "Prepare for removal of legacy-test from default targets"
am: c74ccf1588

Change-Id: Id4876a2597171ac78062acf8194fce1af6d50b77
2017-01-19 11:40:22 +00:00