1269 Commits

Author SHA1 Message Date
Ying Wang
b643624d2f New trick to install bad dex file.
Previously we use LOCAL_JAVA_RESOURCE_FILES to override the normally
generated classes.dex with a bad dex file.
Now as we have moved Java resource processing before running jarjar, dx
would fail for the bad classes.dex inside the classes.jar.
Instead we override the target specific variable PRIVATE_DEX_FILE to
inject the bad dex file.

(cherry-picked from commit f122d90c290c789e0d0085127beebdcf1935c127)

Bug: 18837479
Change-Id: I73f82c8a15e1d8935d9c2f290ba9456184a56ec7
2015-01-20 12:15:17 -08:00
Neil Fuller
60cf05c1b3 Removing HttpResponseCacheTest
Moving HttpResponseCacheTest.java from
frameworks/base/core/tests/coretests/src/android/net/http
to
cts/tests/tests/net/src/android/net/http/cts

Change-Id: I61a07c53f8d0ef55d35b928f244e4680725b76ef
2015-01-15 16:00:42 +00:00
Neil Fuller
62d0677b0f Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade.
OkHttp recently changed the behavior of their caching with
commit e74e3f3bf744ef7f4d8ee724a7cf2347e486cfab - it is now
neccessary to close the inputstream (or disconnect the
HttpURLConnection) for a response to be cached.

This change is (effectively) a no-op prior to the upgrade.

The behavior is undefined as to whether closing the
input stream is required for caching. OkHttp's new behavior
is consistent with other HttpURLConnection implementations
tried.

Change-Id: Iaf57371651296ac84850971ef60a9338cead57c0
2015-01-09 11:50:50 +00:00
Elliott Hughes
988fd73499 Remove a bitrotted test.
Change-Id: I4c44f2da0544dbfde8e340f7f477191725c5fb8b
2014-12-17 16:29:04 -08:00
Yohann Roussel
6829daa44a Merge "Add tests about annotations and enum." 2014-12-01 09:30:59 +00:00
Conley Owens
69d28437d3 Merge "RRO tests: fix potential NPE" 2014-11-26 17:57:09 +00:00
Conley Owens
ed23786cc5 Merge "RRO tests: adapt tests to split apks" 2014-11-26 17:56:48 +00:00
Yohann Roussel
79b4ee8e97 Add tests about annotations and enum.
For reproduction of https://code.google.com/p/android/issues/detail?id=78144

Bug: 18385117

Change-Id: I23be53a0ae481a501d13adc8abf518ac664a772f
2014-11-20 15:17:43 +01:00
Mårten Kongstad
840796a3c2 RRO tests: fix potential NPE
Bug: 17765434

Check for null before closing streams.

Change-Id: I651785649575725009f270d4d8eb5f4bf90952a6
2014-11-07 16:07:21 +01:00
Mårten Kongstad
97b5df7643 RRO tests: adapt tests to split apks
The introduction of support for split apks has resulted in the move of
applications from /partition/app/pkg.apk to /partition/app/pkg/pkg.apk.
Update the RRO testrunner to use the new paths.

Bug: 17765434
Change-Id: I6eebfb6f879404077b9447c750ddc395ecd9a547
2014-11-07 16:06:18 +01:00
Mattias Petersson
fc2bd335d1 Fix for CharSequenceCreator test case
The test case testCharSequenceCreator() in TextUtilsTest fails
because the data position is not reset before calling
createFromParcel().

Change-Id: I6d5cc093ff65019ab0d2191bb0bd9c10ae49612b
2014-11-07 12:27:28 +00:00
Neil Fuller
38b63f0ede am dfcf0655: am 09fd5a18: Merge "Replacing FloatMath native implementation with calls to Math"
* commit 'dfcf065505a12aa358af5cd2607fd355eee964c4':
  Replacing FloatMath native implementation with calls to Math
2014-10-20 10:16:08 +00:00
Nick Kralevich
7b3db39aa4 Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: If07fcbd78543d13bc6d75f9743f999860e8d58d7
2014-10-20 09:24:11 +01:00
Elliott Hughes
5fc9f9c293 am 84e6d466: am 4cd671e4: Merge "Revert "Replacing FloatMath native implementation with calls to Math""
* commit '84e6d466edc2aba711f90431a1cd209d11c0e70d':
  Revert "Replacing FloatMath native implementation with calls to Math"
