1394 Commits

Author SHA1 Message Date
Casper Bonde
3b3d1fea94 SAP: Make it possible to enforce a 16-digit pin code (4/5)
This change enable the posibility to enforce using a
16-digit pin or MITM for a RFCOMM or L2CAP connection.

This is needed for the SIM access profile.

Change-Id: I3205013f9e758c353381442a86845dab467780f8
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
2015-06-09 21:42:22 +00:00
Erik Kline
d895999858 Make public Network#bindSocket(FileDescriptor).
Code that uses android.system.Os to create sockets as FileDescriptors
should be able to bind them to networks.  Note that FileDescriptors
could already be marked as "protected from VPNs" via
NetworkUtils#protectFromVpn(), but heretofore were not easily bound
to any particular network.

Bug: 21449922
Change-Id: I4bb86db5d95d5a55bb2d7e245848d11eaa351e65
2015-06-09 16:19:24 +09:00
Yohei Yukawa
92280cd309 Convert subtypes whose locale is "tl" to "fil".
On Android, "tl" is a historic hack for what should really
be "fil". Now that we properly support 3-letter language codes,
we should be using "fil" throughout. Given this historical usage,
IMEs that really want to support Tagalog (and not Filipino)
should use the ISO-639-3 code for Tagalog, which is "tgl".

For backward compatibility reasons, this CL uses the similar
approach to I26e3aa0333aa3c76c80a3c1c9090cc2b368c8e10.
InputMethodSubtype.getLocale() continues to return the "locale"
string parameter passed to the constructor as is, but in the
Android framework we do normalizations/conversions whenever
we need a valid ISO-639-3 code.

In I26e3aa0333aa3c76c80a3c1c9090cc2b368c8e10, we rely on the
conversion in the Locale constructor.  In this CL, we do replace
"tl" with "fil" by ourselves.

This CL also adds InputMethodSubtype#getLocaleObject() a hidden
API so that we can start relying on the Locale object at least
in the framework.

This CL is based on the investigation by Narayan Kamath and his
patch.

Bug: 20696126
Change-Id: I94f203bddceb9c87710cb187cc3cc0ee6d9092a5
2015-06-02 17:09:50 -07:00
Erik Kline
cd7ed16f00 LinkProperties function to compare provisioning and remove DNS servers
Adds:
    - enum ProvisioningChange
    - LinkProperties#compareProvisioning()
          return a ProvisioningChange value describing the delta in
          provisioning between two LinkProperties objects
    - LinkProperties#removeDnsServer()
    - make "@hide public" isIPv4Provisioned() and isIPv6Provisioned()

Bug: 18581716
Change-Id: I3df90b2b89617f693346f2dbe72e77c88ce91ffd
2015-05-21 20:43:47 +09:00
Erik Kline
cef7bc939f Set NLM_F_ACK in our RTM_NEWNEIGH requests
With NLM_F_ACK set in RTM_NEWNEIGH requests we get some response from
the kernel, whether there was an error or not.

Additionally:

    [1] add IpReachabilityMonitor#probeNeighbor() as a public
        static method, since it actually depends very little on the
        class internals and might be of larger use.

    [2] add a unittest for parsing NetlinkErrorMessages.

Bug: 18581716
Change-Id: I5d62e7a9972c7440f0483c38c77677436d3a1a25
2015-05-20 16:46:30 +09:00
Erik Kline
abd3142dca Close netlink socket when shutting down IpReachabilityMonitor
This forces the NetlinkSocketObserver thread to exit quickly, rather
than lingering until the next random netlink neighbor multicast message
arrives.

Additionally, add a small unittest to verify that multiple calls to
NetlinkSocket#close() are safe.

Change-Id: I101730fad7eee72f9c6e8a7e7bd10c634f2ceab4
2015-05-20 12:08:55 +09:00
Clara Bayarri
e94561ecbc Merge "Fix Cancelling a text action activity deletes the selected text" into mnc-dev 2015-05-19 10:42:20 +00:00
Erik Kline
9ce5d602cd Add IpReachabilityMonitor#probeAll() to begin doing DNAv4/v6-like probing
Note that this change is not sufficient to force probing in all cases,
but does cause probing to occur on Linux if the target node hasn't been
confirmed as reachable in the past 5 seconds (delay_first_probe_time).

