1182 Commits

Author SHA1 Message Date
Lorenzo Colitti
1603eadc5a Unbreak LinkPropertiesTest.
This was broken by the changes that made addRoute add routes
only if they did not already exist.

Change-Id: I1d227df9223fbecf106efde05b709f320824ee9d
2014-06-25 18:19:47 +00:00
Jeff Sharkey
275e085d5a Stronger PackageParser contract, more split work.
Require that method callers always provide relevant paths, instead of
relying on constructor.  Move DisplayMetrics to be an overall parser
parameter, and move PARSE_TRUSTED_OVERLAY to flags.

Parse split APKs and apply deterministic ordering based on split
names.  Assert consistent package name and version code across all
split APKs in a package, and enforce unique split names and required
base APK.

Collect certificates for split APKs, enforcing they're all signed
consistently.  Better flow control and resource cleanup when
collecting certs.  Refactor validation code so it's easier to reason
about.  Cleaner maintenance of read buffer when draining stream
contents.

Change-Id: I8bc8c62095fbb933227b9e76ad8771f4b1246fe8
2014-06-18 16:04:13 -07:00
Lorenzo Colitti
0f50bbfe45 Merge "IpPrefix improvements." 2014-06-17 04:11:04 +00:00
Lorenzo Colitti
8c6c2c3c92 IpPrefix improvements.
1. Allow IpPrefixes to be created from strings. In order to do
   this, factor out the code from LinkAddress which already does
   this to a small utility class in NetworkUtils.
2. Truncate prefixes on creation, fixing a TODO.
3. Add a toString method.
4. Write a unit test.

While I'm at it, make RouteInfoTest pass again, and convert it
to use IpPrefix instead of LinkAddress.

Change-Id: I5f68f8af8f4aedb25afaee00e05369f01e82a70b
2014-06-17 11:18:53 +09:00
Adam Lesinski
e75b2c2677 Fix runtime overlay tests
The runtime overlay tests were crafting bad locales.

Change-Id: I33c87e71752756f40a954db9f01ea3cdde488a42
2014-06-17 01:22:57 +00:00
Jeff Sharkey
c4858a2ba9 Switch PackageParser to reference single path.
It previously kept mPath separate from mScanPath for some very odd
edge cases around moving apps-on-SD.  This changes it to always use
a single path, refactors moving to keep separate paths.

Refactors method names in PackageParser to be clearer about their
APK-versus-package relationship.

Beginnings of a split package parser.  Instead of requiring that
callers check error codes when null, switch to always throwing on
parse errors, to require that callers deal with the error.  Longer
term the entire parser should switch to this style, but its too
pervasive for a simple refactoring.

Change-Id: If071d8e55e46e56cc201fadfb51cb471713ae973
2014-06-16 13:20:18 -07:00
Lorenzo Colitti
62388936c8 Assert that RT_SCOPE_* and IFA_F_* are not zero.
If these constants are zero (or, rather, if they're not all
different), the test will fail with more cryptic error messages
whose cause is not obvious. Clearly check for that here.

Bug: 15602893
Change-Id: I7ca4a9c5e3d592fd93fbfa1b50666a1861a0031d
2014-06-13 17:20:20 +09:00
Yohei Yukawa
2a97b54f49 am f09cb58d: Merge "Rename CursorAnchorInfoBuilder with Builder" into lmp-preview-dev
* commit 'f09cb58d5f528665e6e96d8740eeeeab4167e357':
  Rename CursorAnchorInfoBuilder with Builder
2014-06-12 19:58:02 +00:00
Robert Greenwalt
756c4b795e am f7c964fa: Merge "Fix Build" into lmp-preview-dev
* commit 'f7c964fa06257d6db1b894bfbe905ca125c755c8':
  Fix Build
2014-06-12 19:57:23 +00:00
Robert Greenwalt
54e312a51b am 9c6d406e: Fix build breakage.
* commit '9c6d406eb7ab0fce40fb7cd1257714a29d06774c':
  Fix build breakage.
2014-06-12 19:57:11 +00:00
Robert Greenwalt
130669992c Fix build breakage.
Change-Id: Ideb32704ce5dc37ef36b05609f88da2aa55b3a00
2014-06-11 18:06:55 -07:00
Yohei Yukawa
13592c623c Merge "Rename CursorAnchorInfoBuilder with Builder" into lmp-preview-dev 2014-06-10 22:36:02 +00:00
Robert Greenwalt
6f0ec45a3b Fix Build
Change-Id: Iebbce8eaf21b3d2ba01ec720812d38018b13529e
2014-06-11 18:36:36 -07:00
Robert Greenwalt
594b456b6e Merge "Minor changes to the LinkAddress API docs." into lmp-preview-dev 2014-06-10 22:12:51 +00:00
Sreeram Ramachandran
6307b35e1d Add a new IpPrefix class and use it in RouteInfo.
This change uses IpPrefix only in the public API and continues
to use LinkAddress for everything else. It does not change the
callers to use the new APIs, with the exception of changing
all current uses of getDestination to getDestinationLinkAddress
to make room for the new getDestination method that returns an
IpPrefix.

