OSDN Git Service

android-x86/frameworks-base.git
7 years agoMerge "Post runnables instead of sending messages."
Jeremy Joslin [Wed, 1 Feb 2017 01:34:16 +0000 (01:34 +0000)]
Merge "Post runnables instead of sending messages."
am: 71317f4a6c

Change-Id: I13cb1fd38262f869b99245678c89f45b834210c8

7 years agoMerge "Post runnables instead of sending messages."
Treehugger Robot [Wed, 1 Feb 2017 01:26:04 +0000 (01:26 +0000)]
Merge "Post runnables instead of sending messages."

7 years agoPost runnables instead of sending messages.
Jeremy Joslin [Tue, 31 Jan 2017 19:51:25 +0000 (11:51 -0800)]
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

7 years agoMerge "Two digit call support for Claro"
Yong Shi [Tue, 31 Jan 2017 19:42:26 +0000 (19:42 +0000)]
Merge "Two digit call support for Claro"
am: c74d60a69e

Change-Id: I18548618853aa37f43114ed7ffdca73c1fc0effc

7 years agoMerge "Two digit call support for Claro"
Treehugger Robot [Tue, 31 Jan 2017 19:30:23 +0000 (19:30 +0000)]
Merge "Two digit call support for Claro"

7 years agoMerge "Update the A2DP Codec Config API"
Pavlin Radoslavov [Tue, 31 Jan 2017 19:07:58 +0000 (19:07 +0000)]
Merge "Update the A2DP Codec Config API"
am: ccd60f7cbe

Change-Id: Idc54b85eb096ec0116395332c7bc0b543a59a7d5

7 years agoMerge "Update the A2DP Codec Config API"
Pavlin Radoslavov [Tue, 31 Jan 2017 19:02:35 +0000 (19:02 +0000)]
Merge "Update the A2DP Codec Config API"

7 years agoUpdate the A2DP Codec Config API
Pavlin Radoslavov [Thu, 26 Jan 2017 00:54:07 +0000 (16:54 -0800)]
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

7 years agoMerge "hotspot2: enclose conditional statement in parenthesis"
Peter Qiu [Tue, 31 Jan 2017 18:21:27 +0000 (18:21 +0000)]
Merge "hotspot2: enclose conditional statement in parenthesis"
am: 161ac8b006

Change-Id: I2da11aee68e52f9e868ca23cbd913703ef0585e3

7 years agoMerge "hotspot2: enclose conditional statement in parenthesis"
Treehugger Robot [Tue, 31 Jan 2017 18:12:56 +0000 (18:12 +0000)]
Merge "hotspot2: enclose conditional statement in parenthesis"

7 years agoMerge "ApfTest: fix flaky testApfFilterRa."
Hugo Benichi [Tue, 31 Jan 2017 06:01:58 +0000 (06:01 +0000)]
Merge "ApfTest: fix flaky testApfFilterRa."
am: c2e8588396

Change-Id: I79c3ec0ba35973cc0dd32709447b2cc30e790d08

7 years agoMerge "ApfTest: fix flaky testApfFilterRa."
Hugo Benichi [Tue, 31 Jan 2017 05:53:51 +0000 (05:53 +0000)]
Merge "ApfTest: fix flaky testApfFilterRa."

7 years agoApfTest: fix flaky testApfFilterRa.
Hugo Benichi [Mon, 19 Dec 2016 05:50:52 +0000 (14:50 +0900)]
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

7 years agohotspot2: enclose conditional statement in parenthesis
Peter Qiu [Tue, 31 Jan 2017 01:47:53 +0000 (17:47 -0800)]
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

7 years agoMerge "[AWARE] Minor hardening of manager."
Etan Cohen [Tue, 31 Jan 2017 01:30:24 +0000 (01:30 +0000)]
Merge "[AWARE] Minor hardening of manager."
am: d0f1c9d1d3

Change-Id: I182e8c10eea318cf1fd3d3fe4da3275df01f851d

7 years agoMerge "[AWARE] Minor hardening of manager."
Etan Cohen [Tue, 31 Jan 2017 01:19:48 +0000 (01:19 +0000)]
Merge "[AWARE] Minor hardening of manager."

7 years agoMerge changes I8eca5f24,I9d79c67c
Jerry Zhang [Tue, 31 Jan 2017 00:52:48 +0000 (00:52 +0000)]
Merge changes I8eca5f24,I9d79c67c
am: 54604d9143

Change-Id: I1e364d21949c9d4c16b14e60c630577399cdce05

7 years agoCheck and send usb state broadcast when devices boots
Badhri Jagan Sridharan [Tue, 31 Jan 2017 00:52:43 +0000 (00:52 +0000)]
Check and send usb state broadcast when devices boots
am: af6d473ab0

