277396 Commits

Author SHA1 Message Date
Treehugger Robot
603eefd5d5 Merge "Add test for repeated calls to registerMobileUpstreamRequest()" 2017-02-02 05:07:23 +00:00
Treehugger Robot
9be24a3040 Merge "Cleanup hwbinder getService code." 2017-02-01 20:46:45 +00:00
Brad Ebinger
2bb0d95e91 Merge "Turn off Dynamic IMS switching for now" 2017-02-01 19:36:48 +00:00
Treehugger Robot
390ec27f9d Merge "Adds @hide permission granting API for ImsServices" 2017-02-01 19:24:11 +00:00
Steven Moreland
2f379ca7d9 Cleanup hwbinder getService code.
- Remove memory leaks.
- Make sure proper errors are getting thrown.
- Avoid SIGABRT

Test: hidl_test_java
Change-Id: Ia5680fd0ebf83d0f174bf0d8109bf60327be5f9d
2017-02-01 10:42:23 -08:00
Erik Kline
7462f467c1 Add test for repeated calls to registerMobileUpstreamRequest()
Test: as follows
    - built
    - flashed
    - booted
    - runtest framework-net passes
Bug: 32163131

Change-Id: I6d2519601b7a9dcfda2917118214a7ceb9dbbb7f
2017-02-01 21:30:15 +09:00
Treehugger Robot
53873df5fe Merge "Fix a use-of-uninitialized-value warning" 2017-02-01 07:09:51 +00:00
Treehugger Robot
2ac992fcad Merge "hotspot2: implement hashCode() for classes with equals() function" 2017-02-01 03:12:13 +00:00
Treehugger Robot
cf7f9dd6a1 Merge "Print the package name and creator UID in dump()." 2017-02-01 02:41:00 +00:00
Treehugger Robot
59da9b24ca Merge "hotspot2: update PasspointConfiguration APIs" 2017-02-01 02:35:20 +00:00
Lorenzo Colitti
2ec8b8bcb6 Merge changes If420bd66,Icbb161ca,Ida190e5a,Iae75781f
* changes:
  ConnectivityServiceTest: remove remaining poll loops.
  Remove assertEventuallyTrue as it's unnecessary.
  Rename AvoidBadWifiTracker to MultinetworkPolicyTracker
  Attempt to make waitForIdleHandler reliable.
2017-02-01 02:25:43 +00:00
Treehugger Robot
71317f4a6c Merge "Post runnables instead of sending messages." 2017-02-01 01:26:05 +00:00
George Burgess IV
974403a2c5 Fix a use-of-uninitialized-value warning
This is the result of running ./gen after applying
I90bea0c94cf8d7f92a0d9a4db4e64e7e563bfb09.

Bug: None
Test: Still builds; warning is now gone.
Change-Id: Ibcd5e8dcec96406b529c5790ba0a2822dace25c2
2017-01-31 16:23:25 -08:00
Brad Ebinger
94baea5aeb Turn off Dynamic IMS switching for now
The new ImsService implementations must be in place before
ImsResolver/ImsManager can use the new Dynamic ImsService switching
system.

Test: Manual
Change-Id: Ie6454aec08a3f1ebd92271f1c0554c16dc57a868
2017-02-01 00:16:42 +00:00
Jeremy Joslin
711efaccd2 Print the package name and creator UID in dump().
Add a little more info to help differentiate the registered score
caches during a dump.

Test: adb shell dumpsys network_score
Change-Id: I59cb877b3237aaa85cb564795fb8a41c3d95e315
2017-01-31 14:48:01 -08:00
Peter Qiu
ddafc73496 hotspot2: implement hashCode() for classes with equals() function
According to API guideline, classes that override equals()
function should override hashCode() as well.  Make it so.

Bug: 34198926
Test: frameworks/base/wifi/tests/runtests.sh
Change-Id: I4c3afed78a2fc06cdc26dd04d076f579b3472139
2017-01-31 13:26:36 -08:00
Peter Qiu
aef5b6095f hotspot2: update PasspointConfiguration APIs
Based on the API guideline, use of public variables are discouraged.
So update PasspointConfiguration and its associated classes to use
private variables with public accessor methods.

