1353 Commits

Author SHA1 Message Date
Wenchao Tong
21377c3af8 NetworkStats to support VPN accounting.
Create a new method to migrate underlying network traffic
from VPN app to other apps.

Bug: 19536273
Change-Id: I3434cad361592e26b01225edf8012f7b16afc98f
2015-03-09 11:38:10 -07:00
Yohei Yukawa
f487e0e395 Normalize deprecated 2-letter language code when necessary.
This is a follow up CL for I7d932e60311b80c05be8f02c9e803f18da0e0054,
which revealed that we could not use deprecated 2-letter code like "in"
to query subtype which has new language codes like "id".

This CL addresses the above issue by normalizing the language code
with Locale#Locale(String, String) before comparing one to another.

Change-Id: I26e3aa0333aa3c76c80a3c1c9090cc2b368c8e10
2015-02-21 02:26:40 +09:00
Yohei Yukawa
e72d1c8274 Add tests for Ibb9eb9f65323795d139 and I6571d464a46453934f0
This CL adds several unit tests for following CLs, both of which enabled
InputMethodUtils (and dependent IMF logic) to handle 3 letter language codes
and conversion from deprecated two-letter codes to new ones correctly.
- Ibb9eb9f65323795d139b16d76b7e7e36a4e0568c
- I6571d464a46453934f0a8f5e79018a67a9a3c845

As described in tests, the input method framework has already been able to
recognize 3 letter language codes.  However, there remain inconsistencies
when we use deprecated 2-letter code to query subtype like "in" but the
subtype has new language codes like "id".  Subsequent CLs are supposed to
address remaining issues.

bug: 10090157
Change-Id: I7d932e60311b80c05be8f02c9e803f18da0e0054
2015-02-20 23:41:36 +09:00
Fyodor Kupolov
bc26d2eafd Merge "RegisteredServicesCache now saves files to a user-specific dir" 2015-02-13 17:05:11 +00:00
Narayan Kamath
f129af204c Merge "Move apache specific portions of android.net.http to external/apache-http." 2015-02-13 09:51:44 +00:00
Fyodor Kupolov
259e761532 RegisteredServicesCache now saves files to a user-specific dir
Previously, its state was saved in a single xml file inside
/data/system/registered_services.

Services are now stored in separate files stored in a user-specific dir. A
one-off migration step was added, which runs, when the system discovers a
file in the old format.

Bug:19321135
Change-Id: Ie92be01047f4855d01352b6a304820b37344ae2c
2015-02-12 17:34:03 -08:00
Narayan Kamath
3bdd327f85 Move apache specific portions of android.net.http to external/apache-http.
We continue to compile external/apache-http into ext.jar. This contains
a few changes apart fom the classes moving around :

- Makefile changes to build docs and api-stubs for now. A future change
  will revert these changes and remove these classes from stubs and
  docs.
- Hardcode event IDs in legacyerrorstrings to avoid a dependency between
  the frameworks and apache. These strings are on their way out and will
  never change anyway.
- Remove imports due to {@link} tags and use {@code} instead.
- Remove an accidental(?) dependency on apache commons code that's a
  part of apache-http.

bug: 18027885

Change-Id: I51cd038d846ec7d02c283a4541b10a6a9cf62ecf
2015-02-12 11:15:49 +00:00
Alex Klyubin
05ecfd308d am 33d3c53d: resolved conflicts for merge of 517e0274 to lmp-mr1-dev-plus-aosp
* commit '33d3c53da021f0d044028860ace0f4ad817273f5':
  Move hidden ApplicationInfo flags into a separate field.