Change-Id: I13b0ea530c0701fd32d50d9c145f1b0e574fc9b0

7 years agoOnly send usb disconnect intents after boot.
Jerry Zhang [Tue, 31 Jan 2017 00:51:41 +0000 (00:51 +0000)]
Only send usb disconnect intents after boot.
am: c1bc0a844d

Change-Id: Iaa8ff69de80b3efa558f82438cc6071f749a2dc8

7 years agoMerge changes I8eca5f24,I9d79c67c
Jerry Zhang [Tue, 31 Jan 2017 00:41:55 +0000 (00:41 +0000)]
Merge changes I8eca5f24,I9d79c67c

* changes:
  Check and send usb state broadcast when devices boots
  Only send usb disconnect intents after boot.

7 years agoCheck and send usb state broadcast when devices boots
Badhri Jagan Sridharan [Tue, 24 Jan 2017 00:28:38 +0000 (16:28 -0800)]
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

7 years agoOnly send usb disconnect intents after boot.
Jerry Zhang [Mon, 23 Jan 2017 22:14:09 +0000 (14:14 -0800)]
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

7 years ago[AWARE] Minor hardening of manager.
Etan Cohen [Mon, 30 Jan 2017 21:01:50 +0000 (13:01 -0800)]
[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

7 years agoMerge "SFR sims should treat Spain as roaming"
Torbjorn Eklund [Mon, 30 Jan 2017 20:10:23 +0000 (20:10 +0000)]
Merge "SFR sims should treat Spain as roaming"
am: 06aed6950d

Change-Id: I9500a419373ad590fddc31b638e37af05ac12830

7 years agoMerge "SFR sims should treat Spain as roaming"
Treehugger Robot [Mon, 30 Jan 2017 20:03:11 +0000 (20:03 +0000)]
Merge "SFR sims should treat Spain as roaming"

7 years agoMerge "Bluetooth: add getDiscoveryEndMillis() call"
Marie Janssen [Mon, 30 Jan 2017 17:51:37 +0000 (17:51 +0000)]
Merge "Bluetooth: add getDiscoveryEndMillis() call"
am: 1785fc4eea

Change-Id: Iecb0aaeae57b473c8679c492717fd7c6daad82ac

7 years agoMerge "Bluetooth: add getDiscoveryEndMillis() call"
Marie Janssen [Mon, 30 Jan 2017 17:46:17 +0000 (17:46 +0000)]
Merge "Bluetooth: add getDiscoveryEndMillis() call"

7 years agoMerge "Introduce DEBUG_JAVA_DEBUGGABLE."
Nicolas Geoffray [Mon, 30 Jan 2017 15:15:10 +0000 (15:15 +0000)]
Merge "Introduce DEBUG_JAVA_DEBUGGABLE."
am: 4df43ad959

Change-Id: Iebecb5b77d07bf91820044eda8923b2b30ebfe60

7 years agoMerge "Introduce DEBUG_JAVA_DEBUGGABLE."
Nicolas Geoffray [Mon, 30 Jan 2017 15:09:44 +0000 (15:09 +0000)]
Merge "Introduce DEBUG_JAVA_DEBUGGABLE."

7 years agoMerge "KeySetManagerService: prevent NPE"
Thecrazyskull [Sun, 29 Jan 2017 17:22:13 +0000 (17:22 +0000)]
Merge "KeySetManagerService: prevent NPE"
am: c66327149a

Change-Id: I09d6fb3e2644ab9330b10bd67c44e61a204e589b

7 years agoMerge "KeySetManagerService: prevent NPE"
Treehugger Robot [Sun, 29 Jan 2017 17:14:36 +0000 (17:14 +0000)]
Merge "KeySetManagerService: prevent NPE"

7 years agoBluetooth: add getDiscoveryEndMillis() call
Marie Janssen [Tue, 24 Jan 2017 22:09:59 +0000 (14:09 -0800)]
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

7 years agoMerge changes from topic 'enterprise-client-chain'
Paul Stewart [Sat, 28 Jan 2017 01:52:41 +0000 (01:52 +0000)]
Merge changes from topic 'enterprise-client-chain'
am: c71b5dab72

Change-Id: Icfae9ac89759cd4d18f63dd2da17587bb7fdf96d

7 years agoTest passing null cert/keys to WifiEnterpriseConfig
Paul Stewart [Sat, 28 Jan 2017 01:46:52 +0000 (01:46 +0000)]
Test passing null cert/keys to WifiEnterpriseConfig
am: 88b3c589ad

Change-Id: Ia92c2ad4b7562250aa69d3e8dbb3b8d8607d4136

7 years agoAccount for null client certificate
Paul Stewart [Sat, 28 Jan 2017 01:45:53 +0000 (01:45 +0000)]
Account for null client certificate
am: 1ca57a1d10

Change-Id: Id999634bb25a379a5cfdb47412323d2cc6d0cd30

7 years agoAdd a client chain to WifiEnterpriseConfig
Paul Stewart [Sat, 28 Jan 2017 01:45:05 +0000 (01:45 +0000)]
Add a client chain to WifiEnterpriseConfig
am: 291ddaef78

Change-Id: Ic8451631732bd3bfce7ff08f9f37b18745cda357

7 years agoMerge changes from topic 'enterprise-client-chain'
Treehugger Robot [Sat, 28 Jan 2017 01:38:30 +0000 (01:38 +0000)]
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

7 years agoMerge "Adds @hide ImsResolver API and device overlays (2/3)"
Brad Ebinger [Fri, 27 Jan 2017 23:03:47 +0000 (23:03 +0000)]
Merge "Adds @hide ImsResolver API and device overlays (2/3)"
am: d063843549

Change-Id: I82a38c0cb2b7b229b96f0a617f8b7c921eb6d3a9

7 years agoMerge "Fix a bunch of repeated reads of a ro.* property"
John Reck [Fri, 27 Jan 2017 22:57:29 +0000 (22:57 +0000)]
Merge "Fix a bunch of repeated reads of a ro.* property"
am: 4265991701

Change-Id: I996fbd1002ef788a768b575ab6d2177dc9ab5af1

7 years agoMerge "Adds @hide ImsResolver API and device overlays (2/3)"
Treehugger Robot [Fri, 27 Jan 2017 22:55:15 +0000 (22:55 +0000)]
Merge "Adds @hide ImsResolver API and device overlays (2/3)"

7 years agoMerge "Fix a bunch of repeated reads of a ro.* property"
Treehugger Robot [Fri, 27 Jan 2017 22:49:03 +0000 (22:49 +0000)]
Merge "Fix a bunch of repeated reads of a ro.* property"

7 years agoMerge "Handles #9 as Dial number"
koji.x.shigehara [Fri, 27 Jan 2017 21:38:26 +0000 (21:38 +0000)]
Merge "Handles #9 as Dial number"
am: 3b24c6e1a2

Change-Id: I71b8c65b0dc1fd813f2f962074db217df429c8ef

7 years agoMerge "Handles #9 as Dial number"
Treehugger Robot [Fri, 27 Jan 2017 21:30:42 +0000 (21:30 +0000)]
Merge "Handles #9 as Dial number"

7 years agoAdds @hide ImsResolver API and device overlays (2/3)
Brad Ebinger [Tue, 24 Jan 2017 00:20:33 +0000 (16:20 -0800)]
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

7 years agoTest passing null cert/keys to WifiEnterpriseConfig
Paul Stewart [Fri, 27 Jan 2017 20:03:47 +0000 (12:03 -0800)]
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

7 years agoAccount for null client certificate
Paul Stewart [Fri, 27 Jan 2017 17:37:17 +0000 (09:37 -0800)]
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

7 years agoMerge "Use the new radio_metadata wrapper for safer memory management."
Tomasz Wasilczyk [Fri, 27 Jan 2017 20:32:52 +0000 (20:32 +0000)]
Merge "Use the new radio_metadata wrapper for safer memory management."
am: a9ed0b1c8b

Change-Id: I7f5391cced1db62be2d9b88823d88d2d77f8b065

7 years agoMerge "Use the new radio_metadata wrapper for safer memory management."
Tomasz Wasilczyk [Fri, 27 Jan 2017 20:26:06 +0000 (20:26 +0000)]
Merge "Use the new radio_metadata wrapper for safer memory management."

7 years agoIntroduce DEBUG_JAVA_DEBUGGABLE.
Nicolas Geoffray [Tue, 20 Dec 2016 14:05:05 +0000 (14:05 +0000)]
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

7 years agoMerge "Switch to listening for all network changes."
Erik Kline [Fri, 27 Jan 2017 19:14:39 +0000 (19:14 +0000)]
Merge "Switch to listening for all network changes."
am: 085ffa76fa

Change-Id: I87157788c5c2dc1015f9518c1c443256cfd30bae

7 years agoMerge "Switch to listening for all network changes."
Treehugger Robot [Fri, 27 Jan 2017 19:07:06 +0000 (19:07 +0000)]
Merge "Switch to listening for all network changes."

7 years agoFix a bunch of repeated reads of a ro.* property
John Reck [Tue, 20 Sep 2016 21:24:21 +0000 (14:24 -0700)]
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)