While there, cleanup unit tests to reduce code duplications.

Bug: 34627062
Test: frameworks/base/wifi/tests/runtests.sh
Change-Id: I6ea45bbcf03aec01c187425a66094fad6098d75d
2017-01-31 13:26:36 -08:00
Jeremy Joslin
c695a17421 Post runnables instead of sending messages.
Gaining access to a Handler's Looper can be problematic in custom
Handler implementations. Instead of creating a new internal Handler
to dispatch the method calls on we simply post Runnables to the
given Handler.

Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 34845471
Change-Id: I6fe380a92aebd630781abe5853f94737bcfeaa5f
2017-01-31 11:51:25 -08:00
Treehugger Robot
c74d60a69e Merge "Two digit call support for Claro" 2017-01-31 19:30:23 +00:00
Pavlin Radoslavov
ccd60f7cbe Merge "Update the A2DP Codec Config API" 2017-01-31 19:02:36 +00:00
Pavlin Radoslavov
b37f181c98 Update the A2DP Codec Config API
Previously, the JNI upcall would contain only the current codec config.
In the new API, the upcall contains:
 1. The current codec config
 2. The list of codecs containing the local codecs capabilities
 3. The list of codecs containing the selectable codecs capabilities.
    This list is the intersection of the local codecs capabilities
    and the capabilities of the paired device.

Also, refactored the Java internals to accomodate the extra information:
 * Added new class BluetoothCodecStatus that contains the extra info:
   current codec config, local codecs capabilities and selectable
   codecs capabilities
 * Renamed method getCodecConfig() to getCodecStatus() and return the
   corresponding BluetoothCodecStatus object.
 * Updates to class BluetoothCodecConfig:
   new methods isValid(), getCodecName(), and updated toString()
   so it is more user friendly
 * Removed BluetoothCodecConfig.EXTRA_CODEC_CONFIG and
   EXTRA_PREVIOUS_CODEC_CONFIG.
   The former is superseded by BluetoothCodecStatus.EXTRA_CODEC_STATUS;
   the latter is not really used.

Test: A2DP streaming with headsets and switching the codecs
Change-Id: Ia1af2c22e521e863e28a360610aca49f7e62d31b
2017-01-31 18:58:27 +00:00
Treehugger Robot
161ac8b006 Merge "hotspot2: enclose conditional statement in parenthesis" 2017-01-31 18:12:57 +00:00
Lorenzo Colitti
d2706127d0 ConnectivityServiceTest: remove remaining poll loops.
All the tests are now asynchronous. The only remaining uses of
Thread.sleep() are in the tests that check for NetworkRequest
timeouts.

Test: ConnectivityServiceTest passes 100 times in a row
Bug: 32561414
Change-Id: If420bd66c692a90d5031ee06a888a8cc3b4398a8
2017-01-31 15:44:23 +09:00
Lorenzo Colitti
30145d755c Remove assertEventuallyTrue as it's unnecessary.
The calls in testAvoidBadWifi are no longer necessary now that
waitForIdle is reliable, and the calls in testPacketKeepalives
are replaced with a wait for the NetworkAgent to disconnect.

Test: ConnectivityServiceTest passes 100 times in a row.
Bug: 32561414
Change-Id: Icbb161ca6e343bd14764a1c9ccfdd14b6cd6803f
2017-01-31 15:42:58 +09:00
Lorenzo Colitti
58ebe1c6f1 Rename AvoidBadWifiTracker to MultinetworkPolicyTracker
Rename the class and ensure that all code related to bad wifi
avoidance has names that reflect its purpose.  This will allow us
to reuse most of the the code for other purposes in future CLs.

Test: runtest frameworks-net passes
Bug: 34630278
Change-Id: Ida190e5a79e7a12f4eec07e1a3e4d9d138e83bcd
2017-01-31 15:42:57 +09:00
Lorenzo Colitti
ae3ce81cc3 Attempt to make waitForIdleHandler reliable.
The current implementation of IdleableHandlerThread is based on
the assumption that MessageQueue#isIdle will return true iff the
message loop has finished processing its messages.

