History log of /frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a9cde8b4fb26a963824f297e9b7489bfc35d1512 20-Jun-2017 Erik Kline <ek@google.com> Create a TetherInterfaceStateMachine when told the interface name.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131
Bug: 62343300

Merged-In: I542e013aa19fefd3443588c9a81ee59cd669ab6f
Merged-In: I973bdc5b540cce66a9713cebfd5071ad4a4b0a08
Merged-In: I2104ecf8102c8f9541ee2d3ce6589b0081db4fe3
Change-Id: I2104ecf8102c8f9541ee2d3ce6589b0081db4fe3
(cherry picked from commit b912c50b197cc0fc49bb7897130581dd02d2af01)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c8b180116d426986a9f180dbf0c6bdf639b7f704 09-Jun-2017 Erik Kline <ek@google.com> Only disable Wi-Fi IP serving on specific interface, if available

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131
Bug: 62343300

Merged-In: Id8d9c3f67f7a850af69069abee86adfc62841b28
Merged-In: Iac19359fd8712fa6a135f31bed9f0da97b3f2977
Merged-In: I99b170ebacc4135d1a09ce1ec3d43f76c6765de4
Change-Id: Ifd9131bad20810ee24c9436d8c0df7a81fae11d5
(cherry picked from commit 218c226b0882640a351deb0dd945a30b8bc32fff)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
db970be0fd9112199725f270613ecf808b886a29 26-Apr-2017 Erik Kline <ek@google.com> Refactor TISM add/remove code

This de-duplicates all the TISM adding and teardown code.
It does not yet change the locking or threading semantics.

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- manual tethering of WiFi and USB start normally
Bug: 32163131
Bug: 36216864
Bug: 62343300

Merged-In: I8ed82272183022a0469011a1f993704ecf771e3f
Merged-In: Ic1bcb3ca011bdc886086f34be18409eb5b12f521
Merged-In: I44a57660d23e76a7c13368cb8f60eaeac5830a0a
Change-Id: I44a57660d23e76a7c13368cb8f60eaeac5830a0a
(cherry picked from commit 4dd9bb83e2779b309dcc7a7db389b16fa3cb05be)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
9e225540687d5d4eb17bdfbe4f062c22ee22b560 08-Jun-2017 Erik Kline <ek@google.com> Delete legacy "wifi interface name guessing" behaviour

Now that Wi-Fi always passes us the AP interface name (and mode)
we no longer need to guess which interface on which we're supposed
to be starting IP serving (either tethering or local-only hotspot).

Test: as follows
- built
- flashed
- booted
- TetheringTest passes
Bug: 32163131
Bug: 62343300

Change-Id: I6019410ee5adff4929690d35ba09294765fcd6a4
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
1454ee750e6dad00b5a908f9e02b10db066dad78 31-May-2017 Erik Kline <ek@google.com> Handle Wi-Fi passing explicit interface name and AP/IP mode

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 31466854
Bug: 32163131
Bug: 62018531
Bug: 62076211
Merged-In: I599813c4b4d866623344df56f62ed6a40b4025d6
Merged-In: I8f1d172a3514e4fb9230af9e09aeaf638f03091c
Change-Id: I3557a9c14f4e9f1de1869084566a179003d98ffe
(cherry picked from commit 2efb827f61db989ab55792052c99713ef5f5eefa)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
292b65a6f11a37b5cbb354fab5587484c2ef4d2e 12-May-2017 Erik Kline <ek@google.com> Expand logging capabilities of Tethering subsystem

Introduce a SharedLog that can be shared among all Tethering
components. All log entries go to the same log, and each includes
its subsystem name. Additionally, all entries emitted to the
system log shared the same tag, so can easily be watched.

More subsystems can inherit a SharedLog, but to minimize cherry-pick
conflicts we limit ourselves to these changes only.

Test: as follows
- built
- flashed
- booted
- log output observed via dumpsys
- runtest frameworks-net passes
Bug: 32163131
Bug: 36988090
Bug: 38218697
Merged-In: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
Merged-In: I2644f518304a03da469fb9c2aa01a6d8f1a97901
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
(cherry picked from commit 7747fd4ce055e8e1f6381062a58b867728f57d85)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
38356e90242dcd74931ef460dc76e6d9f7357c9e 08-May-2017 Erik Kline <ek@google.com> Refactor and improve logging.

Test: as follows
- build
- flashed
- booted
- "runtest frameworks-net" passed
- "dumpsys connectivity" shows new log output
Bug: 32163131
Bug: 36504926

Merged-In: Ieb9a8e3f85f41d18056a7827997f12986ff13ca1
Merged-In: I744b048224e0b8bf6fe4da763833b755441c0911
Merged-In: Ic0c384547687572058d5ef62977163b2560bfc69
Merged-In: Iae91c43d1bfd9fbedc88821a0bd3a5168ad3b719
Merged-In: I52606d4375c9b16de03123995737a994ba58b4d7
Merged-In: I35110b6479280abc650e0ee257045d241923faf9
Change-Id: I14d6da18660223f7cace156cb6594ee18928a7b0
(cherry picked from commit 1fdc2e23b5d8136e06cafd7de896b49e5f929c7f)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7c7ef6ee5c6abb2297516284c6c89a72f7f0eeb9 29-Apr-2017 Erik Kline <ek@google.com> Use ConnectivityService's NETWORK_STACK permission for SoftAp operations

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
Bug: 37647880
Bug: 37750597
Change-Id: I4fb603b7491013bc13b0c08a785eae6cd37337b9
(cherry picked from commit 256be78f7d00c619cca9ed5a550b04fabd4cc48e)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
080f9734d62e1ee34f7d3c9c33ba23e33368a2fc 27-Apr-2017 Erik Kline <ek@google.com> Notify WifiManager of interface state changes

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
(except for an unrelated IpConnectivityMetricsTest error)
Bug: 31466854
Bug: 32163131
Change-Id: I702ea79eb2c02604761e4e1ebcd5f9e445178efb
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
413190bed6630936bcbe881dccba3b6eabcc075e 18-Apr-2017 Erik Kline <ek@google.com> Switch to WifiManager.{start,stop}SoftAp()

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
Bug: 31466854

Change-Id: I730d029128a14b936c111ae159b9708d935f4656
(cherry picked from commit ceb54c63dc7af8f11ec9eac4993a43b9e788ee2f)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5fe3718c6d2722e399c0d572621649c242c067da 20-Apr-2017 Erik Kline <ek@google.com> Clarify IControlsTethering LOCAL_ONLY state name

Test: as follows
- build
- flashed
- booted
- "runtest frameworks-net" passes
- manually starting tethering shows Settings and icon updates
Bug: 31466854
Bug: 32163131

Change-Id: I1f45511f00aca37480f894be4a9a004f1a3b35d7
(cherry picked from commit ca41be796a56fab152cd07bbeaf9283de7e8be90)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
668b722498b4f980dbc63bc26ced11d60acc62e2 17-Apr-2017 Erik Kline <ek@google.com> Add local-only hotspot info into tether state change broadcast

Test: as follows
- build
- flashed
- booted
- "runtest frameworks-net" passes
- manually starting tethering shows Settings and icon updates
Bug: 31466854
Bug: 32163131

Change-Id: I938074587dfeec221c5cdb43a392802ad3fc3589
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5f2b7992cfe1149de115c6f7056d0da128b8afba 10-Mar-2017 Erik Kline <ek@google.com> Tethering: support Local-only Hotspot mode for downstreams

Test: as follows
- built (bullhead)
- flashed
- booted
- "runtest frameworks-net" passes
Bug: 31466854

Change-Id: Ia50e28c8ce0af8cdd7ac63217d921aff213668e7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fe9a53bc45fd0124a876dc0a49680aaf86641d3e 31-Mar-2017 Jeff Sharkey <jsharkey@android.com> Consistent dump() permission checking.