7 years agoMerge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."
Shukang Zhou [Fri, 27 Jan 2017 18:57:12 +0000 (18:57 +0000)]
Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."
am: e924640c4b

Change-Id: I7e56dd815f5ac72b27ac6e2e2ca7614eaa648db1

7 years agoMerge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."
Treehugger Robot [Fri, 27 Jan 2017 18:49:43 +0000 (18:49 +0000)]
Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling."

7 years agoAdd a client chain to WifiEnterpriseConfig
Paul Stewart [Wed, 25 Jan 2017 03:36:05 +0000 (19:36 -0800)]
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

7 years agoUse the new radio_metadata wrapper for safer memory management.
Tomasz Wasilczyk [Mon, 23 Jan 2017 22:36:47 +0000 (14:36 -0800)]
Use the new radio_metadata wrapper for safer memory management.

Bug: b/34054813
Test: VTS, manual - both done in internal branch
Change-Id: I5f4962f86b7732e14c2584a562e9737c92310697

7 years agoMerge "ConnectivityServiceTest: fix flaky tests"
Lorenzo Colitti [Fri, 27 Jan 2017 09:51:32 +0000 (09:51 +0000)]
Merge "ConnectivityServiceTest: fix flaky tests"
am: b8bbd30203

Change-Id: I0577f6b48de8a95e7d12e58a672fb0374ced9403

