1040 Commits

Author SHA1 Message Date
Maxim Siniavine
ca76692417 Fix BandwidthTest to report correct stats.
The test used to report report stats for a random uid. Fixed it to report
stats for the Instrumentation uid or download manager uid, depending on the test.

Change-Id: I089162c19e25cbf0dfb05645a9a1018dd7567423
2013-11-06 12:11:07 -08:00
Brett Chabot
305258da75 Add 'no system permission' test app.
Used in PackageManagerOTATests to verify upgraded system apps
are granetd new permissions.

Bug 11271490

Change-Id: Idbc07bc043d06ea15dc41285ecbfb8186a7ecc95
2013-10-22 04:58:50 +00:00
Xia Wang
326f4505e0 Merge "Update the Connectivity Manager test suit to use InstrumentationTestCase." into klp-dev 2013-09-16 21:11:31 +00:00
Xia Wang
19306af73a Update the Connectivity Manager test suit to use InstrumentationTestCase.
- Remove ConnectivityManagerTestActivity as the test activity could be destroyed
  after a system config change, which cause test failure in the wifi stress test.
- Update all tests to use InstrumentationTestCase, which instruments the test package.

Bug : 10426067

Change-Id: Ibf6f1f7cffd7a7eabc4cc63c7e033b59274b724e
2013-09-16 14:07:25 -07:00
Igor Murashkin
e3351f1942 media: Update ImageReader to remove MaxImagesAcquiredException
* acquiring images now throws IllegalStateException instead of
    MaxImagesAcquiredException

Bug: 10691447
Change-Id: I7ce68f990fb96703705b9181012a28633fea0b7a
2013-09-13 23:27:44 -07:00
Igor Murashkin
5e712064df media: Update ImageReader APIs
Bug: 10461757
Change-Id: Ic04e4c41965e3d417b29004f3f08e0cd56b8f4cb
2013-09-12 16:57:57 -07:00
Xia Wang
0076729d38 Use setAirplaneMode() API for Connectivity Manager tests
Change-Id: I2e35c58e4101b6b5fe9efdb5adad922402d38b6f
2013-09-11 14:44:30 -07:00
Jeff Sharkey
af9272349f Merge changes I7b3f4c68,I9f022a08 into klp-dev
* changes:
  Rename offer() to add(), remove/hide some APIs.
  Sort order is sticky for session, back leaves.
2013-09-10 04:40:41 +00:00
Xia Wang
11f2b42d8c Remove system user id for cm tests
Change-Id: I51f500c8e7b4e2963093e20c6f20bcfe020995c9
(cherry picked from commit 575495c29007503566e28004bf60018a824b1f1b)
2013-09-10 01:07:33 +00:00
Jeff Sharkey
b7757a6b32 Rename offer() to add(), remove/hide some APIs.
Change MatrixCursor offer() to add() based on review feedback.  Remove
some now-unused XML metadata.  Hide document creation, since it's not
supported in initial version.

Bug: 10577809, 10461706, 10678563
Change-Id: I7b3f4c6899c28f633471ef816bee22bf032aa0d2
2013-09-09 17:55:10 -07:00
Robert Greenwalt
69df743f74 Fix the build.
Change-Id: Ia5d29de9db7ea8fd467b3bde551a8cfb95877b41
2013-09-06 16:49:37 -07:00
sy.yun
9d9b74a900 Setting MTU size for specific network.
Able to config network specific MTU size. Normally, the default size of MTU is 1500.
 US - ATT 1410, TMUS 1440, SPRINT 1422
 KR - SKT 1440, KT 1450, LGU+ 1428
 JP - KDDI 1420, SoftBank 1340
 CA - RGS 1430, FIDO 1430, MTS 1430, BELL 1358, SaskTel 1358
 AU - TEL 1400

Bug: 10195070
Change-Id: Ie18650b37a3d44af944f2dae4aa97c04fb12cd5e
2013-09-06 15:26:19 -07:00
Lorenzo Colitti
22f407b11e Add a function to replace all the link addresses.
Bug: 10232006
Change-Id: I689ce4735999dac2ab5e1fae09d80b1f734292a1
2013-09-05 13:02:54 +09:00
Kenny Root
580e60fdcd Merge "Use core-tests-support instead of core-tests" into klp-dev 2013-08-30 23:21:27 +00:00
Kenny Root
3603f04ab8 Use core-tests-support instead of core-tests
The core-tests-support library is newly created. It doesn't have any
tests itself but some support for tests that need to use mocked classes
for testing. In this case, some tests are using TestKeyStore for SSL
testing in frameworks tests.