This change introduces new methods on DumpUtils that can check if the
caller has DUMP and/or PACKAGE_USAGE_STATS access. It then moves all
existing dump() methods to use these checks so that we emit
consistent error messages.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: Iaff6b9506818ee082b1e169c89ebe1001b3bfeca
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
282cfefea0fbbd299839e353e6d30affdcd4a55c 27-Mar-2017 Chris Wren <cwren@android.com> standardize system notification IDs

All the trivial cases, plus some fixes to try to
mitigate collisions with the complex ones.

Complex services to follow in another CL,

Bug: 32584866
Test: make framework services
Change-Id: Ie9663600171d8ede11676e9d66f009dbb06def03
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c9c57d4478b6203ca1f298c39dfcfaadce0a63ef 21-Mar-2017 Erik Kline <ek@google.com> Merge "add and incorporate TetheringConfiguration.dump()" am: 9eb959320f am: 9e46faff07
am: d9f71bcf6d

Change-Id: I6b2a5aa4054fc0a2a465b940aea11194d3bc39a8
9e46faff072d51f4b1b0b34f398e082e9f1cf2c1 21-Mar-2017 Erik Kline <ek@google.com> Merge "add and incorporate TetheringConfiguration.dump()"
am: 9eb959320f

Change-Id: I29c80b36ddd14e1e03c88c63d35ee9982dcef887
9db1b546df3934fa0935ed6f434328f4b8d3975b 16-Mar-2017 Erik Kline <ek@google.com> add and incorporate TetheringConfiguration.dump()

Test: as follows
- built (bullhead)
- flashed
- booted
- "runtest frameworks-net" passes
- "adb shell dumpsys connectivity" shows expected output
Bug: 36216864
Change-Id: I2b34bdd286e9b04ffaa5f7d28f3befa0c31a0f5b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
95cad4f774949d9502adc648b94c1524a6a91628 13-Mar-2017 Hugo Benichi <hugobenichi@google.com> Merge "Simple cleanups to Tethering" am: 7eaa2ad172 am: 921c40c0ce
am: bc559bad9d

Change-Id: I393817fac7402d51fbd8dfd1fda20d16b398de17
921c40c0cecbc1975827b946a7fe10eb3f2c3a15 13-Mar-2017 Hugo Benichi <hugobenichi@google.com> Merge "Simple cleanups to Tethering"
am: 7eaa2ad172

Change-Id: I3bb7e4756eaa0b7e702ff7270beb7420b7b6aac5
b55fb220b3c640c967ad17ca7bf0fe63f0bb9f7f 10-Mar-2017 Hugo Benichi <hugobenichi@google.com> Simple cleanups to Tethering

- regroup together static final class fields, final instance fields, and
mutable instance fields.
- uses correct Android naming conventions for instance fields.
- reorder imports correctly.

Test: no functional change.
Change-Id: If3d73bc28972a004c2ba3cc14d869a2a679abfce
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a1d0c089d29e9c721fbe8fc20f87d6940acc6e64 07-Mar-2017 Erik Kline <ek@google.com> Merge "Handle null NetworkState updates" am: ae758b2c7f am: 4cf8f7a8cd
am: b48eb4f71a

Change-Id: Idd5cf1b8de35cca3a7518d6ed76d87044c8846b4
4cf8f7a8cd349821688c7c84339d35448c5bcd67 07-Mar-2017 Erik Kline <ek@google.com> Merge "Handle null NetworkState updates"
am: ae758b2c7f

Change-Id: I9d8d5c176804344a40f6646acf65d2d8a5cd976f
34baa3da4e1f422cc1d7684dcd92bcb8381a7140 07-Mar-2017 Erik Kline <ek@google.com> Handle null NetworkState updates

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- manual USB tethering to WiFi and mobile switching works
Bug: 32163131
Change-Id: I2d4ef7c135ae6eb50cc31236f2fd20080536ea6a
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
108a492d7f97827d377228eb35ab05b340ca39cd 07-Mar-2017 Erik Kline <ek@google.com> Merge "Start of tethering OffloadController" am: 121006f428 am: 4568fa4a82
am: afc5f223e9

Change-Id: Ia918bd348462aefaf0474dfe9a66ec9fa7ef76b8
4568fa4a827a595670ee9145be05807fb9c9cfb9 07-Mar-2017 Erik Kline <ek@google.com> Merge "Start of tethering OffloadController"
am: 121006f428

Change-Id: I590569818c7d7ac50dcc61bd7058bd7c5cad4e77
e0cce21f4d92d89870ebf18e82f0fb9ba7a1f10d 06-Mar-2017 Erik Kline <ek@google.com> Start of tethering OffloadController

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131
Change-Id: If8f7df069f37f1b3d440d446ab1b160a52ba9e09
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
af759c52ce01fe6b5144957e38da956af01a217b 15-Feb-2017 Geoffrey Pitsch <gpitsch@google.com> Channels for Frameworks notifications

Adapts all notifications used by system services to use channels.
Channels are initialized by SystemServer after the NotificationService
has started.

Test: runtest systemui-notification
Change-Id: I25c45293b786adb57787aeab4c2613c9d7c89dab
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
0703f03953d21a884851c2612ac64d66f158b945 01-Mar-2017 Erik Kline <ek@google.com> Merge "Fix dead lock in Tethering state machine"
am: 355dbae680

Change-Id: Idd08726f3eeebba49a9ad909464377af67600d30
355dbae680994002c48d7a66cb276a65393ecbbb 01-Mar-2017 Erik Kline <ek@google.com> Merge "Fix dead lock in Tethering state machine"
8eb1fbf1bca71b94f6c5c8b8b4294942fb1792ee 15-Feb-2017 Erik Kline <ek@google.com> Merge "Split chooseUpstreamType() into two separate functions" am: 7a42d3ad83
am: f6d55d7e9e

Change-Id: Ibd6b1fae52ec31ae488484be727b5261820e6ecb
23d077318c96b8c44006b9df53c4d7c0bd758bb0 15-Feb-2017 Erik Kline <ek@google.com> Merge "Slightly simplify mTryCell and requestUpstreamMobileConnection() usage" am: 63445824d6
am: 4650762557

Change-Id: Ie004da6fe1252ddec90204637ff17c3ed73f2923
7a42d3ad83cbb3e7f98964eb876b8b21bd46816a 15-Feb-2017 Erik Kline <ek@google.com> Merge "Split chooseUpstreamType() into two separate functions"
977aad5a654ebd2cfbc73db8c6e4020c4bedad97 08-Dec-2016 Yohei, Oshima <yohei.x.oshima@sonymobile.com> Fix dead lock in Tethering state machine

This fix is for tethering from N MR1. It reserves the same idea
originally in e4bdfd8ad86a013c5a2ee8964119393cea1ec4a3.

Tethering is animated by two state machines. If an error occurs,
one of the state machine notifies the other and definitely stays
in the error state while the other retries the tether operation
after having treated the error.

An example is when dnsmasq is started by calling tether(), but while it
hasn't finished starting yet untether() is called asynchronously
by a different tethering. Then "Setting DNS forwarders failed!" error
occurs and device can't be tethered anymore without reboot.

This patch allows to clear the error of the blocked state machine
from the other one and thus recover a normal cycle.

Test: fastly switching USB/Wi-Fi tethering On/Off repeatedly
Test: manually kill dnsmasq during BT tethering then turn on
Wi-Fi tethering

Change-Id: Ide062dd4c15a0e7c72eced9a5fe807f845d4ea9c
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
14f7faf78e048b7209551cc32ac50b2673e15409 14-Feb-2017 Erik Kline <ek@google.com> Split chooseUpstreamType() into two separate functions

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131
Change-Id: If892864ff59a6f38340791597c2d9e5b4022bbfa
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fb41343c8c0649ff941808d3e6fadf3d6ea53b78 14-Feb-2017 Erik Kline <ek@google.com> Slightly simplify mTryCell and requestUpstreamMobileConnection() usage

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131

Change-Id: I46fbd176a71e61552d7d92660c1debe6487a1edf
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5c6041843d3d6c472cf85b3e5b3857593019116e 03-Feb-2017 Jack Yu <jackyu@google.com> resolve merge conflicts of e06c03d8437f to nyc-mr1-dev-plus-aosp

