277427 Commits

Author SHA1 Message Date
Narayan Kamath
5e806bc3ba MethodHandles: Expose additional API.
Tracks libcore change f4ee5c6dccff8f7e037f95b26767e552ea93d41b.

Test: make checkapi docs
Change-Id: Iac4d4741b9729f3409247b6a3a2b1428f3aa66f0
2017-01-31 14:07:35 +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
Hugo Benichi
2b7c408501 Define Network notification proto constants.
This patch defines 4 new constants in metrics_constants.proto
corresponding to the 4 network notifications shown by
NetworkNotificationManager.

Estimates for the average number of notifications:
  - SIGN_IN:        3/day/device
  - NO_INTERNET:    5/day/device
  - LOST_INTERNET:  5/day/device
  - NETWORK_SWITCH: 3/day/device (turned off right now)

Test: no functional change
Bug: 32198726
Bug: 33030620

(cherry picked from commit e1cbf15f1ad7f2f7e1cc1e96e6a82c3fa2f70bdf)

Change-Id: I6020c283329f752170cef451725b4e5287509bc5
2017-01-30 11:51:58 +09: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
John Reck
ed065024a5 Fix a bunch of repeated reads of a ro.* property
SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
(cherry picked from commit aa67f684ff43c81e3280c846245ec6ebe907787e)
2017-01-27 11:04:39 -08:00
Treehugger Robot
e924640c4b Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling." 2017-01-27 18:49:45 +00:00
Paul Stewart
291ddaef78 Add a client chain to WifiEnterpriseConfig
Add a list of supporting certificates to be presented in the process
of presenting client credentials.

Cherry-pick of e3511767169357a1409119b5666c62d50e005583

Bug: 34688653
Test: Compile, unit tests
Change-Id: I6afd8baf67312e8ddaaeefd26f30dacc51aa33bb
2017-01-27 09:46:27 -08:00
Tomasz Wasilczyk
aee690ffad Use the new radio_metadata wrapper for safer memory management.
Bug: b/34054813
Test: VTS, manual - both done in internal branch
Change-Id: I5f4962f86b7732e14c2584a562e9737c92310697
2017-01-27 09:40:35 -08:00
Lorenzo Colitti
b8bbd30203 Merge "ConnectivityServiceTest: fix flaky tests" 2017-01-27 09:40:47 +00:00
Lorenzo Colitti
be80577f5b Merge "ConnectivityServiceTest: remove flaky waitForIdle test." 2017-01-27 09:38:52 +00:00
koji.x.shigehara
5ab1bc8c97 Handles #9 as Dial number
Adding #9 as a country-specific exception of MMI codes so that
we can treat it as Dial number. This config change is necessary
to fulfill carrier's requirement.

Test: manual - check dialing #9
Bug: 34755732
Change-Id: I485e48cf30610ff012f84d43935454e693b0d94d
2017-01-27 05:34:39 +00:00
Treehugger Robot
a7ce460921 Merge "Increase the character limit for "Use System Selection" message" 2017-01-26 23:34:37 +00:00
Treehugger Robot
0a649bffcc Merge changes If5025361,Iabe27cd8
* changes:
  hotspot2: added remaining parameters to PasspointConfiguration
  hotspot2: add support for complete PerProviderSubscription/Policy subtree
2017-01-26 22:41:19 +00:00
Pavlin Radoslavov
f8c776ce01 Increase the character limit for "Use System Selection" message
The character limit for message "Use System Selection (Default)"
has been increased from 40 to 50.

Test: UI visual inspection
Bug: 34662759
Change-Id: I9aba6847ddab27bb0456fb6dfd429692732f07c2
2017-01-26 13:37:14 -08:00
Treehugger Robot
8150581742 Merge "wifi: WifiManager API change for supporting Passpoint Release 2" 2017-01-26 19:51:37 +00:00
Treehugger Robot
22f97c83fb Merge "Integration of the AAC codec for A2DP source" 2017-01-26 19:12:56 +00:00
Peter Qiu
4f5c0ccfda wifi: WifiManager API change for supporting Passpoint Release 2
The changes include:
- Split WNM notifications intent to dedicated intent for each
  event: Deauth Imminent Notice and Subscription Remediation
- Add intent for broadcast OSU Providers List
- Update Passpoint icon intent definitions to conform to the
  API guide
- Make WifiManager#queryPasspointIcon public

All added/updated intents will required receiver to have
android.Manifest.permission.ACCESS_WIFI_STATE in order to
receive the intents.

The deprecated hidden intent definitions will be removed once
the WifiService is updated to use the new intents.

Bug: 34198926
Test: make -j32
Change-Id: If28a5710f68271069c663a953538f920512e3240
Merged-In: Ic17eef8364d79144eb530c68c6877712efcb5209
2017-01-26 10:12:19 -08:00
Pavlin Radoslavov
b33bd5bc2e Integration of the AAC codec for A2DP source
Test: A2DP streaming to AAC headsets
Bug: 30958229
Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d
2017-01-26 09:06:02 -08:00
Thecrazyskull
7664bceec3 KeySetManagerService: prevent NPE
* If pubKeys is null, we cannot check the size of pubKeys

Test: none

Change-Id: I3b4074d8727b084fea98a0e0a5a0afbd96bea41d
2017-01-26 09:03:59 -06:00
Erik Kline
d2ec3919cb Switch to listening for all network changes.
This is for use while preferred upstreams are expressed as legacy types.

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - USB tethering to WiFi and DUN works
Bug: 32163131
Change-Id: I76e7b6c95eb1b54e926096b2791163617bb0a818
2017-01-26 20:50:51 +09:00
ltrochtova
2c1e396382 Merge "Don't offer the BT sharing option to the user if BT is disallowed." 2017-01-26 09:41:52 +00:00
Treehugger Robot
0645c21163 Merge "Fix wording ambiguity for Bluetooth LDAC Playback Quality selection" 2017-01-26 04:23:43 +00:00
Treehugger Robot
8e6b13a1c0 Merge "Adding Dynamic ImsService Binding (1/3)" 2017-01-26 01:34:05 +00:00
Shukang Zhou
6ec0b7e21d [Frameworks] Add an 'am' cmd option to enable streaming in profiling.
Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
    sampling/instrumention
    streaming/non-streaming
    'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
2017-01-25 16:53:41 -08:00