(cherry picked from commit c2d6728350f3ec80f9b4c8967794558e42516987)

Bug: 10092469
Change-Id: Ib38364c607de5a98eb242050eaaf52b22ab8ca57
2013-08-30 16:18:56 -07:00
Jonathan Dixon
ada3dbe7c9 Remove WebViewClassic specific test code
Bug: 10427705

These tested internals of WebViewClassic and will no longer build when
that is removed

Change-Id: I42af538dcb0343e9eff0b3fa85d7ff39f19c7c61
2013-08-25 22:54:21 -07:00
Lorenzo Colitti
4faa027df0 Modify LinkProperties address update methods.
1. Make addLinkAddress a no-op if the address already exists.
2. Make addLinkAddress, addStackedLink and removeStackedLink
   return a boolean indicating whether something changed.
3. Add a removeLinkAddress method (currently there is no way of
   removing an address).
3. Move hasIPv6Address from ConnectivityService to
   LinkProperties, where it belongs.

Bug: 9625448
Bug: 10232006
Change-Id: If641d0198432a7a505e358c059171f25bc9f13d5
2013-08-20 21:16:37 +09:00
Jeff Sharkey
9d0843df7e Resized thumbnails; async; extend MatrixCursor.
When requesting thumbnails, check if their dimensions are larger
than requested, and downscale to avoid memory pressure.  Load them
async and with LruCache.

Extend MatrixCursor so that RowBuilder can offer() columns without
requiring they know the projection map.  This makes it easier to
respond to query() calls, where the remote side controls the
projection map.  Use it to handle custom projections in external
storage backend.

Update date/time formatting to match spec.

Bug: 10333418, 10331689
Change-Id: I7e947a8e8068af8a39b55e6766b3241de4f3fc16
2013-08-17 19:05:07 -07:00
Chet Haase
8aa1ffb0ed pause/resume for Animators
It is now possible to pause Animator-based animations. Pausing an
animator causes it to hold the current time/value indefinitely, or
until end/cancel/resume is called. When resume() is called, it continues
from where it left off.

There is a new listener interface on Animator, AnimatorPauseListener,
which can be used to listen to pause/resume events.

Change-Id: I77d1535e792fb7bf349f549a0ac0a0d85958cb47
2013-08-12 11:51:32 -07:00
Lorenzo Colitti
a50f4b1d05 Merge "Simplify LinkPropertiesTest." 2013-08-08 02:54:29 +00:00
Lorenzo Colitti
3f1e1b2ce4 Simplify LinkPropertiesTest.
Instead of converting IP addresses to strings throughout the
test, do so once at the beginning.

Change-Id: I7f0dae5d2e9e2cdc6ec808e2cf71197ba6ade0a4
2013-08-08 11:03:46 +09:00
Jeff Brown
f724c277d3 Add more virtual display tests.
We can't test everything in CTS because some features require
system permissions.  So this is another copy of the CTS test
with more stuff that we can build with the system cert.

Change-Id: Ied5a456a0810d38d307b6dfbad0f770cb480b4ee
2013-08-07 17:58:47 -07:00
Lorenzo Colitti
d1e0fae2bc Add accessors for all addresses and clarify compare* methods
1. Add a method to return all addresses and all LinkAddresses on
   all links (both base links and stacked links). We already had
   one for routes, but did not yet have any for addresses.
2. Rename compareRoutes to compareAllRoutes, because unlike the
   other compare* methods, it looks at all interfaces. Update
   what appears to be its only caller.