2014-10-18 20:53:38 +00:00
Elliott Hughes
b3b68d0333 Revert "Replacing FloatMath native implementation with calls to Math"
This reverts commit 32b88b48daa7383880088246d7222dd93cf55285.

Change-Id: I40ea17f3a68f2b53eb013aebd3ba1becdc724f94
2014-10-18 20:41:27 +00:00
Neil Fuller
4ef9403577 am 8a3785ca: am fd2d41b7: Merge "Replacing FloatMath native implementation with calls to Math"
* commit '8a3785cafec4b47fe8d61614b04a0e193d616428':
  Replacing FloatMath native implementation with calls to Math
2014-10-16 09:32:33 +00:00
Eric Rowe
500f7583ed Add CHANGE_NETWORK_STATE permission to bt tests
Change-Id: Ie0a579de3b7d1163a8fe245eb377f21eeed048a3
2014-10-15 14:06:30 -07:00
Neil Fuller
32b88b48da Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I8d1947d88b3c576643138b1df589fb9da7c1ab88
2014-10-15 11:47:58 +01:00
Dianne Hackborn
2d7576b082 Fix issue #17752399: Multiple apps broken by GET_TASKS permission change
Keep around GET_TASKS as a permission available to apps, so apps still
think they have it and don't get all uppity because they don't.

Add a new REAL_GET_TASKS that is the actual permission now.

Plus some temporary compatibility code until everyone can transition
fromn GET_TASKS to REAL_GET_TASKS.

Change-Id: I12c1102eed24844685dcbd2fa3b612811603958f
2014-10-03 16:26:04 -07:00
Jeff Sharkey
7a8f1a32dc NetworkStats always needs arrays.
Internal logic relies on Arrays.copyOf(), so always give ourselves
valid arrays, using shared empty objects to save overhead.

Bug: 17502649
Change-Id: I5dbb00545bdfe45bbd48144ab505ea08cc92cbcd
2014-09-17 09:26:31 -07:00
Yohei Yukawa
84f20ec49d Merge "Minimize the number of default enabled IMEs part 3" into lmp-dev 2014-09-16 00:19:55 +00:00
Yohei Yukawa
dc489241cf Minimize the number of default enabled IMEs part 3
With this CL, the behavior of getDefaultEnabledImes() changes
as follows:

- Previously system IMEs are always enabled by default as long
  as it is a software keyboard that supports En_* subtype. With
  this CL, getDefaultEnabledImes() relies on the locale returned
  from getFallbackLocaleForDefaultIme() instead of calling
  isSystemImeThatHasEnglishKeyboardSubtype() to minimize the
  number of enabled IMEs.
- Previously default enabled system IMEs are chosen in a
  country-agnostic way. As a result, "en_IN" is enabled even
  when the system locale is "en_US". With this CL, the system
  first tries to find IMEs with taking the coutnry into account,
  and use the country-agnostic way when and only when fallback
  logic is required.

BUG: 17347871
Change-Id: I6571d464a46453934f0a8f5e79018a67a9a3c845
2014-09-15 13:13:45 +09:00
Guang Zhu
ac60bea01f Merge "temporarily enable wifi verbose logging in download manager test" into lmp-dev 2014-09-14 22:35:30 +00:00
Guang Zhu
da7638db2e temporarily enable wifi verbose logging in download manager test
also temporarily compile against platfrom, not SDK, since we are
using private API

Bug: 17446070
Change-Id: I6da18aca2d5eaf305940514186ef2434e52f15b9
2014-09-14 15:33:49 -07:00
Yohei Yukawa
68c860bb29 Minimize the number of default enabled IMEs part 2
Previously the system tried to enable at least one auxiliary IME
even when the system is not ready.  However, this doesn't make
much sense because the user should be able to set up their phone
without auxiliary IMEs. Also, IMEs enabled before the system
becomes ready are kept to be enabled after the system becomes
ready. Thus, we should minimize the number of enabled IMEs
until the system becomes ready.

BUG: 17347871
Change-Id: Ife93d909fb8a24471c425c903e2b7048826e17a3
2014-09-14 13:47:33 +09:00
Yohei Yukawa
59cccf93d2 Enrich test cases when enabling default IMEs part 4
This is another groundwork for subsequent fixes.

Notable changes in test cases are:
- simplified test cases for voice IMEs.
- added more test cases for keyboard IMEs.
- introduced assertDefaultEnabledImes() to reduce code duplicate.