2015-02-11 20:47:31 +00:00
Alex Klyubin
33d3c53da0 resolved conflicts for merge of 517e0274 to lmp-mr1-dev-plus-aosp
Change-Id: Ic20b6c8851458483dd73a144bd5ae6e8d141e62a
2015-02-11 12:37:12 -08:00
Alex Klyubin
b9f8a5204a Move hidden ApplicationInfo flags into a separate field.
The public API field android.content.pm.ApplicationInfo.flags can
support only 32 flags. This limit has been reached. As a short term
workaround to enable new public flags to be added, this CL moves flags
which are not public API into a separate new field privateFlags and
renames the affected flags constants accordingly (e.g., FLAG_PRIVILEGED
is now PRIVATE_FLAG_PRIVILEGED).

The new privateFlags field is not public API and should not be used
for flags that are public API.

The flags that are moved out of ApplicationInfo.flags are:
* FLAG_HIDDEN,
* FLAG_CANT_SAVE_STATE,
* FLAG_FORWARD_LOCK, and
* FLAG_PRIVILEGED.

NOTE: This changes the format of packages.xml. Prior to this CL flags
were stored in the "flags" attribute. With this CL, the public flags
are stored in a new "publicFlags" attribute and private flags are
stored in a new "privateFlags" attribute. The old "flags" attribute
is interpreted by using the old values of hidden/private flags.

Change-Id: Ie23eb8ddd5129de3c6e008c5261b639e22182ee5
2015-02-11 11:06:40 -08:00
Fyodor Kupolov
9e0d81e843 Added unit test for RegisteredServicesCache
Minor refactoring of RegisteredServicesCache for testability. Added
RegisteredServicesCacheTest which uses a mock version of
RegisteredServicesCache.

Bug:19321135
Change-Id: If18b794b28f03b4bf4bbdfbba9e9a57e808aaebf
2015-02-10 14:05:12 -08:00
Yohann Roussel
de873a64c8 Merge "Adapt to change of LOCAL_USE_JACK values" 2015-02-05 11:01:36 +00:00
Yohann Roussel
f50a51fb4c Adapt to change of LOCAL_USE_JACK values
Also remove depency to the dx main dex list when building with
Jack.

Change-Id: I13e45dc8406a6a71309d151bf1542b1296c17792
2015-02-05 10:11:34 +01:00
Lorenzo Colitti
0aa7a1ca8e am b43e74bb: am 12b26c12: am 21702263: Merge "Add a unit test for StaticIpConfiguration."
* commit 'b43e74bbce46f2f328e2031a7ae3447f415ef9ca':
  Add a unit test for StaticIpConfiguration.
2015-02-05 02:41:31 +00:00
Lorenzo Colitti
b43e74bbce am 12b26c12: am 21702263: Merge "Add a unit test for StaticIpConfiguration."
* commit '12b26c12483633f7a75d1f1c9ead73eaf6056811':
  Add a unit test for StaticIpConfiguration.
2015-02-05 02:31:40 +00:00
Lorenzo Colitti
83faf72f84 Add a unit test for StaticIpConfiguration.
Change-Id: I68c735def8a242da0c8f95b7c5ea680ed902dab7
2015-02-04 17:28:35 +09:00
Jon Larimer
0f2d0dbac6 am 3a6d8f54: am 90d5bd8d: am feb362a5: am a0d3bfbe: am 5c9d0de1: am 545dd853: am 9a425aa7: am 159aa735: am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
automerge: ff526fa