7 years agoMerge "ConnectivityServiceTest: remove flaky waitForIdle test."
Lorenzo Colitti [Fri, 27 Jan 2017 09:47:05 +0000 (09:47 +0000)]
Merge "ConnectivityServiceTest: remove flaky waitForIdle test."
am: be80577f5b

Change-Id: I444746af6adc7be4a3f69243379f65aadf29ea19

7 years agoMerge "ConnectivityServiceTest: fix flaky tests"
Lorenzo Colitti [Fri, 27 Jan 2017 09:40:46 +0000 (09:40 +0000)]
Merge "ConnectivityServiceTest: fix flaky tests"

7 years agoMerge "ConnectivityServiceTest: remove flaky waitForIdle test."
Lorenzo Colitti [Fri, 27 Jan 2017 09:38:51 +0000 (09:38 +0000)]
Merge "ConnectivityServiceTest: remove flaky waitForIdle test."

7 years agoHandles #9 as Dial number
koji.x.shigehara [Fri, 20 Nov 2015 10:42:53 +0000 (19:42 +0900)]
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

7 years agoMerge changes from topic 'net-sync-aosp-with-stage-aosp' into stage-aosp-master
Lorenzo Colitti [Fri, 27 Jan 2017 00:34:13 +0000 (00:34 +0000)]
Merge changes from topic 'net-sync-aosp-with-stage-aosp' into stage-aosp-master

* changes:
  Captive portals: login activity probes like NetworkMonitor
  Logging improvements in CaptivePortalLoginActivity
  Captive portal systel log improvements
  Fix flaky IpPrefixTest.
  Removing bogus file added by mistake
  frameworks-test: adding missing @SmallTest
  Netd events: record connect() success/errno
  Add missing dependency.
  Show notification for always-on app VPN
  Implement metered tracking for NetworkStats summary queries.
  NetworkMonitor: send one DNS probe per web probe
  NetworkMonitor metrics: add first validation information
  APF: also drop any ICMPv6 RSs
  ConnectivityServiceTest: fix testAvoidBadWifiSettings
  Fix ConnectivityServiceTest testRequestBenchmark
  Switch over to new "time.android.com" NTP pool.
  Define API for metering network stats buckets.
  Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  Use @Ignore to explicitly disable a @Test method.
  Fixed NetworkStatsServiceTest and converted it to JUnit4.
  VPN network stat accounting changes.
  ConnectivityThread: use lazy holder idiom
  ConnectivityManager: use ConnectivityThread looper
  ConnectivityManager: a simpler CallbackHandler
  Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  Add a null check for the OnStartTetheringCallback.
  TokenBucket for rate-limiting and throttling
  IpConnectivityMetrics reads buffer size in settings
  CaptivePortalLogin: set mixed content policy to compatibility.
  Add IP conn metrics to dumpsys and bug reports
  IpConnectivity metrics: add version number
  [CS] Remove timeout event after first available
  ApfTest: tag tests with @SmallTest or @MediumTest
  Unbreak TetherInterfaceStateMachineTest.
  Move the connectivity tests to frameworks/base/tests/net.
  De-guava BroadcastInterceptingContext and move it to testutils.
  Move FakeSettingsProvider to a common location.
  ConnectivityServiceTest: mark flaky test as such
  Add option to skip and avoid captive portals.
  ApfFilter: use elapsedRealTime for RA lifetime
  Do not synchronize boolean reads/writes
  ApfFilter: systematically use u8, u16, u32 getters
  Add fuzzing tests to ApfFilter RA processing
  Support timeouts for requestNetwork() invocations.
  Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network.