BUG: 17347871
Change-Id: I8cf61cfa18ac425a2cccc7823474c3f06dc0fa1e
2014-09-13 00:29:49 +09:00
Eric Rowe
a8e4c740a8 Merge "Fix wifi association tests" into lmp-dev 2014-09-11 21:23:01 +00:00
Eric Rowe
485ceb8506 Fix wifi association tests
Before fix, test assumed that it was already connected to wifi so remove
these assertions.  Also, since association test may be used against
access points with no outside connectivity, remove the ping test to
8.8.8.8 at the end.

Change-Id: I3d4f3d752b72028f642da9f8e9adda4ad18a6a56
2014-09-11 14:14:25 -07:00
Yohei Yukawa
d77adfe52d Enrich test cases when enabling default IMEs part 3
This is another groundwork for subsequent fixes.

Notable changes in test cases are:
- A dummy Hinglish IME ("en_US" + "hi") is added
- Added test cases where system locale is "en_GB",
  "en_IN", and "hi" as well as "en_US".

BUG: 17347871
Change-Id: Iacf0f47c4dbc147f8153df50ba58fc4da4dacd29
2014-09-12 00:07:41 +09:00
Yohei Yukawa
bca817b2e2 Enrich test cases when enabling default IMEs part 2
This is another groundwork for subsequent fixes.

Notable changes in test cases are:
- isSystemReady == false is now coverted.
- tests can run even when the system locale of test
  environment is different from "en_US"

BUG: 17347871

Change-Id: I9434270735d3b37d8b788d41250b23d7950aaeed
2014-09-11 23:44:43 +09:00
Yohei Yukawa
cfcbddaff2 Enrich test cases when enabling default IMEs
This is another groundwork for subsequent fixes.

Notable changes in test cases are:
- isAsciiCapable is now annotated accordingly.
- "dummy.keyboard0" now has several subtypes like
  "en_GB", "en_IN", "hi", "hi_ZZ" like the AOSP
  LatinIME.

BUG: 17347871
Change-Id: Ide698ed11c2539ba5862e6b37ea63ed19f8ce566
2014-09-11 11:15:18 +09:00
Yohei Yukawa
f8eef09622 Merge "Use public APIs to instantiate InputMethodSubtype" into lmp-dev 2014-09-10 08:29:31 +00:00
Yohei Yukawa
443c2bafd8 Use public APIs to instantiate InputMethodSubtype
This is a groundwork for subsequent CLs that are
supposed to improve default input method selection
logics.

Historically we have had a @hide constructor of
InputMethodSubtype. However, this contructor is
a bit obsolete because we can not specify some
parameters that were added in recent platform
releases. We should use InputMethodSubtypeBuilder
instead.

BUG: 17347871
Change-Id: I72ad79682a58344e14380eb20e26edf98aee37cd
2014-09-10 15:42:14 +09:00
Eric Rowe
5fea53d085 Merge "Allow protected wifi in connectivity tests" into lmp-dev 2014-09-10 02:43:23 +00:00
Eric Rowe
86e15557c5 Allow protected wifi in connectivity tests
Change-Id: I31285572f90bfb46cc28fb04e79cb9b407477a7d
2014-09-09 19:25:55 -07:00
Guang Zhu
30478148bd add some assert messages to download manager test
Change-Id: If2e1bdd115eddeeb7bdebf0fab29a3756fee4ceb
2014-09-09 14:44:17 -07:00
Yohei Yukawa
699a49b9f1 Follow up API signature changes of CursorAnchorInfo part 2
This is another follow up CL for Ic8c6fab58c01206872a34e7e.

Ib2371849d32bb44da9ef59f05e648a476e03699a didn't cover
following renamings.  This CL fixes them.

- #getCharacterRect -> #getCharacterBounds
- #getCharacterRectFlags -> #getCharacterBoundsFlags

BUG: 17365414
Change-Id: I120795da3f25f1e2fa71f455f92e3cd1c036c1d5
2014-09-09 14:33:07 +09:00
Yohei Yukawa
a41c4bcc3d Follow up API signature changes of CursorAnchorInfo
This is a follow up CL for Ia8cbb9f6b41cd9509fc0147fd68763dfde
and Ic8c6fab58c01206872a34e7ee604cdda1581364d.