Test: Manual test
Change-Id: I13f288c5056b672eec00f850f9d2ee6db73b7a44
f565a487bba4d90bf24f518a7f1e0166ee26bd39 02-Feb-2017 Jack Yu <jackyu@google.com> Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564 am: 40d0753b10 am: 413922e746 am: 426f454b69 am: fab95f8ad6 am: 37d3b12aa1 am: 73056d5feb
am: ecadb9d7cb

Change-Id: I85221b6dc0097893ec6d5d3fbbe09d549ecc1b18
ecadb9d7cb028742af02feb3f0906cf619fdba11 02-Feb-2017 Jack Yu <jackyu@google.com> Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564 am: 40d0753b10 am: 413922e746 am: 426f454b69 am: fab95f8ad6 am: 37d3b12aa1
am: 73056d5feb

Change-Id: Id542f20e2e11baae9b6281af86d8f0dbe12d08b3
73056d5feb96900a5bfd3db2099437dd6182192b 02-Feb-2017 Jack Yu <jackyu@google.com> Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564 am: 40d0753b10 am: 413922e746 am: 426f454b69 am: fab95f8ad6
am: 37d3b12aa1

Change-Id: I751c29efc17d371905f5d70460e65744c63ec1fc
413922e746bcf628a59f193f9f4b0dc2dc1c5103 02-Feb-2017 Jack Yu <jackyu@google.com> Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564
am: 40d0753b10

Change-Id: I1f8a897862c69a475c6d12a824bd69ed8692cd99
f537c5eb74bfdd8942dca986e35d46ab2444491d 28-Oct-2016 Lorenzo Colitti <lorenzo@google.com> Unbreak TetherInterfaceStateMachineTest.

This was broken by the implementation of IPv6 tethering, which
relies on various private classes which end up calling unmockable
final classes like NetworkInterface.

Making everything public like this is almost certainly not the
best way of fixing this test, but on the other hand there is
value to the test continuing to pass.

Test: runtest frameworks-net # Everything passes.
Test: IPv6 tethering continues to work.

(cherry picked from commit 7e0eeca8ba4063d0d35dda9a8dfcc612e45efb87)

Change-Id: I8a3cf466871c026f4ae0f5cfa73071338cdf5b7e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
555812a3e2ec4c92dc3835797eb3e524b67709cb 24-Jan-2017 Erik Kline <ek@google.com> Merge "All upstream mobile connection management is now in UpstreamNetworkMonitor"
am: c1987487a2

Change-Id: I2b7e0f63c8198c8fde52396f989c16d795e612a8
5645af4e2ab80180012e421b4fbf1f352d45ce3e 23-Jan-2017 Erik Kline <ek@google.com> All upstream mobile connection management is now in UpstreamNetworkMonitor

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131

Change-Id: Ifbd430d5bf2d2191469c9810ad8f073506abde46
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a3d5657027b84e28355a9d711dfae5b3f5f39183 21-Jan-2017 Erik Kline <ek@google.com> Move TetheringConfiguration out to its own file

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net
- vanilla tethering works
- changing from no dun requirement to dun shows dun required
Bug: 32163131

Change-Id: I488449570dff057311b37335923ce6a199b363b7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
79868f8c5759645c576ec448479ee2d73dac3ec6 21-Jan-2017 Erik Kline <ek@google.com> Move TetheringConfiguration out to its own file

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net
- vanilla tethering works
- changing from no dun requirement to dun shows dun required
Bug: 32163131

Change-Id: I488449570dff057311b37335923ce6a199b363b7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
72c17a72349fcd763f17aec75bb5c3e2558eb920 23-Jan-2017 Erik Kline <ek@google.com> Merge "More concisely export whether we have a "tetherable configuration""
am: 1b2a1b911d

Change-Id: I5f9717c9dab6b39f1fbf2186107b2a1f3f2d4f8f
d781fbad3fa0156bd4c6715fa6522fbef5a325e5 23-Jan-2017 Erik Kline <ek@google.com> More concisely export whether we have a "tetherable configuration"

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- vanilla WiFi-to-mobile tethering works
Bug: 32163131
Change-Id: I20dd36b5bf7fc55a639c76ea4bdb55b650654881
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
ec45953fd765a55edef96bad94d63b37d34ef5f5 21-Jan-2017 Erik Kline <ek@google.com> Move several config elements into TetheringConfiguration class
am: 3e7566572e

Change-Id: Ic053965b54eed0afc9a4785ce80ef1fab281493a
74247b4ee884678903f994c2a935898858b79501 20-Jan-2017 Erik Kline <ek@google.com> Merge "Refactor to SimChangeListener class"
am: a12217012e

Change-Id: I863f0b23251a0ebd18a76cf08e1ff0f2cee9cda3
3e7566572eee41b20f15e6fcf2f81204649d3dc8 17-Jan-2017 Erik Kline <ek@google.com> Move several config elements into TetheringConfiguration class

Encapsulate the following config elements:
- all interface name regular expressions
- specification of preferred upstreams
- downstream DHCPv4 ranges
- default IPv4 (and IPv6) DNS servers

Test: as follows
- builds
- flashed (bullhead)
- runtest frameworks-net passes
Bug: 32163131
Change-Id: Ife4871c0b89d2d52e2cc9238e0606b428287521c
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a12217012ef5cf3cf05d382496dd69da3ad492f7 20-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Refactor to SimChangeListener class"
b6f606b59f34cea32beef51dc46d99b20aaf9ba0 20-Jan-2017 Erik Kline <ek@google.com> Merge "Address comments from previous change (320592)"
am: e7cb6c3761

Change-Id: I3266a02a4a2fd76c4bb2f1a744103add63307e26
54cb4c5800197179bfce9f850df4dec72e1b3f56 17-Jan-2017 Erik Kline <ek@google.com> Refactor to SimChangeListener class

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameswork-net passes
- tested wifi-to-mobile tethering, including SIM remove/insert
Bug: 32163131
Change-Id: I6aac9a8f34cfd0079a4433471ec08b9b1ec0d754
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
efdd3f4ce04d3e1741831982ff86a58da6b542d3 20-Jan-2017 Erik Kline <ek@google.com> Address comments from previous change (320592)

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- vanilla wifi-to-mobile tethering works
Bug: 32163131

Change-Id: I8788cb0d93606a2893c3dbc4f22e72f450f319b8
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
bcdd7475e529c04ac64241d49387bb0cf7ed1ec9 20-Jan-2017 Erik Kline <ek@google.com> Merge "BroadcastReceiver refactoring"
am: 73a57bb9da

Change-Id: Iafb0aa75c564aeb4c0181ef0dbacc6de4527480a
2e88b5e67498336707f71fe8fc7636773634ebf9 18-Jan-2017 Erik Kline <ek@google.com> BroadcastReceiver refactoring

All registerReceiver() calls now specify to be run on the tethering
master state machine's handler. Eventually, some of the locking might
be removed (requires careful review, later).

Also: slightly refactor StateReceiver for readability

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- vanilla tethering from WiFi to mobile works
Bug: 32163131
Change-Id: I39844f6e1608179ebeb41668a6db8a4e44d30ecf
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
91a0bc956445c1a0fa099d3e8e87affe217519f7 16-Jan-2017 Jack Yu <jackyu@google.com> Fixed the logic for tethering provisioning re-evaluation

Previously we only re-evaluate provisioning for SIM swap case
The new logic covers both SIM swap case
(ABSENT->NOT_READY->UNKNOWN->READY->LOADED) and modem reset
case (NOT_READY->READY->LOADED)

Test: Manual
bug: 33815946

Change-Id: I9960123605b10d3fa5f3584c6c8b70b616acd6f8
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c498f6301e927f241e7e5ab6ac5a3be0dccb2c74 16-Jan-2017 Erik Kline <ek@google.com> Merge "Extract UpstreamNetworkMonitor to its own file"
am: 8df5bd1028