Bug: 18581716
Bug: 19866451
Bug: 20944464
Change-Id: I29393897118311b48c966c41e2cddb7a784f136f
2015-05-19 09:04:18 +09:00
Clara Bayarri
5b7665a1f2 Fix Cancelling a text action activity deletes the selected text
The implementation of onActivityResult in TextView did not check the
result code, hence treating the cancelled activity result as a
replacement by empty text.

Also added tests to catch this case and basic usage.

Bug: 21183019
Change-Id: Ibdafe89474dd69c5b70c67ec98fed46656f9fdcf
2015-05-15 16:32:50 +01:00
Clara Bayarri
18cc17a28d PhoneWindow ActionMode handling tests
Tests focusing on action mode creation, how the two types of
modes are handled together and how the lifecycle is handled.

Change-Id: I17fe7a83cba4651b295a8ce80bc449f2f2538048
2015-05-14 16:32:32 +01:00
Clara Bayarri
e094b2aff0 Merge "Tests for WindowDecorActionBar's startActionMode implementation" into mnc-dev 2015-05-14 09:28:46 +00:00
Clara Bayarri
2c7b461077 Tests for WindowDecorActionBar's startActionMode implementation
Change-Id: Ib7a79f3987fd565aabf4c5b093186ec669131522
2015-05-14 10:26:39 +01:00
Clara Bayarri
bff329b851 Merge "Tests for ActionBarContainer's startActionModeForChild" into mnc-dev 2015-05-14 09:25:27 +00:00
Clara Bayarri
e9b17ec0fd Tests for ActionBarContainer's startActionModeForChild
Change-Id: Ida782cb72f26689ec49a6674dcaeee7d2fb196d3
2015-05-14 10:24:41 +01:00
Erik Kline
6193aa3305 Add basic netlink library code.
Add netlink socket helpers and parsing code for basic netlink messages.
Additionally, support from some neighbor discovery -specific messages
is included.

Bug: 18581716
Change-Id: Ib2aa924222b63cdbebf09a8bf8ff35ee24269fc5
2015-05-13 15:18:39 +09:00
George Mount
fa21641122 Merge "Add CallbackRegistry." into mnc-dev 2015-05-07 14:34:58 +00:00
Neil Fuller
d6a2135262 Remove FloatMath methods from the API
Also removing FloatMathTest. The tests are being
moved into a legacy CTS suite.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I397fd6bcc4d988db6301245f9d47460bd6c28821
2015-05-07 13:16:18 +00:00
George Mount
9189445c0a Add CallbackRegistry.
Change-Id: Ib1a30a0ec8b1ece25046d85676432fb0b819f952
2015-05-06 12:18:52 -07:00
Matthew Williams
303650c9cd Add full backup criteria to android manifest
BUG: 20010079
Api change: ApplicationInfo now has a fullBackupContent int
where -1 is (off) 0 is (on) and >0 indicates an xml
resource that should be parsed in order for a developer
to indicate exactly which files they want to include/exclude
from the backup set.
dd: https://docs.google.com/document/d/1dnNctwhWOI-_qtZ7I3iNRtrbShmERj2GFTzwV4xXtOk/edit#heading=h.wcfw1q2pbmae

Change-Id: I90273dc0aef5e9a3230c6b074a45e8f5409ed5ce
2015-05-03 16:19:27 -07:00
Joshua Schwarz
6bb65f0d83 am a4edc82e: am 4547dac0: Fix one-off error in reporting.
* commit 'a4edc82e9b50189b187996e8c4f4e851bdf83893':
  Fix one-off error in reporting.
2015-04-28 21:09:13 +00:00
Joshua Schwarz
a4edc82e9b am 4547dac0: Fix one-off error in reporting.
* commit '4547dac01f3136393cc708bb49ff546413a45d6c':
  Fix one-off error in reporting.