* commit 'ff526fa7106fd45bfc4f1606fe051000c5201920':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 22:41:30 +00:00
Jon Larimer
ff526fa710 am 3a6d8f54: am 90d5bd8d: am feb362a5: am a0d3bfbe: am 5c9d0de1: am 545dd853: am 9a425aa7: am 159aa735: am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
* commit '3a6d8f5473f2451a0bdf13d4cc1d31e419d23f0c':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 22:40:17 +00:00
Jon Larimer
90d5bd8daa am feb362a5: am a0d3bfbe: am 5c9d0de1: am 545dd853: am 9a425aa7: am 159aa735: am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
* commit 'feb362a5d194b30226caf2efbaae77991007c65c':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 22:24:43 +00:00
Jon Larimer
a0d3bfbe87 am 5c9d0de1: am 545dd853: am 9a425aa7: am 159aa735: am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
* commit '5c9d0de174caf151937f19aa6898f60bce3fb4f4':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 22:11:56 +00:00
Jon Larimer
5c9d0de174 am 545dd853: am 9a425aa7: am 159aa735: am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
* commit '545dd853bffbf778a0a44816ac6ed381b13f2158':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 22:01:50 +00:00
Jon Larimer
9a425aa71c am 159aa735: am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
* commit '159aa73574804967aded45d06b70df5a8dd64a58':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 21:44:17 +00:00
Jon Larimer
159aa73574 am d4031809: am 48c95c43: Fix build breakage in older branches by avoiding <> notation
* commit 'd403180997898c98f0be15b810c4c9dd9002f92c':
  Fix build breakage in older branches by avoiding <> notation
2015-01-30 21:28:59 +00:00
Jon Larimer
48c95c4370 Fix build breakage in older branches by avoiding <> notation
Change-Id: I5e3d523dac1f364f52f0d2cab479c1705d667e5a
2015-01-29 15:54:43 -05:00
Jon Larimer
9570e144fe am ea63fd7f: am 88add689: am a5ccca24: am 2982d648: am de9a76ed: am fc731e6e: Merge "Fix ParceledListSlice to enforce the same concrete types among its elements." into jb-mr2-dev
* commit 'ea63fd7f9b4bb2701c9d12ab8775867dbdeefcf1':
  Fix ParceledListSlice to enforce the same concrete types among its elements.
2015-01-29 18:43:47 +00:00
Jon Larimer
ea63fd7f9b am 88add689: am a5ccca24: am 2982d648: am de9a76ed: am fc731e6e: Merge "Fix ParceledListSlice to enforce the same concrete types among its elements." into jb-mr2-dev
* commit '88add68942694fc643518bcf5c26f6c3df7e9aa0':
  Fix ParceledListSlice to enforce the same concrete types among its elements.
2015-01-29 18:36:59 +00:00
Jon Larimer
a5ccca2427 am 2982d648: am de9a76ed: am fc731e6e: Merge "Fix ParceledListSlice to enforce the same concrete types among its elements." into jb-mr2-dev
* commit '2982d64802ed0d5b59130680c43485e9d7862e50':
  Fix ParceledListSlice to enforce the same concrete types among its elements.
2015-01-29 18:25:28 +00:00
Jon Larimer
2982d64802 am de9a76ed: am fc731e6e: Merge "Fix ParceledListSlice to enforce the same concrete types among its elements." into jb-mr2-dev
* commit 'de9a76ed997c300a6c5f2f82c517719503af9045':
  Fix ParceledListSlice to enforce the same concrete types among its elements.
2015-01-29 18:12:01 +00:00
Adam Lesinski
f741c37273 Fix ParceledListSlice to enforce the same concrete types among its elements.
Bug:17671747
Change-Id: I896f75738e5b464ccb6c03290f139cc2fa72f966
(cherry picked from commit 3df1c38ee098872352086e03d6f1adb16796ee29)
2015-01-28 10:47:54 +00:00
Jorim Jaggi
cb4f594eca Remove dead code #11: Remove more unused classes
Change-Id: Ie78d40fd20eef859e3c0ea9269b86ff1e1471a58
2015-01-27 18:15:50 +01:00
Jorim Jaggi
de47e3554d Revert "Remove dead code #11: Remove more unused classes"
This reverts commit 397ca8be8de407237cd293873647c182837bc032.

Change-Id: Id7f8dbe93d2a48a7f6261232499f73b7de8dd7b1
Reason: Build breakage.
2015-01-27 16:52:24 +00:00
Jorim Jaggi
397ca8be8d Remove dead code #11: Remove more unused classes
Change-Id: I3130991cb468a47aa0e198e42f20edca0836f66b
2015-01-21 16:57:12 +01:00
Ying Wang
43df3c6c19 am b5108949: am e4a031e3: Merge "New trick to install bad dex file."
* commit 'b51089499c8c39fce47deccf70d3ea069c58b471':
  New trick to install bad dex file.