Change-Id: I7973c74952efb1abe9309eedfdf829af39467463
9bba340fd4edd5aea91d612a332f964b0d63cf34 13-Jan-2017 Erik Kline <ek@google.com> Extract UpstreamNetworkMonitor to its own file

Test: as follows:
- built (bullhead)
- flashed
- booted
- runtest framworks-net passes
Bug: 32163131

Change-Id: I87ff041e008e45065c9722de8130df53684fb2a9
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7340e272c366130021c3a1a83f4ae7704785a68e 13-Jan-2017 Erik Kline <ek@google.com> Move explicit mobile request handling into UpstreamNetworkMonitor
am: fdd4111ef6

Change-Id: If452982fdc47cf0e655c7f079c1be3f535ec6c03
fdd4111ef6891132530cb2f329758a47d9370649 12-Jan-2017 Erik Kline <ek@google.com> Move explicit mobile request handling into UpstreamNetworkMonitor

Also:
- some minor typo fixes
- some minor style fixes
- variable renames for clarity

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- regular (no DUN) wifi tethering to mobile works
- USB tethering with switching between mobile and wifi works
Bug: 32163131
Change-Id: I113536f24436f0b962f402f3b37386e29468dc0a
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
cbd3d8b3568cd21af3c5800a6e5442a4f0763f98 12-Jan-2017 Erik Kline <ek@google.com> Merge "Simplify UpstreamNetworkMonitor callback handling"
am: f9f5cf9d9b

Change-Id: I642567d81b6b8908b2ef7afea8d15628330481f9
452b4b72181d71373238dea3d261cf789f6c90fb 11-Jan-2017 Erik Kline <ek@google.com> Simplify UpstreamNetworkMonitor callback handling

In the callback post a lamba to the target state machine's handler
that does the processing we need before sending a notification to
the state machine.

No semantic change, just a bit cleaner.

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- tested basic wifi-to-mobile tethering (no DUN)
Bug: 32163131
Change-Id: I07e1b510c1ebaa5dffd42a3f16ba96e961cb58f1
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d48902d37e5ae8ef08ac3923f52bf1e027ffff08 11-Jan-2017 Erik Kline <ek@google.com> Merge "Prepare UpstreamNetworkMonitor for extraction"
am: f84e5e8f76

Change-Id: I4e4d525ff1dc23189e4ef6978a1980319d6b85f2
ebdb8c8e2243547ea01690ce300406bc225030c8 10-Jan-2017 Erik Kline <ek@google.com> Prepare UpstreamNetworkMonitor for extraction

Test: as follows:
- built (bullhead)
- flashed
- booted
- runtest frameworks-net
- tested basic wifi-to-mobile tethering (no DUN)
Bug: 32163131
Change-Id: Id0b2497f231af5e79ae3bbf42c73bc78031b6fa3
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5bce5a16b17498981253d7a2d1a490667cd71798 28-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest.

This was broken by the implementation of IPv6 tethering, which
relies on various private classes which end up calling unmockable
final classes like NetworkInterface.

Making everything public like this is almost certainly not the
best way of fixing this test, but on the other hand there is
value to the test continuing to pass.

Test: runtest frameworks-net # Everything passes.
Test: IPv6 tethering continues to work.

(cherry picked from commit 7e0eeca8ba4063d0d35dda9a8dfcc612e45efb87)

Change-Id: I8a3cf466871c026f4ae0f5cfa73071338cdf5b7e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5cbd151d401b28ee33cf7405f5d56b12a15dc9fe 17-Nov-2016 Jerry Zhang <zhangjerry@google.com> Refactored setCurrentFunction and setUsbDataUnlocked into single method.
am: 935372bfd6

Change-Id: I5436278e092f691c9179f7cc3709c4578b544e74
935372bfd642f15afc6488f7df100f1bf76fc773 13-Oct-2016 Jerry Zhang <zhangjerry@google.com> Refactored setCurrentFunction and setUsbDataUnlocked into single method.

This gets rid of an extraneous configuration change when going from
adb to adb + file transfer as previously the config would have been
reset once for functions and once for data unlocked.

It also simplifies some of the code.

Test: manually changing usb configurations
Change-Id: Ica10a195338b2189db13113f44657393db110bee
(cherry picked from commit 7a396be6d5ba8914933a54b5bfac25e118db0e9f)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c29f2575f2f1224a3b08fe688975317f0d03c51b 25-Oct-2016 Christopher Wiley <wiley@google.com> Merge "Add unit tests for Tethering.isTetherProvisioningRequired"
am: 836ffa6e1c

Change-Id: I1dab386e3891c01a2917c32847d2aecdbfa10102
497c147b821cf1c441f5047a5035281dc23e8bd9 11-Oct-2016 Christopher Wiley <wiley@google.com> Add unit tests for Tethering.isTetherProvisioningRequired

Check that we tolerate various dependencies not being available.

Bug: 31946071
Test: These are tests

Change-Id: Ic0a9cd6f255ba9ff4c774dee640df1a0bdf8dc39
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
87e801411721932a4e74e84ec96d185a64875df5 04-Oct-2016 Rebecca Silberstein <silberst@google.com> Tethering: check if configManager is null

cherry-picked from b07f1409045091476e5296f9b0dd41c8712fe49a

Before attempting to retrieve a carrier entitlement setting, first make
sure we have a carrier config manager and if we do have a carrier config
manager, the config it holds is not null.

Bug: 31929638
Test: unittests coming in follow on CL
Change-Id: Iee476c476cb3de109cdccbd955b7fb986dd4267b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
b07f1409045091476e5296f9b0dd41c8712fe49a 04-Oct-2016 Rebecca Silberstein <silberst@google.com> Tethering: check if configManager is null

Before attempting to retrieve a carrier entitlement setting, first make
sure we have a carrier config manager and if we do have a carrier config
manager, the config it holds is not null.

Bug: 31929638
Change-Id: Iee476c476cb3de109cdccbd955b7fb986dd4267b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fa6a48661576d2bd93b5e817d3629cca0a50e6c6 19-Sep-2016 Christopher Wiley <wiley@google.com> Implement untetherAll as calls to stopTethering

(cherry-pick of 5df6ed4a878c778971f388e3cb88e53b8db43b35)

Calling untether() on an interface name leaves the system
in an inconsistent state, since this is an API for use by
network subsystems to start or stop the tethering of a prepared
downstream network interface. The proper way to disable tethering
is to call stopTethering() with an appropriate technology.

untetherAll() is called in parts of the system UI to disable
all tethering on system state changes (e.g. on the enabling
of data saver).

Bug: 31405407
Test: Enabling data saver now correctly disables tethering
Change-Id: I8e5724a31e015721910a8d278e100daf697c34d7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
deebfec90b9e79d0c193464bcd2418d3d5d3de73 16-Sep-2016 Christopher Wiley <wiley@google.com> Notify NetworkPolicyManagerService on tethering changes

(cherry-pick of d73faf07606d40d3915d22a72fa14f7ba956d459)

No longer do this in ConnectivityService#tether/untether.
Instead, have Tethering do it when an interface is actually
tethered.

Bug: 31405407
Test: Toggling hotspot now disables data saver

Change-Id: I9910a2e488c30c92d45f817c8f5df0fac5510de6
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5df6ed4a878c778971f388e3cb88e53b8db43b35 19-Sep-2016 Christopher Wiley <wiley@google.com> Implement untetherAll as calls to stopTethering

Calling untether() on an interface name leaves the system
in an inconsistent state, since this is an API for use by
network subsystems to start or stop the tethering of a prepared
downstream network interface. The proper way to disable tethering
is to call stopTethering() with an appropriate technology.

untetherAll() is called in parts of the system UI to disable
all tethering on system state changes (e.g. on the enabling
of data saver).

Bug: 31405407
Test: Enabling data saver now correctly disables tethering
Change-Id: I8e5724a31e015721910a8d278e100daf697c34d7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d73faf07606d40d3915d22a72fa14f7ba956d459 16-Sep-2016 Christopher Wiley <wiley@google.com> Notify NetworkPolicyManagerService on tethering changes