Unfortunately, this is incorrect: isIdle returns true iff are no
more messages waiting in the queue; thus, it will also return
true while it is processing the last message before going idle.

Instead of using idle handlers, take the simpler approach of
posting a runnable to the message loop and waiting for it to
be processed.

Test: see other CLs in this patch series
Bug: 31479480
Change-Id: Iae75781f067b762c8653a488a5e4d5ee0c789e01
2017-01-31 15:42:17 +09:00
Hugo Benichi
c2e8588396 Merge "ApfTest: fix flaky testApfFilterRa." 2017-01-31 05:53:52 +00:00
Hugo Benichi
4456f33a95 ApfTest: fix flaky testApfFilterRa.
testApfFilterRa is failing with probabiliy 1/10 ~ 1/15 on the following
assert: assertDrop(program, packet, lifetime/6), for lifetime values
that are multiple of 6, where 6 is the hardcoded fraction of RA lifetime
to filter in ApfFilter.java.

When the lifetime is not a multiple of 6, the remainder of 1 to 5
seconds gives enough margin so that when the APF program is simulated
the faked lifetime of the program is less than lifetime/6 away and the
packet is dropped.

However for lifetimes which are exact multiples of 6, this margin is
always 0s and that result in nondeterminism in the result. This is
consistent with the obervation that the only failed assert was for a
lifetime of 300s, the only multiple of 6.

This can be observed by detecting the age limit at which the filter
stops dropping packet oscillating between lifetime/6 and lifetime/6 + 1
for lifetimes which are multiple of 6.

This patch fixes the flakyness by freezing the flow of time in tests so
that the expected filter age threshold is consistent and stable.

Test: no failure observed in 1000 runs.
Bug: 32561414
Change-Id: I5251d047039f34b82ce8a5d20ae46563e1e0cce8
2017-01-31 11:13:44 +09:00
Peter Qiu
55078c4fa8 hotspot2: enclose conditional statement in parenthesis
Couple unit tests are failing due to conditional statements
not enclosed in the parenthesis, which causes unexpected
returned value for the equals function.  So fix it.

Bug: 34764955
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Iaf0151803cb62eb8af308e5de40558617f84cd2f
2017-01-30 17:47:53 -08:00
Etan Cohen
d0f1c9d1d3 Merge "[AWARE] Minor hardening of manager." 2017-01-31 01:19:49 +00:00
Jerry Zhang
54604d9143 Merge changes I8eca5f24,I9d79c67c
* changes:
  Check and send usb state broadcast when devices boots
  Only send usb disconnect intents after boot.
2017-01-31 00:41:55 +00:00
Badhri Jagan Sridharan
af6d473ab0 Check and send usb state broadcast when devices boots
Broadcasts are not sent until BOOT_COMPLETED is received.
When the device boots with usb plugged, the UPDATE_STATE
for connted and configured would be received way before
BOOT_COMPLETED is received. Since, devices can continue
to stay in same usb configuration(set through persistent
property trigger), check and send a usb state broadcast
if needed.

BUG: 34451258
Test: Manually checked to verify the broadcasts sent.
Change-Id: I8eca5f241ad758f5c4f1afa6c9807868dfd6195a
2017-01-31 00:41:49 +00:00
Jerry Zhang
c1bc0a844d Only send usb disconnect intents after boot.
This prevents cases where the device starts up and attempts
to change the config, but intents cannot yet be sent.

A patch to resend this skipped intent is necessary to
finish fixing the bug.

Bug: 34451258
Test: Check that usb state is properly handled on boot
Change-Id: I9d79c67ce8982fd5b43fa40781b66bb9ae820694
2017-01-30 14:34:57 -08:00
Brad Ebinger
f477979bf9 Adds @hide permission granting API for ImsServices
Adds the @hide API to grant ImsServices default permissions
using the PackageManager and DefaultPermissionGrantPolicy APIs.

Test: Manual
Bug: 32460405
Change-Id: Ia143ede42623b4c2203261fc6e83624d73c478f1
2017-01-30 13:12:09 -08:00
Etan Cohen
275f323e86 [AWARE] Minor hardening of manager.
Callbacks are possible even if no listener was defined.
Perform a check and print error (as opposed to crashing).