3. Update the documentation of the compare* methods to match
   reality (they don't return lists) and clarify whether they
   look at all links or only the base link.

Change-Id: Ie22e6c7f163d5de8e407248b45171dc28382d2d3
2013-08-01 00:21:24 +09:00
Elliott Hughes
6e7affeb3d am b8292830: resolved conflicts for merge of a920f25f to jb-mr2-dev-plus-aosp
* commit 'b8292830f79fc76ffb9a1be5cd316212ac494d03':
  Switch frameworks/base over from @hidden Charsets to public StandardCharsets.
2013-06-28 16:53:27 -07:00
Elliott Hughes
b8292830f7 resolved conflicts for merge of a920f25f to jb-mr2-dev-plus-aosp
Change-Id: I3349f8d2e6715171e2677c1385122ceb2810c1f6
2013-06-28 16:50:13 -07:00
Elliott Hughes
a920f25fe5 resolved conflicts for merge of fca0f92e to stage-aosp-master
Change-Id: I4791f0ffa324a313b8390fbde6d8f82f716ecf74
2013-06-28 16:41:19 -07:00
Elliott Hughes
d396a448b2 Switch frameworks/base over from @hidden Charsets to public StandardCharsets.
Bug: 3484927
Change-Id: I5d136d2ee629588538602766a182ae14ce5fc63c
2013-06-28 16:24:48 -07:00
Kenny Root
b3933b979d am 67f7d8fb: am 6c042b6d: am a5a2de55: Merge "Add ALPN support to SSL socket factory"
* commit '67f7d8fbd5ad84681fbdfea184ce538c6834896a':
  Add ALPN support to SSL socket factory
2013-06-27 14:57:46 -07:00
Kenny Root
67f7d8fbd5 am 6c042b6d: am a5a2de55: Merge "Add ALPN support to SSL socket factory"
* commit '6c042b6d678edea0f936da994f85ba62f9a1950e':
  Add ALPN support to SSL socket factory
2013-06-27 14:55:41 -07:00
Kenny Root
6c042b6d67 am a5a2de55: Merge "Add ALPN support to SSL socket factory"
* commit 'a5a2de55082b1f2a9ec0b99962a88063ac6d1bbf':
  Add ALPN support to SSL socket factory
2013-06-27 14:52:17 -07:00
Kenny Root
100d729026 Add ALPN support to SSL socket factory
This adds the ability to use Application-Layer Protocol Negotiation
(ALPN) through the SSLCertificateSocketFactory. ALPN is essentially
like Next Protocol Negotiation (NPN) but negotiation is done in the
clear. This allows the use of other protocols on the same port (e.g.,
SPDY instead of HTTP on port 80).

Change-Id: Ie62926b455e252c4c98670bbbecc1eb5c6f13990
2013-06-26 10:35:39 -07:00
Xia Wang
96f94c81b7 am 7ea4e277: am 8fcb169f: am edc3bb66: Disable a flaky test case
* commit '7ea4e277fd7bdb7e2aa230509f57c1af39f5bf4b':
  Disable a flaky test case
2013-06-17 17:53:20 -07:00
Xia Wang
7ea4e277fd am 8fcb169f: am edc3bb66: Disable a flaky test case
* commit '8fcb169f7989123f993adfac5894d1ad5f35ed0b':
  Disable a flaky test case
2013-06-17 17:51:57 -07:00
Xia Wang
edc3bb661e Disable a flaky test case
Change-Id: I4ef780ed0c5394b67aa002baefc00e835018c4a0
2013-06-17 17:14:10 -07:00
Jeff Sharkey
a2934d5ff0 Cache AndroidBlockGuardPolicy to avoid allocation.
Every incoming Binder call ends up triggering a BlockGuardPolicy
update, which would thrash between new AndroidBlockGuardPolicy
instances and BlockGuard.LAX_POLICY, causing GC churn.

This change avoids the extra allocations by recycling a single
AndroidBlockGuardPolicy in a ThreadLocal.  Worst-case thrashing case
is now 10% faster; from 7.46us to 6.65us.

Bug: 9424568
Change-Id: I9c3b1c097a2aecc9b1f109a824cf3ea319fb3393
2013-06-14 16:15:31 -07:00
Xia Wang
af19aef675 am ac561b8b: Merge "Add option to set frequency band" into jb-mr2-dev
* commit 'ac561b8bdd52a6ac5e4f9b92f1033cd385f149d8':
  Add option to set frequency band
2013-06-03 21:26:21 -07:00
Xia Wang
1c6911ac1d Add option to set frequency band
- The reason to add the test runner is to set frequency band when the runner
  is created which happens before the test activity is actually launch.
  As the test activity will disable/enable wifi when it
  is created, this cycle will ensure the frequency is set successfully.

Change-Id: Ie9de3d8bab3dda7d4bb9ba604ddd5cb33164e397
2013-05-31 14:10:12 -07:00
Xia Wang
3cbe3b271c am 4550dba5: Merge "Add wifi association test" into jb-mr2-dev
* commit '4550dba53d49a689de6000e5e5864c28f91dd945':
  Add wifi association test
2013-05-08 15:21:12 -07:00
Xia Wang
58a5db37b3 Add wifi association test
Change-Id: I1f3f49a1857835522c9c5e02ed4f530b83df1d02
2013-05-08 11:27:27 -07:00
Kenny Root
e9ae6822a8 resolved conflicts for merge of 1f6e789b to jb-mr2-dev-plus-aosp
Change-Id: I06c05d637613215b6d83df3e29cd495f6a5a0176
2013-04-29 23:09:03 -07:00
Kenny Root
12e752225a Track change to JSSE provider
Change-Id: I35e824e47ad758ab6408e91e2ba5dcda053a82f5
2013-04-29 15:15:27 -07:00
Maxim Siniavine
5877687b38 Make download manager tests more reliable.
Use larger files in tests. Using small files fails because downloads
complete too quickly. Using files that are too large fails because
downloads take too long.

Change-Id: I0786ece21e0acffa09dd8d85abf70ec4cde5e477
2013-04-09 15:08:43 -07:00
Kenny Root
75827d4a31 Merge "Add direct API to get ManifestDigest" into jb-mr2-dev 2013-04-03 20:27:43 +00:00
Kenny Root
6c918cec31 Add direct API to get ManifestDigest
This makes it faster for applications that don't want to collect all the
certificates but do want the AndroidManifest.xml digest.

Bug: 8528639
Change-Id: Ide9498d0981188960af194a9568387337c075bcc
2013-04-02 14:22:03 -07:00
Lorenzo Colitti
213f98b6fe Fix LinkProperties's equals() method.
LinkProperties's equals() method was broken by the addition of
stacked interfaces. The reason was that equals() was checking
the equality of mStackedInterfaces.keys(), which is just an
enumeration, instead of mStackedInterfaces.keySet(), which
actually contains the keys. The test was failing, but I didn't
notice.

Fix the bug and make the test check the objects more in depth
so it can give more detailed error messages when equals() fails.

Bug: 8276725
Change-Id: Ie990bd75f641c28e63e54d953dcd0f4de13f7c9f
2013-04-02 10:08:59 +09:00
Lorenzo Colitti
cdee9727e2 Merge "Make isHostRoute match only host routes" into jb-mr2-dev 2013-03-27 21:59:10 +00:00
Chiao Cheng
972a9255a7 Merge "Allow leading slash in path argument for addURI() method." into jb-mr2-dev 2013-03-27 17:18:30 +00:00
Lorenzo Colitti
fdadc4e242 Make isHostRoute match only host routes
Currently, isHostRoute returns true iff the gateway address is
the unspecified address (0.0.0.0 or ::). Thus, it will return
true for any route that has no gateway (e.g., a route pointing at
a point-to-point interface), even if the route is not a host
route.

Fix this by checking the prefix length instead. This should be
safe because:

1. mDestination cannot be null, since it's created using new.
2. Host routes created using makeHostRoute (which is what
   ConnectivityService calls) always have the correct prefix
   lengths (/32 or /128) set.

Bug: 8276725
Change-Id: I14285398823fa6c312349128c7cc216cad4a84c9
2013-03-27 19:41:06 +09:00
Jeff Sharkey
8fa9bb5210 Benchmarks for IndentingPrintWriter.
Current timings on a mako listed below, which show minimal overhead
compared to writing directly. The increased code readability and
automatic indenting is worth the overhead.

Also worth noting is that writing concatenated strings is
substantially faster than printing components separately.

           benchmark      us linear runtime
       ComplexDirect 10712.7 =========================
    ComplexIndenting 12623.7 ==============================
       PairIndenting    45.8 =
             PairRaw    82.1 =
        SimpleDirect   282.2 =
     SimpleIndenting   294.4 =

Change-Id: I7c38690c14b017fa46248ebb0be69f6beff03371
2013-03-26 20:16:44 -07:00
Chiao Cheng
ef23bf198d Allow leading slash in path argument for addURI() method.
The original documentation for this class indicated a leading slash was possible
but the code did not support it.  Since then, the docs were changed to reflect
what the code does.

The purpose of this change is to allow the use of uri.getPath() as an argument.
With this change, the following can be done

matcher.addURI(ContactsContract.AUTHORITY,
        ContactsContract.CONTENT_FILTER_URI.getPath(), CONTACTS_FILTER)

instead of

matcher.addURI(ContactsContract.AUTHORITY,
        "contacts/filter", CONTACTS_FILTER)

Change-Id: I76a9e3133365be9fe7a8de86eae57f9eea1cd2a3
2013-03-26 11:20:47 -07:00