Based on Sreeram's earlier change:
https://googleplex-android-review.git.corp.google.com/#/c/477874/
but a bit simplified and with a bit more documentation.

Bug: 15142362
Bug: 13885501
Change-Id: Ib4cd96b22cbff4ea31bb26a7853989f50da8de4e
(cherry picked from commit 7d3b4b9a3d4de9673119632da0ebd583e50126f7)
2014-06-11 16:32:21 -07:00
Lorenzo Colitti
00a0fd650b Minor changes to the LinkAddress API docs.
1. Rename getNetworkPrefixLength to getPrefixLength. Update all
   callers in frameworks/base and add a shim method and a TODO
   for the rest.
2. @hide isSameAddressAs. It doesn't add much, and it's just
   one-liner that callers can implement if they want.
3. Fix the alignment of the initial paragraph (<ul> should have
   been </ul>).
4. Remove the documentation that talks about creating
   LinkAddresses, since there's no public API for creating them.

With these changes I think LinkAddress is fine as a public API.

Bug: 15142362
Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c
(cherry picked from commit 9ab53650cfcd91a2a151b44b3fd1381841f76269)
2014-06-11 18:52:19 +00:00
Robert Greenwalt
25702b3967 Fix public API of LinkProperties.
bug:15142362
(cherry picked from commit 51d898fd0223a4b7c728980ab987dd985c02df5f)
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc
2014-06-10 15:42:19 -07:00
Lorenzo Colitti
7dc78cf3af Minor changes to the LinkAddress API docs.
1. Rename getNetworkPrefixLength to getPrefixLength. Update all
   callers in frameworks/base and add a shim method and a TODO
   for the rest.
2. @hide isSameAddressAs. It doesn't add much, and it's just
   one-liner that callers can implement if they want.
3. Fix the alignment of the initial paragraph (<ul> should have
   been </ul>).
4. Remove the documentation that talks about creating
   LinkAddresses, since there's no public API for creating them.

With these changes I think LinkAddress is fine as a public API.

Bug: 15142362
Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c
2014-06-10 14:46:39 -07:00
Sreeram Ramachandran
cc91c7b804 Add a new IpPrefix class and use it in RouteInfo.
This change uses IpPrefix only in the public API and continues
to use LinkAddress for everything else. It does not change the
callers to use the new APIs, with the exception of changing
all current uses of getDestination to getDestinationLinkAddress
to make room for the new getDestination method that returns an
IpPrefix.

Based on Sreeram's earlier change:
https://googleplex-android-review.git.corp.google.com/#/c/477874/
but a bit simplified and with a bit more documentation.

Bug: 15142362
Bug: 13885501
Change-Id: Ib4cd96b22cbff4ea31bb26a7853989f50da8de4e
2014-06-10 14:30:15 -07:00
Yohei Yukawa
c46b5f04aa Rename CursorAnchorInfoBuilder with Builder
Inner Builder class should not inherit full class name of outer
class.

BUG: 15516230
Change-Id: I2d56edebb0c85639db57ca5b2aadb22c67fc5926
2014-06-10 14:19:28 +09:00
Robert Greenwalt
df2b878ff4 Fix public API of LinkProperties.
bug:15142362
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc
2014-06-08 12:54:23 -07:00
Yohei Yukawa
083a3e6151 Merge "Reenable DynamicRotationList for language-switching-aware IMEs" 2014-06-03 00:51:32 +00:00
dcashman
559321abbf Merge "Add ArrayUtils methods and tests for consumption by KeySet code." 2014-06-02 17:34:09 +00:00
dcashman
874d0d4032 Add ArrayUtils methods and tests for consumption by KeySet code.
Adds methods for dealing specifically with long data types.  Used by
PackageKeySetData as part of the KeySet work.  Add appropriate test methods
to MoreAsserts as well.

Bug: 6967056
Change-Id: I1e263301b353e0cd1b45126be6ef5ec310f311a8
2014-06-02 10:29:40 -07:00
Yohei Yukawa
07bd732034 Reenable DynamicRotationList for language-switching-aware IMEs
In order to reenable DynamicRotationList for
language-switching-aware IMEs, this CL reverts
I84291fd4a7d6192b3bd0c366c49 with fixing a bug that the dynamic
rotation state is reset even when the list of input methods is
not changed.