BUG: 17365414
BUG: 17200900
Change-Id: Ib2371849d32bb44da9ef59f05e648a476e03699a
2014-09-08 18:00:15 +09:00
Eric Rowe
f5031e5494 Increase long timeout to 2 minutes
Change-Id: I2f9e15c6e551536d61ec52fbaf7f54405fa05bcd
2014-09-05 16:59:51 -07:00
Eric Rowe
2591e00b57 Clean up connectivity tests.
Change-Id: I407cb78aecb43aa8413835a25b4558241d69fd2e
2014-09-03 15:49:16 -07:00
Jeff Sharkey
37cf9907d2 Merge "Installing splits into ASECs!" into lmp-dev 2014-08-24 18:45:55 +00:00
Jeff Sharkey
941a8ba1a6 Installing splits into ASECs!
Sessions can now zero-copy data directly into pre-allocated ASEC
containers.  Then at commit time, we compute the total size of the
final app, including any inherited APKs and unpacked libraries, and
resize the container in one step.

This supports both brand new ASEC installs and inheriting from
existing ASEC installs.  To keep things simple, it currently requires
copying any inherited ASEC contents, but this could be optimized in
the future.

Expose new vold resize command, and allow read-write mounting of ASEC
containers.  Move native library extraction into the installer flow,
since it needs to happen before ASEC is sealed.  Move multiArch flag
into NativeLibraryHelper, instead of making everyone pass it
around.  Migrate size calculation to shared location.

Separate "other" package name in public API, provide a path to a
storage device when relevant, and add more docs.

Bug: 16514385
Change-Id: I06c6ce588d312ee7e64cce02733895d640b88456
2014-08-22 16:25:04 -07:00
Guang Zhu
12747ab3aa add some missing assert messages for wifi test
Change-Id: I04f4cbbca1a181ab1404fa3abba874e1f78fed3c
2014-08-22 15:08:36 -07:00
Guang Zhu
4afd179a9a follow up minor fixes for connectivity manager test
Change-Id: I8f0606890b21d67130efb3bc02c6825823060139
2014-08-20 17:40:18 -07:00
Guang Zhu
d21f1c1e4d fixes for connectivity manager test suite
* reduced visibility of most util functions in
  ConnectivityManagerTestBase
* reimplemented various waitFor... util function in base class:
  instead of relying on received broadcast and synchronization
  mechanism, we just poll for what we want with a fixed interval
  and a max timeout
* minor style fixes
* removed state transition checks in all test cases of
  ConnectivityManagerMobileTest: since exact state transitions
  are not that interesting, we just care about if we reach a
  particular state and if all network interfaces are in their
  corresponding states
* clarified in comment what each test cases are testing, since
  some of the test case names are not very straightforward
* any wait for DISCONNECTED checkes with ConnectivityManager are
  temporarily commented out

Change-Id: I99cca95c33c6060909e0df684969b75c2dca23a9
2014-08-20 17:15:35 -07:00
Lorenzo Colitti
0a82e80073 Stop using LinkProperties for static configuration.
LinkProperties can represent way more complicated configurations
than what we can actually apply to interfaces. This makes it
error-prone to use it to represent static configuration, both
when trying to apply configuration coming from LinkProperties
and when trying to save configuration from current
LinkProperties.

Instead, move static configuration (IPv4 only, since we don't
support static IPv6 configuration) into a separate
StaticIpConfiguration class.

Bug: 16114392
Bug: 16893413
Change-Id: Ib33f35c004e30b6067bb20235ffa43c247d174df
2014-08-19 11:59:43 -07:00
Lorenzo Colitti
1806b1fc25 Switch RouteInfo to use IpPrefix instead of LinkAddress.
This addresses a TODO and also makes it possible to create
routes to destinations that are not valid LinkAddresses, such as
multicast addresses.

Bug: 16875580
Change-Id: Id4c77b00dc3064bf27d78cdcbbe035e645748cfe
2014-08-13 21:17:20 +09:00
Wei Wang
6bf513d32d Revert "Revert "Service data and manufacturer data can be repeated fields.""
This reverts commit 14c797702543bb5ced989565d90abcfa55c7db46.
2014-08-01 11:12:37 -07:00
Sungsoo Lim
67c01a4b6d Revert "Service data and manufacturer data can be repeated fields."
This reverts commit 26dc9b99b17ca9d8ce3632c48e8b6c1450ee53e9.

Change-Id: I1846d0a6491c5b2ba5905411bd98f5d17909b705
2014-08-01 01:24:14 +00:00
Wei Wang
3f7a39063a Service data and manufacturer data can be repeated fields.
b/16635899

Change-Id: I73f1f4effd3f0e38cd427297eb9d22f3ba285d61
2014-07-31 15:43:05 -07:00