7 years agoMerge "Increase the character limit for "Use System Selection" message"
Pavlin Radoslavov [Thu, 26 Jan 2017 23:41:39 +0000 (23:41 +0000)]
Merge "Increase the character limit for "Use System Selection" message"
am: a7ce460921

Change-Id: I3092241c8b1a6e458b3dc2a1332abbf0d19cf786

7 years agoMerge "Increase the character limit for "Use System Selection" message"
Treehugger Robot [Thu, 26 Jan 2017 23:34:36 +0000 (23:34 +0000)]
Merge "Increase the character limit for "Use System Selection" message"

7 years agoMerge changes If5025361,Iabe27cd8
Peter Qiu [Thu, 26 Jan 2017 22:53:13 +0000 (22:53 +0000)]
Merge changes If5025361,Iabe27cd8
am: 0a649bffcc

Change-Id: Ia66d523ed565704178315d66bd19ffe02cbb7560

7 years agohotspot2: added remaining parameters to PasspointConfiguration
Peter Qiu [Thu, 26 Jan 2017 22:53:04 +0000 (22:53 +0000)]
hotspot2: added remaining parameters to PasspointConfiguration
am: ddf6fa06c6

Change-Id: I023acc0ae2920391de8a8de8ee95152f510ca9bd

7 years agohotspot2: add support for complete PerProviderSubscription/Policy subtree
Peter Qiu [Thu, 26 Jan 2017 22:52:11 +0000 (22:52 +0000)]
hotspot2: add support for complete PerProviderSubscription/Policy subtree
am: 2d7af45e93

Change-Id: Icf253102520e81766e726d9247c9614b6c0ebacd

7 years agoMerge changes If5025361,Iabe27cd8
Treehugger Robot [Thu, 26 Jan 2017 22:41:17 +0000 (22:41 +0000)]
Merge changes If5025361,Iabe27cd8

* changes:
  hotspot2: added remaining parameters to PasspointConfiguration
  hotspot2: add support for complete PerProviderSubscription/Policy subtree

7 years agoIncrease the character limit for "Use System Selection" message
Pavlin Radoslavov [Thu, 26 Jan 2017 21:25:40 +0000 (13:25 -0800)]
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

7 years agoMerge "wifi: WifiManager API change for supporting Passpoint Release 2"
Peter Qiu [Thu, 26 Jan 2017 20:25:06 +0000 (20:25 +0000)]
Merge "wifi: WifiManager API change for supporting Passpoint Release 2"
am: 8150581742

Change-Id: I71e7bd9ccdb20ca78e4c8e1b2f653363d668425c

7 years agoMerge "wifi: WifiManager API change for supporting Passpoint Release 2"
Treehugger Robot [Thu, 26 Jan 2017 19:51:36 +0000 (19:51 +0000)]
Merge "wifi: WifiManager API change for supporting Passpoint Release 2"

7 years agoMerge "Integration of the AAC codec for A2DP source"
Pavlin Radoslavov [Thu, 26 Jan 2017 19:20:08 +0000 (19:20 +0000)]
Merge "Integration of the AAC codec for A2DP source"
am: 22f97c83fb

Change-Id: I22838db2b87f83a3832f78d74d08a6f988264284

7 years agoMerge "Integration of the AAC codec for A2DP source"
Treehugger Robot [Thu, 26 Jan 2017 19:12:54 +0000 (19:12 +0000)]
Merge "Integration of the AAC codec for A2DP source"

7 years agowifi: WifiManager API change for supporting Passpoint Release 2
Peter Qiu [Thu, 19 Jan 2017 23:51:27 +0000 (15:51 -0800)]
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

7 years agoIntegration of the AAC codec for A2DP source
Pavlin Radoslavov [Sat, 14 Jan 2017 08:41:05 +0000 (00:41 -0800)]
Integration of the AAC codec for A2DP source

Test: A2DP streaming to AAC headsets
Bug: 30958229
Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d

7 years agoKeySetManagerService: prevent NPE
Thecrazyskull [Thu, 26 Jan 2017 14:59:51 +0000 (08:59 -0600)]
KeySetManagerService: prevent NPE

* If pubKeys is null, we cannot check the size of pubKeys

Test: none

Change-Id: I3b4074d8727b084fea98a0e0a5a0afbd96bea41d

7 years agoSwitch to listening for all network changes.
Erik Kline [Tue, 24 Jan 2017 15:53:04 +0000 (00:53 +0900)]
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