With this CL, the dynamic rotation state is preserved when the
enabled input methods is not changed actually.

BUG: 7043015
Change-Id: I506828c7a363e79f1c767eeb28f0d3746ff1cb0d
2014-06-02 19:20:36 +09:00
Wei Wang
75f5b3a8dd am 19bdd64c: Merge "Address API review comments. 1. Moved le stuff to it\'s subpackage. Remove BluetoothLe for all classes except *Scanner, *ScanSetting, *Advertiser and *AdvertiseSettings. 2. Make all callbacks abstract classes instead of interfaces. 3. Moved Advertis
* commit '19bdd64c3b9dd16778575164c13c8af798832f01':
  Address API review comments. 1. Moved le stuff to it's subpackage. Remove BluetoothLe for all classes except *Scanner, *ScanSetting, *Advertiser and *AdvertiseSettings. 2. Make all callbacks abstract classes instead of interfaces. 3. Moved AdvertisementData and ScanRecord out and removed AdvertiseBaseData 4. Removed newBuild and use new Builder for all builders. 5. Using setxxx in builders. 6. Misc other changes.
2014-05-30 21:38:59 +00:00
Wei Wang
6d81118032 Address API review comments.
1. Moved le stuff to it's subpackage. Remove BluetoothLe for all classes
except *Scanner, *ScanSetting, *Advertiser and *AdvertiseSettings.
2. Make all callbacks abstract classes instead of interfaces.
3. Moved AdvertisementData and ScanRecord out and removed
AdvertiseBaseData
4. Removed newBuild and use new Builder for all builders.
5. Using setxxx in builders.
6. Misc other changes.

Fixes b/15140940

Change-Id: I32ae3d24a9491baf96048040b5ac78f6f731e468
NO_SQ: multi-project submit
2014-05-29 17:21:54 -07:00
Yohei Yukawa
529001f067 Switch back to StaticRotationList from DynamicRotationList
Ic005b94379f9d847ea, which introduced DynamicRotationList for
smarter input method rotation, is suspected to be causing a
strange behavior that InputMethodManager#switchToNextInputMethod
is choosing unexected/disabled IME/subtype.

With this CL, we switch back to StaticRotationList until the root
cause is addressed.

BUG: 7043015
Change-Id: I95fc8b28536cea6d09ea325e0caee14007cfc0a7
2014-05-27 20:32:34 +09:00
Yohei Yukawa
c659053c4c Merge "Implement dynamic IME rotation based on user action" 2014-05-26 16:37:23 +00:00
Yohei Yukawa
a9bda77427 Implement dynamic IME rotation based on user action
With this CL, the IME rotation order will be updated dynamically
based on user actions on IMEs. Currently only onCommitText is
took into considered.

Imagine that we have the following rotation order.
  [A, B, C, D, E]
If a user action for C is observed, the rotation order will be
updated as follows:
  [C, A, B, D, E]
Then another user action for D updates the rotation order as
follows:
  [D, C, A, B, E]

BUG: 7043015
Change-Id: Ic005b94379f9d847ea87046473ed77d8018d930e
2014-05-27 01:32:30 +09:00
Yohann Roussel
f2fa9994ab Merge "A test application for Art bug 14256107" 2014-05-26 12:26:21 +00:00
Yohann Roussel
3d736bc13c A test application for Art bug 14256107
Change-Id: I629e8d0f91af6a6aff5a6d3f0b584fc01ba4429e
2014-05-23 14:55:35 +02:00
Yohei Yukawa
6c8ca8473a Merge "Consolidate the language-switching logic" 2014-05-23 09:15:16 +00:00
Yohei Yukawa
9b29d04565 Consolidate the language-switching logic
This CL does not change the existing behavior.
In I84291fd4a7d6192b, the IME rotation group is logically
devided into two groups, one is for IMEs that are declared as
supportsSwitchingToNextInputMethod == true, and the other is
IMEs that are not declared so. The problem is that the logic
was implemented with a single ime/subtype list where these two
kinds of IMEs are completely mixed. This makes the code
unnecessarily complex.
With this CL, these two rotation groups are actually managed
as two different collections separately. This allows us to
simplify the rotation logic as well as its test cases.
This CL is also a groundwork to implement smarter
language-switching logic that is applied to
language-switching-aware IMEs only.

BUG: 7043015
Change-Id: I7f08ec299ec41d614e2cd3912320687db1576e80
2014-05-23 18:02:42 +09:00
Jeff Sharkey
5ec9aed64c Merge "Offer to stream and fsync() install sessions." 2014-05-22 23:52:41 +00:00
Jeff Sharkey
78cc340c2d Offer to stream and fsync() install sessions.
Installers are interested in both streaming APK data and establishing
a happens-after relationship to support resuming downloads after a
process kill or battery pull.