No longer do this in ConnectivityService#tether/untether.
Instead, have Tethering do it when an interface is actually
tethered.

Bug: 31405407
Test: Toggling hotspot now disables data saver

Change-Id: I9910a2e488c30c92d45f817c8f5df0fac5510de6
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
05f86d1eec26b588caf45dbfb5a412176428e0a7 14-Jul-2016 Christopher Wiley <wiley@google.com> Properly disable WiFi tethering

When Tethering.stopTethering(<wifi>) is called, we set
mWifiTetheringRequested to false and request the AP be torn down.
Previously, we would discard WIFI_AP_STATE_CHANGED_ACTION Intents,
because mWifiTetheringRequested was set to false. This would in
turn cause us to leave tethering enabled, because we only tear down
tethering upon noticing that the interface is going down
(as signalled by WifiManager via this Intent).

In the past, this was covered up because we would tear down tethering
when the interface was taken down. Now that we rely on SoftApManager
to notify us of AP state, we need to pay very close attention to what
is being said about the state.

Bug: 30124308
Test: Can toggle tethering on and off reliably on shamu, bullhead,
angler with no SIM.

Change-Id: If46a8ee11cf4c07c5cc336523f5e5f00273500ec
(cherry picked from commit e52b24a0c52c6e29ea99760c920724f4143ac605)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
9c820cdebf1ee13e63d5706c71750df292bd5d3d 08-Jul-2016 Christopher Wiley <wiley@google.com> Stop listening for WiFi interface status changes

Bug: 29931437
Test: Can toggle tethering on and off repeated on shamu and an
upcoming device, both devices without a SIM.
Test: Can toggle tethering on and off repeated on an
upcoming device with a T-Mobile SIM.

Change-Id: I4986b1a5f6ae9b45010bd30639806f7ed63a605c
(cherry picked from commit d30aaeb2148edbc0c7a97699a41c450c0591b983)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
e90e0a74adf33f3d0ed0f2617520ab72b3b5d624 31-May-2016 Christopher Wiley <wiley@google.com> Fix race conditions between Tethering and TetherInterfaceStateMachine

Previously, Tethering would answer requests for current tethering state
by calling methods on instances of TetherInterfaceStateMachine to build
up that state. This is incorrect, since state queries can come in on an
arbitrary thread, independent of updates to the state machines
instances.

Fix this by:
- Altering TetherInterfaceStateMachine to push consistent state
snapshots to Tethering via notifyInterfaceStateChange()
- Storing the last state snapshot in Tethering.mTetherStates
- Removing public methods to query TetherInterfaceStateMachine state.
- Consistently synchronizing access to Tethering.mTetherStates

Bug: 29009601
Test: WiFi Tethering continues to work, unittests continue to pass

Change-Id: Ied334f5e8739bc3aff1b08a1079095b9cc2a7958
(cherry picked from commit de4819dc82b734036b22416228327d2712e01884)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
cd0cfbbc61168b61360a6247b4a826494deb3912 31-May-2016 Christopher Wiley <wiley@google.com> Tethering: Own WiFi tethering state and lifetime

- Add logic to Tethering to track whether the user has requested
tethering via WiFi.
- Subscribe to intents regarding soft AP state to enable and
disable tethering when the AP comes up or goes down.
- Refactor IP configuration logic to do configuration for WiFi
as well as USB.

Bug: 29054780
Test: WiFi tethering continues to work on angler
Tethering related unittests continue to pass.

Change-Id: I6eff2573ca3fd11fabcf138c468ba517ff2daf65
(cherry picked from commit f1315c3cd6d77e812ae32fe038b4e8bf2e70d5bf)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
46c5e17aa884273057bf52b6fb49dfe7cdf97356 27-May-2016 Christopher Wiley <wiley@google.com> Use an ArrayMap instead of HashMap to track tether interfaces

Since the number of tetherable interfaces should be small (e.g. <10),
the computational cost of a looking up objects in an ArrayMap is negligible,
and the memory required is less than a HashMap.

While here, remove some unused imports.

Change-Id: I3fb7091cfb93697d2fc6388b843d60f7e8e7e1a6
Test: Compiles.
(cherry picked from commit 36f6f4e394750e4989d78f38a31ab8f2f66c07f7)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
afc46a7cbfec7150c35716b3aba0f20b08115e92 23-May-2016 Christopher Wiley <wiley@google.com> Rely on Tethering mutex for TetherInterfaceSM

Stop passing Tethering's mutex into TetherInterfaceSM, and instead
simply rely on Tethering to acquire its own mutex when accessing
instances of TetherInterfaceSM.

While here, remove some boolean fields (previously guarded by the mutex)
which duplicate state information.

Change-Id: Ie6b2128970981786a5d64fbf700c9f3d0a6721fb
Test: Compiles, unittests pass, WiFi tethering continues to work.
Bug: 28910007
(cherry picked from commit 4bc8d6b1ac0cb7d4192c829a44d988516f0adbdb)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
4622c2d8b65e267ede15bffd903faaf917642d7e 24-May-2016 Mitchell Wills <mwills@google.com> Rename TetherInterfaceSM to TetherInterfaceStateMachine

Change-Id: I324690b20f37cef6d58872e21b126a87d16f7ec8
(cherry picked from commit c5baad02503d17a812ee1b44cc817c7e18935ff1)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
0f6605721e1778f67c3bca08401dab95712a6f9a 21-May-2016 Christopher Wiley <wiley@google.com> Remove transient StartingState from TetherInterfaceSM

This state immediately switched into the TetheredState.
We can safely remove it at only the expense of a misleading state
broadcast.

Bug: 28798823
Test: runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest

Change-Id: I295d830dbdb11717d6e05161d97787ffe871beb3
(cherry picked from commit 79e7fde00d74c2b6d329f7341029ea6b04ac2d97)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
48c7d465063f17da93f56d1dbda1efb3c8124c1e 19-May-2016 Christopher Wiley <wiley@google.com> Extract TetherInterfaceSM to its own class.

Attempt to keep all existing logic in place, except:

+ Marked a constructor as public, rather than default visible.
+ Added TAG, DBG, VDBG, and decoder ringer statics.
+ Moved static constants related to USB IPs into TetherInterfaceSM.

Bug: 28833951
Test: WiFi Tethering works on angler.

Change-Id: Id961220a9045832354cfe7381e5e9c0d8f54bf90
(cherry picked from commit e3f93b02bdfde6fffd2bcbb2e1dc0785ce9f8d5a)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
0cbdaccf7182ba0ff6011a9d0e952584007101e0 18-May-2016 Christopher Wiley <wiley@google.com> Make Tethering.TetherInterfaceSM more self contained

Remove references from the class into the containing class:
- Move functionality to bring up a USB interface into the class itself.
- Extract an interface to wrap methods where TetherInterfaceSM was
calling into other private classes of Tethering
- Inject necessary dependendencies into TetherInterfaceSM instances.

Bug: 28833951
Test: Compiles.

Change-Id: Ic96947417cf8734072d027b0f1cba8a1a1be7a74
(cherry picked from commit 9a509ca728fbe264e1a5a6ccd5b39ffc0b5eceb4)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d2c287326f6af897715d12dc12d293cc151fe170 17-May-2016 Christopher Wiley <wiley@google.com> Clean up class members in Tethering.TetherInterfaceSM

Mark final fields as such.
Group mutex protected fields together with the mutex that protects them.
Always access mutex protected fields under the mutex.

Bug: 28798823
Change-Id: I96cdd5e063babb73e9f124107c5576c47801f34b
Test: Compiles, Wifi tethering continues to work on angler.
(cherry picked from commit 7b30e548a58ac96a23033db43c7aac79c86e938c)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
938f5e8dd3c767c0ee14924ed2568b4baf158da2 17-May-2016 Christopher Wiley <wiley@google.com> Fix trivial warnings in Tethering.java