7 years agoCaptive portals: login activity probes like NetworkMonitor
Hugo Benichi [Tue, 13 Dec 2016 23:23:40 +0000 (08:23 +0900)]
Captive portals: login activity probes like NetworkMonitor

This patch changes CaptivePortalLoginActivity captive portal test to be
consistent with NetworkMonitor by:
 - using Network.java to open the http connection.
 - adding a UserAgent property to the request header.

Test: manually tested.
Bug: 32369183

(cherry picked from commit cdf3ba48ccef0f9c6ca8724c1c106df0dd725ad0)

Change-Id: I559eb0497475daad758ba3b3395225dcd0a27a57

7 years agoLogging improvements in CaptivePortalLoginActivity
Hugo Benichi [Tue, 6 Dec 2016 06:36:30 +0000 (15:36 +0900)]
Logging improvements in CaptivePortalLoginActivity

Logging improvements to help debugging captive portal issues.

Test: manually tested
Bug: 33126342

(cherry picked from commit 87de0c206709d3a170649b535a973de8f9c0fb0c)

Change-Id: I52425b849412f6bd5c5ca1f0be7a49cc772497eb

7 years agoCaptive portal systel log improvements
Hugo Benichi [Mon, 21 Nov 2016 04:50:05 +0000 (13:50 +0900)]
Captive portal systel log improvements

This patch improves system logging around captive portal detection to
make inspection of bug reports sligthly easier:

- NetworkMonitor now logs by default CMD_CAPTIVE_PORTAL_RECHECK and
  CMD_CAPTIVE_PORTAL_APP_FINISHED. Other system logs are kept off with
  a new VDBG boolean contant,
- NetworkNotificationManager now prints the notification id at
  notification time. This allows to easily correlate show and clear.
- errors in NetworkNotificationManager are logged as Throwable instead
  of through their implicit toString() method.

Test: $ runtest frameworks-net
Bug: 32198726

(cherry picked from commit 8b025bf108c729156b40159038befa0e6c5bebce)

Change-Id: I1eaab5ea702063dde3e23324d3a1b3dc172c5ac5

7 years agoFix flaky IpPrefixTest.
Hugo Benichi [Thu, 10 Nov 2016 13:45:56 +0000 (22:45 +0900)]
Fix flaky IpPrefixTest.

Test: IpPrefixTest passes
Bug: 32561414

(cherry picked from commit 32c687040301cb3601fd110281a742159a963aa9)

Change-Id: I42928da87f7f336900b3a95ebbf28563864da8d4

7 years agoRemoving bogus file added by mistake
Hugo Benichi [Wed, 7 Dec 2016 05:39:05 +0000 (14:39 +0900)]
Removing bogus file added by mistake

This patch deletes a bogus file added by mistake in the change with
commit hash 147aa6d53bc1e9f8a3632553abcf936023806e1d.

Test: no code change.
Bug: 32198726

Change-Id: Iffc6b3a5ebd854dc81d537576a4405955abacba7

7 years agoframeworks-test: adding missing @SmallTest
Hugo Benichi [Fri, 4 Nov 2016 07:06:34 +0000 (16:06 +0900)]
frameworks-test: adding missing @SmallTest

This activates all frameworks-test tests in runs of the continuous
platform tests.

Test: $ runtest frameworks-net passes (expect Tether
Bug: 32561414
(cherry picked from commit fa8a6f6220d1a0027ba7969c2d3f72690ddc6495)

Change-Id: I7b0706a7e3368f971d508388e8ad4afc5de9d646

7 years agoNetd events: record connect() success/errno
Hugo Benichi [Mon, 31 Oct 2016 06:04:37 +0000 (15:04 +0900)]
Netd events: record connect() success/errno

Test: $ runtest frameworks-net pass
Bug: 32198976

(cherry picked from commit 8b06bcdfd24100302818ae0e11ee751dd813d5cf)

Change-Id: Ib3be06d2678c3fcfe4fa9d7b77f50c6e8812db3d

7 years agoAdd missing dependency.
Lorenzo Colitti [Fri, 9 Dec 2016 05:19:57 +0000 (14:19 +0900)]
Add missing dependency.

Change-Id: I5deb8e03eb368ab7003f9376f7b4459d2ef5e934

7 years agoShow notification for always-on app VPN
Tony Mak [Thu, 30 Jun 2016 10:19:20 +0000 (11:19 +0100)]
Show notification for always-on app VPN

This is the same notification as the one shown during legacy lockdown
mode, sans the 'reset' button.

The notification is only shown during times when VPN has not yet
established or has failed, for example during boot or after a crash.

Bug: 29123115

(cherry picked from commit 1a405fe300950d6ceae2166fd074b596d8110dbe)

Change-Id: I929a05c24df01e21415535a333bb14ac4b790a9d

7 years agoImplement metered tracking for NetworkStats summary queries.
Stephen Chen [Fri, 21 Oct 2016 19:44:26 +0000 (12:44 -0700)]
Implement metered tracking for NetworkStats summary queries.

Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 25147878974f82f875062e99cdee85dd33f3f078)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a