2015-04-28 18:28:18 +00:00
Joshua Schwarz
4547dac01f Fix one-off error in reporting.
Change-Id: I5315e3d13b42285169e6c92cfcf9cf2ae9667018
2015-04-27 18:37:34 -07:00
Jeff Sharkey
620b32b316 Package and storage movement callbacks.
Since package and primary storage movement can take quite awhile,
we want to have SystemUI surface progress and allow the Settings
app to be torn down while the movement proceeds in the background.

Movement requests now return a unique ID that identifies an ongoing
operation, and interested parties can observe ongoing progress and
final status.  Internally, progress and status are overloaded so
the values 0-100 are progress, and any values outside that range
are terminal status.

Add explicit constants for special-cased volume UUIDs, and change
the APIs to accept VolumeInfo to reduce confusion.  Internally the
UUID value "null" means internal storage, and "primary_physical"
means the current primary physical volume.  These values are used
for both package and primary storage movement destinations.

Persist the current primary storage location in MountService
metadata, since it can be moved over time.

Surface disk scanned events with separate volume count so we can
determine when it's partitioned successfully.  Also send broadcast
to support TvSettings launching into adoption flow.

Bug: 19993667
Change-Id: Ic8a4034033c3cb3262023dba4a642efc6795af10
2015-04-23 20:32:17 -07:00
Ben Kwa
62539a220c Move extension checking code into FileUtils.
Move code for checking file extensions and MIME types from
ExternalStorageProvider into android.os.FileUtils, so it can be used by
other clients (e.g. DownloadsProvider).

BUG=20157955

Change-Id: Ib16a16af723c21fb8d2912c8917dfd68653ea6fa
2015-04-23 16:14:20 -07:00
Jeff Sharkey
529f91fc8e Always send volume UUID with installd commands.
Since packages can be moved to other volumes, all relevant commands
to installd now require an explicit volume UUID parameter.

Bug: 20275577
Change-Id: Ie84f5bc43c7aada5800b8d71692c7928b42b965e
2015-04-18 21:11:58 -07:00
Dmitriy Ivanov
5e4b823aa0 am 34f0fd23: am a04b4302: am b0557ace: Merge "Remove LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS"
* commit '34f0fd239c456e4e064e4c14b768962292023800':
  Remove LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS
2015-04-17 19:47:51 +00:00
Dmitriy Ivanov
811b7266fd Remove LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS
It is no longer needed.

Change-Id: I1b5a58528507df35cc0792a18be5583e3605cbe0
2015-04-17 11:50:29 -07:00
Erik Kline
172cf02435 am 73e056d3: am 402f2501: am 3312c6b9: Merge "Add android.net.IpPrefix#contains()"
* commit '73e056d3931b419c2653eb7365fb72b50a9a36c3':
  Add android.net.IpPrefix#contains()
2015-04-14 09:58:38 +00:00
Erik Kline
acc8c09d3a Add android.net.IpPrefix#contains()
This was originally to avoid RuntimeException in RouteInfo#matches():
    When an IPv6 prefix with a length greater than the max permitted
    for IPv4 is matched against an Inet4Address, the call to
    NetworkUtils throws RuntimeException.

Change-Id: I92e2bd19a4e7d656cf682fd27678da07e211850d
2015-04-14 16:19:11 +09:00
Jeff Sharkey
b9f3674c11 Support moving apps to expanded storage.
Start deriving the data path for apps based on the volume UUID where
the app lives.  This path is used for all higher-level APIs, giving
us a clean place to switch app storage.

When parsing a package, keep track of the volume UUID where it lives
and update PackageSetting once installed.  For now continue treating
moves as installs, but we'll eventually clean this up to avoid the
additional dexopt pass.  Wire up move to use the new installd command
to move private data between devices.

Cache LoadedApk only for the current user, since otherwise the data
dir points at the wrong path.