Add some missing @Override annotations.
Use template arguments to avoid explicit casting.
Ignore unclosed IndentingPrintWriter in dump().

Bug: 28798823
Test: Compiles.

Change-Id: I2cb6eb384ca23057c8059f4842b1c0d8248d03f8
(cherry picked from commit 6d475970a200f162ba6845d25bb2a777bcaa611c)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6e29bf0069caceb38806101c150acb477df99989 15-Aug-2016 Erik Kline <ek@google.com> Support tethering IPv6 toward the first requested downstream.

We no longer tether toward wifi only, but rather implement 64share toward
the current, oldest (first requested) active downstream.

Additionally, explicitly ban IPv6 tethering toward Bluetooth until
PAN support is figured out.

Bug: 30298058
Change-Id: Ib705b69eae767ec50131d09d26168d9e041e4bc0
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fa37b2f6135a532742ef8242e70dbf499abe8d95 02-Aug-2016 Erik Kline <ek@google.com> Handle setting and deprecating local DNS IPv6 addresses

[ IPv6TetheringCoordinator ]

- Send CMD_IPV6_TETHER_UPDATE to all TetherInterfaceStateMachines.

This results in some spurious noop messages, but currently
the coordinator does not maintain state about which downstream interaces
are serving IPv6 and which are not. Until it does maintain such state
it does not know to notify only the affected interfaces about a loss of
IPv6 upstream

[ IPv6TetheringInterfaceServices ]

- De-dup incoming IPv6-only LinkProperties to avoid spurious updates
to the RA daemon.
- Keep track of new prefixes/dns and newly deprecated prefixes/dns
on each update.
- Set and remove local_network routes based on new and newly
deprecated prefixes.
- Set and remove local DNS server IP addresses based on new
and newly deprecated DNS servers. Update dnsmasq via netd
accordingly.
- Pass newly deprecated and new information to the RA daemon.

[ RouterAdvertisementDaemon ]

- Receive newly deprecated prefixes/DNS and update local tracking
data structures accordingly.
- Properly send urgent final deprecation RAs, and then cease all
transmissions.

Bug: 30298058
Change-Id: Idc821603fa93bff1a821d1180d4135bc70e4a08d
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
f3d9863d5ed956889394459d055fbe80638d7065 15-Jul-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Properly disable WiFi tethering" into nyc-mr1-dev
e52b24a0c52c6e29ea99760c920724f4143ac605 14-Jul-2016 Christopher Wiley <wiley@google.com> Properly disable WiFi tethering

When Tethering.stopTethering(<wifi>) is called, we set
mWifiTetheringRequested to false and request the AP be torn down.
Previously, we would discard WIFI_AP_STATE_CHANGED_ACTION Intents,
because mWifiTetheringRequested was set to false. This would in
turn cause us to leave tethering enabled, because we only tear down
tethering upon noticing that the interface is going down
(as signalled by WifiManager via this Intent).

In the past, this was covered up because we would tear down tethering
when the interface was taken down. Now that we rely on SoftApManager
to notify us of AP state, we need to pay very close attention to what
is being said about the state.

Bug: 30124308
Test: Can toggle tethering on and off reliably on shamu, bullhead,
angler with no SIM. Can toggle tethering on and off on a marlin
with T-Mobile SIM.

Change-Id: If46a8ee11cf4c07c5cc336523f5e5f00273500ec
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
00019f42044189e4447fd7bcf370159e23a50c2a 30-Jun-2016 Erik Kline <ek@google.com> More correctly track upstream network properties.

Bug: 9580643
Change-Id: I5c8da4d591236ddb7f20256baad5c41dd008b25c
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
1eb8c69bed1615e9502e94b1a676773ed28abfd9 08-Jul-2016 Erik Kline <ek@google.com> Add IPv6 tethering coordinator

Add an IPv6TetheringCoordinator to TetheringMaster StateMachine, which
receives and processes NetworkState updates and passes the necessary IPv6
information to the revelant TetherInterfaceStateMachine.

Add an IPv6TetheringInterfaceServices to TetherInterfaceStateMachine, which
is responsible for adding local network routes and managing an IPv6
RouterAdvertisementDaemon.

Bug: 9580643
Change-Id: I3eaae460b80752e2115359d7bde873a1e9ea515a
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d30aaeb2148edbc0c7a97699a41c450c0591b983 08-Jul-2016 Christopher Wiley <wiley@google.com> Stop listening for WiFi interface status changes

Bug: 29931437
Test: Can toggle tethering on and off repeated on shamu and an
upcoming device, both devices without a SIM.
Test: Can toggle tethering on and off repeated on an
upcoming device with a T-Mobile SIM.

Change-Id: I4986b1a5f6ae9b45010bd30639806f7ed63a605c
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d985dde8ccfd38a50377a8ab2378b36c92b0d7c7 31-May-2016 Christopher Wiley <wiley@google.com> Fix race conditions between Tethering and TetherInterfaceStateMachine

( cherry-pick of de4819dc82b734036b22416228327d2712e01884 )

Previously, Tethering would answer requests for current tethering state
by calling methods on instances of TetherInterfaceStateMachine to build
up that state. This is incorrect, since state queries can come in on an
arbitrary thread, independent of updates to the state machines
instances.

Fix this by:
- Altering TetherInterfaceStateMachine to push consistent state
snapshots to Tethering via notifyInterfaceStateChange()
- Storing the last state snapshot in Tethering.mTetherStates
- Removing public methods to query TetherInterfaceStateMachine state.
- Consistently synchronizing access to Tethering.mTetherStates

Bug: 29009601
Test: WiFi Tethering continues to work, unittests continue to pass

Change-Id: Ied334f5e8739bc3aff1b08a1079095b9cc2a7958
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5c0b10a4a9eecc5307bb89a271221f2b20448797 31-May-2016 Christopher Wiley <wiley@google.com> Tethering: Own WiFi tethering state and lifetime

( cherry-pick of f1315c3cd6d77e812ae32fe038b4e8bf2e70d5bf )

- Add logic to Tethering to track whether the user has requested
tethering via WiFi.
- Subscribe to intents regarding soft AP state to enable and
disable tethering when the AP comes up or goes down.
- Refactor IP configuration logic to do configuration for WiFi
as well as USB.

Bug: 29054780
Test: WiFi tethering continues to work on angler
Tethering related unittests continue to pass.

Change-Id: I6eff2573ca3fd11fabcf138c468ba517ff2daf65
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
e949039081b08626590be9783c85f358955e1b82 27-May-2016 Christopher Wiley <wiley@google.com> Use an ArrayMap instead of HashMap to track tether interfaces

( cherry-pick of 36f6f4e394750e4989d78f38a31ab8f2f66c07f7 )

Since the number of tetherable interfaces should be small (e.g. <10),
the computational cost of a looking up objects in an ArrayMap is negligible,
and the memory required is less than a HashMap.

While here, remove some unused imports.

Change-Id: I3fb7091cfb93697d2fc6388b843d60f7e8e7e1a6
Test: Compiles.
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
4312a4c433611343e863a5d38497d982ccfc90ae 23-May-2016 Christopher Wiley <wiley@google.com> Rely on Tethering mutex for TetherInterfaceSM

( cherry-pick of 4bc8d6b1ac0cb7d4192c829a44d988516f0adbdb )

Stop passing Tethering's mutex into TetherInterfaceSM, and instead
simply rely on Tethering to acquire its own mutex when accessing
instances of TetherInterfaceSM.

While here, remove some boolean fields (previously guarded by the mutex)
which duplicate state information.

Change-Id: Ie6b2128970981786a5d64fbf700c9f3d0a6721fb
Test: Compiles, unittests pass, WiFi tethering continues to work.
Bug: 28910007
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7040b4ebdfc9d4de5c240db6cde9fc245fb7a696 24-May-2016 Mitchell Wills <mwills@google.com> Rename TetherInterfaceSM to TetherInterfaceStateMachine

( cherry-pick of c5baad02503d17a812ee1b44cc817c7e18935ff1 )