7 years agoNetworkMonitor: send one DNS probe per web probe
Hugo Benichi [Wed, 16 Nov 2016 09:18:08 +0000 (18:18 +0900)]
NetworkMonitor: send one DNS probe per web probe

This patch changes sligthly the two web probes mechanism for captive
portal detection and network validation so that DNS resolution is always
done for both probes.

In general the target web servers of the two parallel HTTP and HTTPS probes
are now different. This introduces a bias in the latency measurement of
th HTTPS probe since this latency will also include DNS resolution in
general.

Test: manual verification + $ runtest frameworks-net
Bug: 32198726

(cherry picked from commit ab61e7c324b24e46829495bc2597e42ea907c53d)

Change-Id: I3b32ae451f2241849fffe24956758a9f571b1ef1

7 years agoNetworkMonitor metrics: add first validation information
Hugo Benichi [Tue, 15 Nov 2016 14:23:24 +0000 (23:23 +0900)]
NetworkMonitor metrics: add first validation information

This patch adds first validation information to:
  - ValidationProbeEvent, by extending the probe_type int field of to
    also include a bit indicating if the probe was part of a first
    validation attempt or not.
  - NetworkMonitorEvent, by defining new contants for the event_type
    field.

Test: $ runtest frameworks-net
      + manually generating events and inspecting the
        output of $ adb shell dumpsys connmetrics list
Bug: b/32198726

(cherry picked from commit 147aa6d53bc1e9f8a3632553abcf936023806e1d)

Change-Id: Ie7a62c4f62a13ce52806d3adaa9e627cb246073c

7 years agoAPF: also drop any ICMPv6 RSs
Hugo Benichi [Fri, 2 Dec 2016 17:41:05 +0000 (02:41 +0900)]
APF: also drop any ICMPv6 RSs

Test: new unit test + $ runtest franeworks-net
Bug: 32833400

(cherry picked from commit f98182ef5e80ede5de7f2c2a5f40fc92a46c9704)

Change-Id: Ifaf6e778c811c7d865c790a293b1fce3f43cad1c

7 years agoConnectivityServiceTest: fix testAvoidBadWifiSettings
Hugo Benichi [Tue, 15 Nov 2016 04:42:34 +0000 (13:42 +0900)]
ConnectivityServiceTest: fix testAvoidBadWifiSettings

This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.

This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.

Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.

With this change the test has been observed to pass with 100% success
rate over 50000 invocations.

Test: $ runtest frameworks-net
Bug: 32561414

(cherry picked from commit 99c8294ef0c7a720364abb5884063e0a9d1bb5fe)

Change-Id: If41a24989d5f65aeb439f68741f511b5eb53b18d

7 years agoFix ConnectivityServiceTest testRequestBenchmark
Hugo Benichi [Tue, 15 Nov 2016 02:25:52 +0000 (11:25 +0900)]
Fix ConnectivityServiceTest testRequestBenchmark

This patch fixes flakyness of testRequestBenchmark by adjusting time
limit for callback registration from 100ms to 180ms, and time limits for
onAvailable and onLost triggers from 30ms to 40ms.

With these timeouts the test succeeds 100% over 5000 iterations.

When using 150ms for registration timeout, running the test 5000 times
fails 2 times.

When using 30ms for onLost timeout, running the test 5000 times fails
1 times.

In addition, this patch also cleans testRequestBenchmark and uses the
more stable SystemClock.elapsedRealtime() for duration measurements.

Test: $ runtest frameworks-net
Bug: 32561414

(cherry picked from commit 38be57b438a0c1754091f045317db2049304e16f)

Change-Id: I196ab9ef7f5abe456a783eed65db09279d2ecb8c

7 years agoSwitch over to new "time.android.com" NTP pool.
Jeff Sharkey [Fri, 2 Dec 2016 19:17:21 +0000 (12:17 -0700)]
Switch over to new "time.android.com" NTP pool.

Also add logging to measure success/failure details.

Test: builds, boots, and NTP fix obtained
Bug: 32969463

(cherry picked from commit d3f689bf14a05de735b5cc92dcf20e7226c78690)

Change-Id: I7da416099ae903fd92beb516251ef4e51673eecf