2015-01-20 22:01:26 +00:00
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
Ying Wang
63ae9f3309 Merge "New trick to install bad dex file." 2015-01-20 19:39:43 +00:00
Neil Fuller
d3ef970ca8 am b3f73dc5: am b55011e4: am f9c04f17: Merge "Removing HttpResponseCacheTest"
* commit 'b3f73dc5179532d587f743a9831faff3584c7c5b':
  Removing HttpResponseCacheTest
2015-01-16 10:35:30 +00:00
Neil Fuller
b3f73dc517 am b55011e4: am f9c04f17: Merge "Removing HttpResponseCacheTest"
* commit 'b55011e4265f866604ed0c3ffe0241436682c3d2':
  Removing HttpResponseCacheTest
2015-01-16 10:29:51 +00: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
Ying Wang
f122d90c29 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.

Bug: 18837479
Change-Id: I73f82c8a15e1d8935d9c2f290ba9456184a56ec7
2015-01-14 16:22:45 -08:00
Neil Fuller
60b268f039 am f5f345cf: am 837261cc: Merge "Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade."
* commit 'f5f345cf929908bd863143815743c44778d29e4a':
  Fix HttpResponseCacheTest in anticipation of an OkHttp upgrade.
2015-01-12 16:44:36 +00:00
Neil Fuller
b7260cbcc4 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.

(cherry-picked from commit 62d0677b0f6cc5ae48fd0b816ea5caad82264fd6)

Change-Id: Ibe698a443ec98866787ed9da2698322fab856518
2015-01-12 16:05:26 +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
fcc0788419 am 93241de7: Merge "Remove a bitrotted test." automerge: ba6982a
automerge: 9962ed5

* commit '9962ed55759336642cfaba27e8b2a47822f562fe':
  Remove a bitrotted test.
2014-12-18 02:42:27 +00:00
Elliott Hughes
9962ed5575 am 93241de7: Merge "Remove a bitrotted test."
automerge: ba6982a

* commit 'ba6982a16cb3b9f6196fdac11d1d90a02eb32cfd':
  Remove a bitrotted test.
2014-12-18 02:40:10 +00:00
Elliott Hughes
988fd73499 Remove a bitrotted test.
Change-Id: I4c44f2da0544dbfde8e340f7f477191725c5fb8b
2014-12-17 16:29:04 -08:00
Yohann Roussel
e1c00320b6 Merge "Allow compilation with Jack." 2014-12-04 09:26:54 +00:00
Jeff Sharkey
45207128c5 am 05d455ca: am b9ccc047: Merge "Sanitize display names, keep extensions intact." into lmp-mr1-dev
* commit '05d455ca2b83793a81aac2544c388eec8ac140cd':
  Sanitize display names, keep extensions intact.
2014-12-01 20:00:32 +00:00
Jeff Sharkey
0cce5355b4 Sanitize display names, keep extensions intact.
When creating or renaming files on external storage, sanitize the
requested display names to be valid FAT filenames.  This also fixes
a handful of directory traversal bugs.

Also relax logic around generating display names to allow any
extension which maps to the requested MIME type.  Tests to verify.

Bug: 18512473, 18504132
Change-Id: I89e632019ee145f53d9d9d2050932f8939a756af
2014-12-01 09:38:49 -08:00
Yohann Roussel
8596021c3b am 3e5223fd: am 6829daa4: Merge "Add tests about annotations and enum."
* commit '3e5223fd02d0f096ca50c964378c717adbb2e3e9':
  Add tests about annotations and enum.
2014-12-01 10:12:09 +00:00
Yohann Roussel
6829daa44a Merge "Add tests about annotations and enum." 2014-12-01 09:30:59 +00:00