Change-Id: I324690b20f37cef6d58872e21b126a87d16f7ec8
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
3b1d92250303e9e20c48fabf25b435ff79897437 21-May-2016 Christopher Wiley <wiley@google.com> Remove transient StartingState from TetherInterfaceSM

( cherry-pick of 79e7fde00d74c2b6d329f7341029ea6b04ac2d97 )

This state immediately switched into the TetheredState.
We can safely remove it at only the expense of a misleading state
broadcast.

Bug: 28798823
Test: runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest

Change-Id: I295d830dbdb11717d6e05161d97787ffe871beb3
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d2896669245f0480f2cca46d47f598d2b73a5e14 19-May-2016 Christopher Wiley <wiley@google.com> Extract TetherInterfaceSM to its own class.

( cherry-pick of e3f93b02bdfde6fffd2bcbb2e1dc0785ce9f8d5a )

Attempt to keep all existing logic in place, except:

+ Marked a constructor as public, rather than default visible.
+ Added TAG, DBG, VDBG, and decoder ringer statics.
+ Moved static constants related to USB IPs into TetherInterfaceSM.

Bug: 28833951
Test: WiFi Tethering works on angler.

Change-Id: Id961220a9045832354cfe7381e5e9c0d8f54bf90
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
e03fb4459cd3ace301926bdfda75034becfc79bc 18-May-2016 Christopher Wiley <wiley@google.com> Make Tethering.TetherInterfaceSM more self contained

( cherry-pick of 9a509ca728fbe264e1a5a6ccd5b39ffc0b5eceb4 )

Remove references from the class into the containing class:
- Move functionality to bring up a USB interface into the class itself.
- Extract an interface to wrap methods where TetherInterfaceSM was
calling into other private classes of Tethering
- Inject necessary dependendencies into TetherInterfaceSM instances.

Bug: 28833951
Test: Compiles.

Change-Id: Ic96947417cf8734072d027b0f1cba8a1a1be7a74
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
b9cb7742ca24e494f5ede70dbb835a6c2140914a 17-May-2016 Christopher Wiley <wiley@google.com> Clean up class members in Tethering.TetherInterfaceSM

( cherry-pick of 7b30e548a58ac96a23033db43c7aac79c86e938c )

Mark final fields as such.
Group mutex protected fields together with the mutex that protects them.
Always access mutex protected fields under the mutex.

Bug: 28798823
Change-Id: I96cdd5e063babb73e9f124107c5576c47801f34b
Test: Compiles, Wifi tethering continues to work on angler.
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
499a57ad115751a8fa5601f853c8ab6ff5237477 17-May-2016 Christopher Wiley <wiley@google.com> Fix trivial warnings in Tethering.java

( cherry-pick of 6d475970a200f162ba6845d25bb2a777bcaa611c )

Add some missing @Override annotations.
Use template arguments to avoid explicit casting.
Ignore unclosed IndentingPrintWriter in dump().

Bug: 28798823
Test: Compiles.

Change-Id: I2cb6eb384ca23057c8059f4842b1c0d8248d03f8
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
70c8b9b66027409f9dec91872cbe8ae8756d5ea4 25-Apr-2016 Felipe Leme <felipeal@google.com> Tethering and Data Saver: There Can Be Only One!

If tethering is on when Data Saver mode is turned on, tethering should
be disabled, and vice-versa.

BUG: 28313291
Change-Id: I7f3dadbd97ea1492ab76b41043dea7487c1db02d
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
636c07d9a9a6e48197706bd9724e5d5db4e2fe9d 22-Apr-2016 Rebecca Silberstein <silberst@google.com> Tethering: interface updates can be handled again

When reloading wifi firmware, unsolicited responses from netd were
processed after softap had started and caused wifi tethering to be torn
down.

The NetworkManagementServer.wifiFirmwareReload call has been changed to
not only block for the command to finish, but also until all unsolicited
messages (interface updates) have been handled. We should now be able
to handle interface updates in tethering without suffering from the
softap bringup/interface down notification race condition.

BUG: 27857665
Change-Id: Ie57cb8f760781b3227df575b577b33667070d63e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
cd63d247f08eddd506a679ffa244d6ac6c4742b1 10-Apr-2016 Lorenzo Colitti <lorenzo@google.com> Improve Tethering and NativeDaemonConnector logging.

1. Deduplicate the Tethering message numbers, and use MessageUtils
to convert them to strings.
2. Add a warning to NativeDaemonConnector when an unsolicited
event is more than 500ms late or takes more than 500ms to
process.

Bug: 27857665
Change-Id: I379aef9257027d1ccf30906e79c6389ef1f95420
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c42c97540f6ca25ffd77fcc2c9cac94993277e77 05-Apr-2016 Lorenzo Colitti <lorenzo@google.com> Clean up netd state when tethering fails.

If we do not call untether, NetworkController will still think
that wlan0 is part of the LOCAL network, and thus any attempt to
use wlan0 for anything else is doomed to fail.

Bug: 27917299
Change-Id: Ibb63f6b477b85b92281d9667adf8af148deb266c
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6ff17f73d283f2150f05e85819c1f3a0bc965522 10-Dec-2015 Erik Kline <ek@google.com> Partially refactor Tethering to new network callback APIs

Bug: 9580643
Bug: 22332501
Bug: 27419608
Change-Id: I714e70729dc0825159be0db76ac252d8bffb6866
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
908c5df3b16aa6a3d0e2fd8409720a8c966e098d 17-Mar-2016 Rebecca Silberstein <silberst@google.com> handle wifi interface changes with interfaceRemoved

When wifi is enabled, turning on the wifi hotspot is confused when the
underlying interface goes down (a necessary step to start up the SoftAp).

When tethering on a wifi interface, we may see the interface go down and
then back up. When the interface goes down the TetherInterfaceSM in
Tethering.java receives a CMD_INTERFACE_DOWN message. When this
happens, the existing TetherInterfaceSM is removed and a new one is
created. If tethering was already established, this also triggers the
hotspot teardown. This CL allows the TetherInterfaceSM for wifi to
ignore the interface down and instead rely on TETHER_MODE_UNREQUESTED
and the interfaceRemoved method.

This change was tested to verify the hotpost comes up with wifi disabled
and wifi enabled. The hotspot was also confirmed to disable when turned
off through the UI and when airplane mode is enabled.

BUG: 27711081

Change-Id: Ia24b215dca95852fdca2245224a8fb06e0bb3b65
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
12acbd7836e989150d73b04452d8ee300d54bcf6 02-Feb-2016 Joe Onorato <joeo@google.com> Turn down the logging a little bit.

Change-Id: Ib6e0e6f3577afac3b9bfe9a9b1cce70fb16d9d04
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
45ae04ab7b02fe8c7a6f2831aeec2e2c8e0cbc6f 05-Feb-2016 Jeremy Klein <jlklein@google.com> Fix a small issue with the BT Tether callback value.

It was incorrect when disabling bt tethering. Note that this had
no practical effect because there's no callback for disabling, but
the change is good for readability's sake.

Change-Id: Id80de58b24e94ec5a8ee38d94fb3016ae7835e43
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fa8712bc0636e5a5a7f00eefc994be7fbfe2fddd 26-Jan-2016 Jeremy Klein <jlklein@google.com> Remove the unused Looper param from Tethering constructor.

Tethering just constructs its own Looper right below where it
assigns the looper param to mLooper.

Change-Id: I2d522942eff2ad3439bb3961e78ab0625d3fa9df
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
15f3d215992175a9c731b518534a9fc612417feb 25-Jan-2016 Jeremy Klein <jlklein@google.com> Implement ui-based provisioning for the new tether api.

This is dependent on ag/850648 and the Settings changes under the
uiprovisioning topic id.

BUG: 26247383
Change-Id: Ib151d56a1ece5ca3a55219abed965286eac5dd60
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
36c7aa03255d91cfa0808323ac475ad02d161d7d 22-Jan-2016 Jeremy Klein <jlklein@google.com> Expose a simple tethering API which includes provision checks.