7 years agoDefine API for metering network stats buckets.
Stephen Chen [Tue, 18 Oct 2016 23:41:47 +0000 (16:41 -0700)]
Define API for metering network stats buckets.

This is a continuation of b/26545374, since now we can also set the
metered bit with NetworkScorer. The tracking of metered state changes
will be implemented in a seperate CL.

Bug: 31015360
Bug: 26545374
Test: N/A

(cherry picked from commit 9ac251d1169639c7b955d63b21e80cbc5c394090)

Change-Id: I6a2fcc8577d62daa8823dff9e0128a5cf39ede7b

7 years agoRefactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
Felipe Leme [Thu, 18 Aug 2016 23:20:01 +0000 (16:20 -0700)]
Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.

Test: m -j32 FrameworksServicesTests && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk && adb shell am instrument -e class "com.android.server.net.NetworkStatsServiceTest" -w "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"

BUG: 30943463

(cherry picked from commit b8f946dc4b24998f14e28573e452ab13ed533347)

Change-Id: Ia9929295ab2396a7ebb133e65d157f98414e4dfa

7 years agoUse @Ignore to explicitly disable a @Test method.
Felipe Leme [Mon, 22 Aug 2016 15:50:43 +0000 (08:50 -0700)]
Use @Ignore to explicitly disable a @Test method.

BUG: 30839080
BUG: 31007021

(cherry picked from commit fc7d7a359f800d7320d29055ef3b4b75157aaf13)

Change-Id: I35942e60493adebb22871541a34240368c691ee7

7 years agoFixed NetworkStatsServiceTest and converted it to JUnit4.
Felipe Leme [Thu, 18 Aug 2016 22:31:45 +0000 (15:31 -0700)]
Fixed NetworkStatsServiceTest and converted it to JUnit4.

Most tests were failing because due to a null NetworkCapabilities.
Example:

1) testNetworkStatsWifi(com.android.server.net.NetworkStatsServiceTest)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkCapabilities.hasCapability(int)' on a null object reference
at
com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:983)

BUG: 30839080

(cherry picked from commit 574f370c6da52eeffe747248d68ef044617c7bcf)

Change-Id: Ie09b2f43cf6ec745e404d5ec98bd0b072d211ea3

7 years agoVPN network stat accounting changes.
Jeremy Joslin [Mon, 8 Aug 2016 23:07:37 +0000 (16:07 -0700)]
VPN network stat accounting changes.

Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871

(cherry picked from commit 8b436d865c9f287e9ae491e5278cd8874f4a865b)

Change-Id: I06f01aa8fe5fdc06b2d36cfb9c68feb244c2e5de

7 years agoConnectivityThread: use lazy holder idiom
Hugo Benichi [Thu, 13 Oct 2016 07:48:42 +0000 (16:48 +0900)]
ConnectivityThread: use lazy holder idiom

This patch changes the way that the ConnectivityThread is lazily
instantiated by using the "lazy initialization holder class idiom".

The first code point that tries to obtain a reference to the unique
ConnectivityThread instance will trigger the creation of the Singleton
class, which will guarantee a thread-safe initialization of the static
INSTANCE field inside Singleton according to the language specs.

This is the Item #71 of Effective Java.

The unique static instance of ConnectivityThread is not stored directly
inside ConnectivityThread class but is stored in a static nested class.
This is to avoid triggering the creation of that unique instance when
Zygote does class preloading at phone startup. Otherwise this would lead
to Zygote creating a new OS thread during preloading, which is a fatal
error.

Test: frameworks-wifi tests pass
Bug: 26749700
Bug: 28537383
Bug: 32130437

(cherry picked from commit c4fe5d373caa9f53686e4d58e61394dd40558957)

Change-Id: If13b363889a8e9396273a90c3d9f9421a48aecbc

7 years agoConnectivityManager: use ConnectivityThread looper
Hugo Benichi [Thu, 7 Jul 2016 01:15:56 +0000 (10:15 +0900)]
ConnectivityManager: use ConnectivityThread looper

This patch removes the static singleton looper used by
ConnectivityManager and instead uses the common ConnectivityThread.

This allows to removes the static atomic counter used to track
the number of registered NetworkCallback in ConnectivityManager, because
the looper is not turned off anymore when no callbacks are registered.

Also an overloaded version of sendRequestForNetwork is added taking as a
new parameter a Handler. This will allow to overload various callback
and request related API calls with user provided Handlers.

Test: ConnectivityServiceTest passes
Bug: 26749700
Bug: 28537383
Bug: 32130437

(cherry picked from commit 7724cdd8b90006c852644d06cf6c8a28450c71c6)

Change-Id: If956addbf8e7b11b36a4b966de7fca00e8f362c1