This exposes a generic OutputStream for writing, and hooks up flush()
to be a blocking call which returns only when all outstanding write()
data has been fsync()'ed to disk.

Tests to verify behavior.

Bug: 14975160
Change-Id: I38289867c80ac659163bb0c2158ef12d99cc570d
2014-05-22 15:54:16 -07:00
Yohann Roussel
7d66d76fbb Merge "Fix ANR in multidexlegacytestservices." 2014-05-22 14:52:03 +00:00
Yohei Yukawa
5a647b69be Remove unnecessary internal lock
Previously, InputMethodSubtypeSwitchingController has relied on
its own internal lock for #getNextInputMethod and
class has to be invalidated whenever
InputMethodManagerService#mMethodMap is updated, any method of
InputMethodSubtypeSwitchingController should be called under
the global lock of InputMethodManagerService#mMethodMap.

As a consequence, we can conclude that
InputMethodSubtypeSwitchingController does not need its own
internal lock.

This CL also adds additional synchronization blocks into
the constructor of InputMethodManagerService to address the
existing inconsistency that methods with *Locked suffix are
called without the lock actually.

BUG: 7043015
Change-Id: I9d4d3d7232c984432185c10c13fb726a6158cac8
2014-05-22 18:18:02 +09:00
Yohann Roussel
affa8a4736 Fix ANR in multidexlegacytestservices.
Continuous testing showed that the test is flaky because of ANR caused by too
long computation in onCreate(). So this change move computation in another
thread to free the main thread.

Change-Id: I2ecff3f3e659ff092dd4c7c230c35be4a5742c4b
2014-05-21 18:22:26 +02:00
Yohei Yukawa
4013940b62 Style fix and dead code removal
This CL does not change the existing behavior.
Smarter language switching will be coverted by subsequent CLs.

BUG: 7043015
Change-Id: I281a33191d44be448492c2b74760cb8680719124
2014-05-21 22:56:40 +09:00
Lorenzo Colitti
247675e5d9 Fix build.
Change-Id: I5c09a406b6c43318cea600171b8dd25eeeffa673
2014-05-20 17:17:21 -07:00
Jaewan Kim
6346155c5a Move IP config from WifiConfiguration to IpConfiguration.
This is so that Ethernet can use it in the future.

Bug: 7606609
Bug: 8687763

Change-Id: I5d1189682b13f1088848809604690648d8d9ecca
2014-05-20 15:24:10 -07:00
Guang Zhu
47c6514eaa am cd98ecc6: am 6071e45a: Merge "add a command to list all bonded devices" into klp-modular-dev
* commit 'cd98ecc66b968c5d5d0d12522c4c8c9b848bf181':
  add a command to list all bonded devices
2014-05-20 09:58:35 +00:00
Guang Zhu
cd98ecc66b am 6071e45a: Merge "add a command to list all bonded devices" into klp-modular-dev
* commit '6071e45a64ab764eb86603f2f4496cfd5c8de708':
  add a command to list all bonded devices
2014-05-20 09:26:18 +00:00
Wei Wang
adf6aff5b0 Revert "Revert "APIs for BLE scan, scan filter, batch scan, onFound/onLost and multiple advertising.""
This reverts commit b1d9fbc0f8dea0c77ed810190b325bfdaaf21789.

Change-Id: Ic8dec9385a7c763170ebeb1bcddd221c72f46e88
2014-05-19 23:52:45 -07:00
Wei Wang
319b40c9cf Revert "APIs for BLE scan, scan filter, batch scan, onFound/onLost and multiple advertising."
This reverts commit 2c4e68a86b7a9b9f760a8907b93ff40ccad56c80.

Change-Id: I98c91343d886ebe22d0bf75a710fa0b0abf738b6
2014-05-20 04:52:35 +00:00
Guang Zhu
d22b2413b9 add a command to list all bonded devices
Bug: 14601515

Change-Id: I3cc5bb664485ef768bb81f1f8870ed9bf62f8329
2014-05-19 21:36:10 -07:00
Wei Wang
62d5bc745a APIs for BLE scan, scan filter, batch scan, onFound/onLost and multiple
advertising.

Change-Id: I1655eb9cffa890b6fe38108bf51078662e90bc03
2014-05-19 19:40:49 -07:00
Wei Wang
51800847d9 Add a method to check whether a UUID is 32bit.
Change-Id: I92e8bab560b2083e9f4855d28b3f54f2120ef628
2014-05-19 19:37:05 -07:00
Jeff Davidson
7672ef046b Fix inconsistent package name.
Change-Id: I6dfa0ded4309ae9e3f8ab73d96e6ccb521beb7c4
2014-05-15 15:53:17 -07:00