This CL exposes startTethering and stopTethering functions which also
encapsulate all provisioning check logic. Right now, only silent checks
are implemented, but UI checks will come in a follow-up CL. GTS tests
and Settings changes are under the same topic ID.

BUG: 26247383
Change-Id: I65f61d899594cb3f9035d8496366af17a57a090f
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
0c9cb2ba760d57677489f4240882ee24b016f314 20-Nov-2015 Erik Kline <ek@google.com> Stop using startUsingNetworkFeature

Also:
- add a few @Overrides where appropriate.
- some small refactoring/reformatting

Bug: 9580643
Bug: 22332501
Bug: 25824776
Change-Id: Id4f496ced4db15cd9da51c80c5d1dde06f476f54
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
748a509fb138b25d77915e977aa6a4e40bf9e864 13-Nov-2015 Erik Kline <ek@google.com> Pass both IPv4 and IPv6 DNS servers as tethering DNS forwarders

Bug: 9580643
Change-Id: I5b37b9e7a7a10a624bce79836ef876be9d355e90
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
1ce4b6d3c6cb5b2eb9c9d00472be12245db92427 11-Jun-2015 Chris Wren <cwren@android.com> remove usage of deprecated method setLatestEventInfo

Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
e380546aedb727a7a5f1f7b460124c3e57d5ac49 03-Jun-2015 Lorenzo Colitti <lorenzo@google.com> Make the dumpsys connectivity shorter and easier to read.

- Print NetworkFactories on one line.
- Only print LegacyTypeTracker networks if they are connected,
and record supported network types on a separate summary line.
- Print all tethering upstreams on one line.
- Summarize the state of the transition wakelock on one line.
- Don't print Inet condition reports if there are none.
(Currently there can never be any.)

Bug: 21449922
Change-Id: Ib4b29a7fd882e6c105839a255fffecf4f346cf7e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fcf10f7c12cb3107bdfedce6f76a8c866d154f3c 13-May-2015 Nick Kralevich <nnk@google.com> Modify how USB connections are handled.

* Introduce a new "charger only" mode. In this mode, MTP is disabled,
and no file transfers can occur.
* Make charger only mode the default.
* Modify "persist.sys.usb.config" so it now only holds the adb status.
* Make the USB settings non-persistent. Unplugging the USB connection will
reset the device back to "charger only" mode.
* Fixup wording per UI guidelines.

TODO: Re-implement MDM restrictions for USB / MTP access controls.

Bug: 18905620
Change-Id: I99a50d9132a81e98187f431166fd9fef4d437e4f
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
4a357cd2e55293402d7172766f7f9419815fc1e8 19-Mar-2015 Alan Viverette <alanv@google.com> Replace usages of deprecated Resources.getColor() and getColorStateList()

Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
f5fabf1542624005a0e978045bdd117a62ab2593 15-Mar-2015 Vinit Deshpande <vinitd@google.com> am "Separate NAT from forwarding."

merged from goog/mirror-m-wireless-internal-release
35e36db Separate NAT from forwarding.
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
35e36db1d726f5741e7d8d83d2556e1417642be9 25-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Separate NAT from forwarding.

Bug: 19500693
Change-Id: I39878644e21d51def1c31d1857e815f473ef0938
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
2ffe412b0eb8f53043356fe50dc4ceb04d267fa2 12-Dec-2014 Robert Greenwalt <rgreenwalt@google.com> Rerun entitlementcheck on sim change.

Only run if entitlement is needed and tethering is running.

bug:18356505
Change-Id: Ifc50189bf573e4575f747975edcce093c4870356
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
2576a808f8ed90d0b8fc8eb25da477dc0e10de6e 18-Nov-2014 Vinit Deshpande <vinitd@google.com> Remove notification for SoftAP turned on

Since we have a status icon for SoftAP, the persistent
notification is no longer necessary.

Bug: 17318034
Change-Id: I0c8acb643fc032c9b12feb3a9a155cf95e58eca1
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
38531581fc19f9172fabe56047b326e5dab88625 28-Oct-2014 Junda Liu <junda@google.com> Add hasMatchedTetherApnSetting to telmgr API.

Bug: b/18158411
Change-Id: Id1285b79194ad21fb728fd18fb09026e51354656
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
b57edc5ae999abd9c7310833f4f10bbacbc469d7 23-Aug-2014 Lorenzo Colitti <lorenzo@google.com> Pass the socket mark for DNS queries to dnsmasq.

This makes tethered clients use the correct DNS servers when
tethering to non-default networks like the DUN APN.

Bug: 16357676
Change-Id: I8933b6de198a92c2aaf0291931ace8966ddba275
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
255dd04271088590fedc46c8e22b2fd4ab142d39 19-Aug-2014 Selim Cinek <cinek@google.com> Added notification color to all system notifications

Bug: 17128331
Change-Id: I81a94510ef51b99916f314c0dd65852426a1fbeb
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
62a61314bc880df15a1d284ce12bc08b9c79a4dd 25-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Don't create a ConnectivityManager when the service isn't ready yet.

Bug: 16550853
Change-Id: Ib244c93dc982cbfe5d065a20e4b8f0aeefb15b8f
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fab50167a88941b1088130b6b62b1200088764cc 23-Jul-2014 Robert Greenwalt <rgreenwalt@google.com> Fix DUN-based tethering.

It was calling into dead ConnectivityService code rather than using
the new ConnectivityManager shim code.

bug:15221541
Change-Id: I1e3eea8a658a162ce36673ed1cf7b1e7e4372c42
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
03666c705ddabe0e7c5869ab69c2ca8b964164e9 20-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cleanup: Delete dead code.

Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
9c7e2c2cb491268db0322ad78856faf0582e61d1 23-Jun-2014 Robert Greenwalt <rgreenwalt@google.com> Refactor wifi p2p's startDhcpServer function

Add getTetheredDhcpRanges() interface and call it before calling
mNwService.startTethering to update dhcp ranges. This will allow
p2p apps to run well concurently with other tethering apps.

Manual import of AOSP change 81546 by jianzheng.zhou@freescale.com

Change-Id: Iebc62f95bdcedde80e2c1d3e9580d3f625c3b50b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
df2b878ff4e7b4a258588d3a93574c399db78a07 06-Jun-2014 Robert Greenwalt <rgreenwalt@google.com> Fix public API of LinkProperties.

bug:15142362
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
70c117a87385d3764d154873aff09431348e8478 28-May-2014 Nick Kralevich <nnk@google.com> Fix Tethering NPE

Bug: 10733373
Change-Id: I1d81eb8a60be2b672b925be7577f1288fe870237
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
9258c64bef1a01fe89bc7c1fa402c44c0e6a1255 27-Mar-2014 Robert Greenwalt <rgreenwalt@google.com> Add Multinetwork API

Change-Id: I3a9cef0d416db96d05098dd989ee3fef3b1e9274
(cherry picked from commit cc5e6afa1ba0bef099bcb21a64a36bc2bf7951db)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
59f0258a27ebaf8468919a9d2855c41f0429238d 21-Mar-2014 Dan Sandler <dsandler@android.com> Categorize some system notifications.

Change-Id: Ia343bc276f50f488e2165056cff249a02f01d45a
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
bfe61f696de3ceecda51612d3b26f20af33bc16c 30-Jan-2014 Dan Sandler <dsandler@android.com> Make some notifications public (safe for secure lockscreens):

- USB connected
- ADB enabled
- Low storage
- USB mass storage status
- Tethering status

Change-Id: I8224d7bcc8141fc90ac5e28d4392c52724c524a7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
49782e46c0eb85a25ae2abcf80880c48dbab5aea 20-Dec-2013 Amith Yamasani <yamasani@google.com> am 9158825f: Move some system services to separate directories

* commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce':
Move some system services to separate directories
9158825f9c41869689d6b1786d7c7aa8bdd524ce 22-Nov-2013 Amith Yamasani <yamasani@google.com> Move some system services to separate directories

Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java