Bug: 19993667
Change-Id: I53336e3b147d5fd3130e6800869af172b628da37
2015-04-10 00:24:03 -07:00
Dmitriy Ivanov
dec4688f40 Load libraries directly from apk
Introduced new 'extractNativeLibs' attribute to manifest/application.
 Setting it to false prevents installer from extracting library from apk.

 The default value for extractNativeLibs is true.

Bug: 8076853
(cherry picked from commit ff193d642eea7128faad837d19e347cd25212c27)
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-04-07 17:25:23 +00:00
Alex Klyubin
305ebe207a resolved conflicts for merge of 261e7a37 to master
Change-Id: If0a3389764965fe27bf567090a6e24069b61c544
2015-04-01 18:23:27 -07:00
Alex Klyubin
3f24a1d94a Cleanse HTTP, HTTPS, and FTP URLs in Uri.toSafeString.
This makes the hidden API android.net.Uri.toSafeString omit most parts
of HTTP, HTTPS, and FTP URLs to avoid leaking anything unsafe. Only
the host and port are retained for these URLs.

Bug: 19215516
Change-Id: I2e9e33d9afaa9de5dd07a40532d56f0a2179f62a
2015-04-01 13:09:22 -07:00
Fyodor Kupolov
262f9952e6 Support for nested bundles in setApplicationRestrictions
Added new restriction types - bundle and bundle-array.

Modified RestrictionsManager.getManifestRestrictions to support new
hierarchical restrictions.
Added RestrictionsManager.convertRestrictionsToBundle, which enables
programmatic conversion from a list of RestrictionEntries to a Bundle.

Modified read/write methods for application restrictions in UserManagerService.
Added unit tests.

Bug: 19540606
Change-Id: I32b264e04d5d177ea5b4c39a8ace5ee0ce907970
2015-03-30 17:59:07 -07:00
Wenchao Tong
98170b0db1 Keep debug information in NetworkStats files
Create two special SETs.

SET_DBG_VPN_IN is used by individual applications to know
how much traffic of the NetworkIdentity was actually moved
from a VPN app.
SET_DBG_VPN_OUT is used by the VPN app to know how much
traffic of the NetworkIdentity was deducted.

A debug application can restore the raw stats by these
entries.
  raw_traffic = recorded_entry (TAG_NONE, SET_ALL)
              + recorded_entry (TAG_NONE, SET_DBF_VPN_OUT)
              - recorded_entry (TAG_NONE, SET_DBF_VPN_IN)

The two debug SETs are not returned by
NetworkStatsService.openSession(). These debug entries are
retrieved by NetworkStatsCollection.dump().

Bug: 19536273
Change-Id: I03ef9f7667f5f2f48cbe3f6b11447fe7ead8ad3b
2015-03-27 13:49:13 -07:00
Wenchao Tong
041ca26d02 Merge "Create a Benchmark test for NetworkStats." 2015-03-27 20:43:34 +00:00
Wenchao Tong
7ae35a0242 Create a Benchmark test for NetworkStats.
Bug: 19536273
Change-Id: I438ed3affa799612566b04e324e43bc5ea74079f
2015-03-23 16:34:03 -07:00
Dmitriy Ivanov
ff193d642e Load libraries directly from apk
Introduced new 'extractNativeLibs' attribute to manifest/application.
 Setting it to false prevents installer from extracting library from apk.

 The default value for extractNativeLibs is true.

Bug: 8076853
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-03-21 11:46:11 -07:00
Lorenzo Colitti
e5ef28f509 Add two utility methods for IPv4 netmasks.
1. Add a validating method to convert a netmask to a prefix length.
2. Add a function to get the implicit netmask of an IPv4 address.
3. Add a unit test.

Bug: 19704592
Change-Id: Icb9f58d3903ea01df9e3720383c9bd5db6dd8f26
2015-03-20 16:32:34 +09:00
Wenchao Tong
8726e9a73e Merge "NetworkStats to support VPN accounting." 2015-03-12 22:10:56 +00:00
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
Yohann Roussel
bf5ad8d994 Fix handling of LOCAL_JACK_ENABLED
Change-Id: I5180aa6b685859b7855d0037f38178e906e21bd3
2015-02-23 17:38:58 +01: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