Bug: 32315992
Test: unit-tests + integration tests passing
Change-Id: Ia5eb81448ace6b88abcd448e4f378da6530ac630
2017-01-30 13:09:41 -08:00
Treehugger Robot
06aed6950d Merge "SFR sims should treat Spain as roaming" 2017-01-30 20:03:13 +00:00
Marie Janssen
1785fc4eea Merge "Bluetooth: add getDiscoveryEndMillis() call" 2017-01-30 17:46:18 +00:00
Nicolas Geoffray
4df43ad959 Merge "Introduce DEBUG_JAVA_DEBUGGABLE." 2017-01-30 15:09:45 +00:00
Treehugger Robot
c66327149a Merge "KeySetManagerService: prevent NPE" 2017-01-29 17:14:40 +00:00
Marie Janssen
23a4833157 Bluetooth: add getDiscoveryEndMillis() call
Method to tell when the adapter finished (or will finish) being in
discovery mode.

Test: compiles and still can scan
Bug: 34395439
Change-Id: I41b48c2b934c0a1d5e1727cec08f3f762e3cb309
2017-01-27 18:48:11 -08:00
Treehugger Robot
c71b5dab72 Merge changes from topic 'enterprise-client-chain'
* changes:
  Test passing null cert/keys to WifiEnterpriseConfig
  Account for null client certificate
  Add a client chain to WifiEnterpriseConfig
2017-01-28 01:38:31 +00:00
Treehugger Robot
d063843549 Merge "Adds @hide ImsResolver API and device overlays (2/3)" 2017-01-27 22:55:16 +00:00
Treehugger Robot
4265991701 Merge "Fix a bunch of repeated reads of a ro.* property" 2017-01-27 22:49:04 +00:00
Treehugger Robot
3b24c6e1a2 Merge "Handles #9 as Dial number" 2017-01-27 21:30:42 +00:00
Brad Ebinger
e6ec7d8b8f Adds @hide ImsResolver API and device overlays (2/3)
- Adds config_ims_package device overlay, which specifies the default
package name to bind to.
- Adds config_dynamic_bind_ims device overlay, which determines
whether or not the new dynamic binding system is used.
- Adds @hide TelephonyManager API to interface with the ImsResolver

Test: Manual
Merged-In: I82a41da00e6da34629a40db431f13b968dfafe2e
Change-Id: I82a41da00e6da34629a40db431f13b968dfafe2e
2017-01-27 13:09:37 -08:00
Paul Stewart
88b3c589ad Test passing null cert/keys to WifiEnterpriseConfig
Ensure that null certificates and keys don't crash.

Bug: 34765004
Test: This is a test
Change-Id: I439b4f985c1b88ad4a9b58ee6f4eb4f90bd81246
2017-01-27 12:48:55 -08:00
Paul Stewart
1ca57a1d10 Account for null client certificate
If a null certificate is passed to setClientKeyEntry() we should
not pass a non-null array with a single null element to the
setClientKeyEntryWithCertificateChain helper method.  Instead we
should pass a null array.

Cherry-pick of 410a3498ac28dccf69212d94a533040893c7ce0c

Bug: 34765004
Test: cts-tradefed run cts -d --module CtsNetTestCases --test android.net.wifi.cts.WifiEnterpriseConfigTest
Change-Id: I02793b4b29bc7325f98833c58bf652ba68353827
2017-01-27 12:47:20 -08:00
Tomasz Wasilczyk
a9ed0b1c8b Merge "Use the new radio_metadata wrapper for safer memory management." 2017-01-27 20:26:08 +00:00
Nicolas Geoffray
347b1df988 Introduce DEBUG_JAVA_DEBUGGABLE.
For notifying ART it will run a debuggable app.

Also rename ENABLE_DEBUGGER to ENABLE_JDWP.

Test: builds and runs
bug: 28769520
Change-Id: Ic096a176edfd5bf0bbe92b8367fbaa687a07d284
2017-01-27 11:26:53 -08:00
Treehugger Robot
085ffa76fa Merge "Switch to listening for all network changes." 2017-01-27 19:07:08 +00:00