History log of /frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
80b7a9f1b5ba5a6117f6b020121f06a2d0cd1889 28-Feb-2018 Erik Kline <ek@google.com> Don't unnecessarily reevaluate tethering provisioning

Registering for carrier config changes can deliver a sticky broadcast
and can cause Tethering to think something has changed and reevaluate
provisioning status, even though this has been checked before it
entered tethering mode alive state.

Additionally, move the provisioning_app{,no_ui} resources into the
TetheringConfiguration, if for no other reason than now we can log
it in .toString().

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
- manual USB tethering toward WiFi works
Bug: 69565814
Change-Id: Ib8b2620ce44c55e5eb0afd3f00f3f5aa4fc8a593
(cherry picked from commit 8067d78c32f545db6d35c660279ab3f2326ba41d)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7a26ba37f6a1205c8914c62c4756f24329317f6b 09-Mar-2018 Erik Kline <ek@google.com> Refactor isTetheringSupported() calls

Tethering currently wants access to complex isTetheringSupported
logic that is only available in ConnectivityService. Instead of
trying to access that via ConnectivityManager, pass this capability
in to Tethering directly, in the TetheringDependencies object.

Also:
- ConnectivityManager is only a source of static constants now,
so "import static" all the constants that are actually used.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net works
- manual USB towards WiFi tethering works
Bug: 68951715

Merged-In: Ifa121b057f9959ddb980edc940327929e48ea973
Merged-In: Iad6358dc2f1d10b322d22ec90543adc50882962d
Change-Id: Ia64faaadefb4a5d84a50da98bdebd544b6fda101
(cherry picked from commit 465ff3a0c1da8afd5cb13b25ed9a3c95ee0dd2c4)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6c02f9942aaf4f6665018e0c7f07aeceb5ae752e 09-Mar-2018 Remi NGUYEN VAN <reminv@google.com> Use InterfaceSet for upstream interfaces.

Allows using different upstream interfaces for IPv4 and IPv6.

Bug: 38218697
Bug: 64382985
Bug: 64976379
Bug: 64995262
Bug: 64380515
Test: runtest frameworks-net, manual (with aosp/644099 applied)
(cherry-pick of aosp I3db63f7aa5255a0229253187def7590a386c5133)
Merged-In: Ic8602dd029b5a9626aaf6651315b82ab6327037c
Merged-In: I015ac946afa581be1d94f10ab766ac00f5a4ede0

Change-Id: I8c48dab5eb67e60dadbfa974122fc884f4badd15
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5d0dc453e90554e739c5994a417e73a560edc547 15-Mar-2018 Remi NGUYEN VAN <reminv@google.com> Add tests for IPv4 of dual stack tethering.

Also refactoring some Tethering and TetherInterfaceStateMachine calls
to address testability issues.

This is in preparation of other work to have IPv6-only or 464xlat
tethering working.

Test: runtest frameworks-net
Bug: 38218697
Bug: 64382985
Bug: 64976379
Bug: 64995262
Merged-In: I3b91125b1a715690c2cd417b1e937e568c755d9f
Merged-In: I05de77d9b90d147bf1d6ee7f7ee19a049afddfa1
(cherry-pick of aosp I721aca4789ddfbee5a97316aae0b378d79ee2107)

Change-Id: Idfdd1b9cd5419c1f51f0fbb1eba2f36a9c12474b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
64265d4dcef6b91001f629a5bf5edd013b32b701 26-Feb-2018 Erik Kline <ek@google.com> Merge "Slightly refactor IPv4 default router interface selection" am: 701421c6c9 am: 95c373341e
am: 8ac26bad64

Change-Id: I7ab4b7b3eaa7c81d58990747f3f894e8f9dacfd6
e8bdb400577e8966bd471f9317ea603e142856c9 23-Feb-2018 Erik Kline <ek@google.com> Slightly refactor IPv4 default router interface selection

Test: as follows
- built
- flashed
- booted
- USB tethering to dualstack wifi yields log lines like:

14:33:31.970 - Looking for default routes on: {InterfaceName: wlan0 ...
14:33:31.970 - IPv4/IPv6 upstream interface(s): wlan0/null

and working tethering
- runtest frameworks-net passes
Bug: 64380515
Bug: 64382985
Bug: 64976379
Change-Id: Iac94d870653ae1b71df00e8179cc4ecdb7ac412f
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
327b809ad11a5094248652014227470c4be329e6 10-Jan-2018 Jerry Zhang <zhangjerry@google.com> Refactor and clean up USB, add tests

Change UsbManager apis to use long instead of string, to match
usb hal. Change UsbDeviceManager internals to match as well.

Remove isFunctionEnabled and add getEnabledFunctions. Callers
would often call isFunctionEnabled for every possible function
to get the list of functions, so getEnabledFunctions reduces the
number of aidl calls.

Separate out dependencies between UsbHandler and UsbDeviceManager
and staticize the UsbHandler classes. Add unit tests with
mocked out dependencies to test state transitions for UsbHandler.

Bug: 62876645
Test: atest UsbTests
Change-Id: I785c4c24121a70e725de9742c6af50a6bf1baea0
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a660af1fa4999c922f002ba841cb39ab6863dcce 25-Jan-2018 Jeremy Klein <jlklein@google.com> Merge "Add FLAG_ACTIVITY_NEW_TASK when starting UI-based tether provisioning." am: f4dc715575 am: 4c2c7bedf9
am: 2eee5f20f0

Change-Id: I91617ffeb287317ecf50ceda6cd85ef438faf29f
d50fc05186b29586de6edd841ffd3737bc753b6f 19-Jan-2018 Jeremy Klein <jlklein@google.com> Add FLAG_ACTIVITY_NEW_TASK when starting UI-based tether provisioning.

Bug: 72223006
Bug: 72219677
Test: manual
Change-Id: Iba7a58729903207b2ec75524fc1ef4c404f0b6a3
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
f77780836118ae1c0dbafca850df65265142c428 10-Jan-2018 Jerry Zhang <zhangjerry@google.com> Merge "Revamp USB tethering startup flow." am: 90fddefd5e am: 375c0a55d8
am: 49df4a5d3d

Change-Id: I36cca56eb93767d23f2d08b708208ba8ff1db06d
656a7bc06b3c11f1eb86385b706275191edb04d1 20-Dec-2017 Jerry Zhang <zhangjerry@google.com> Revamp USB tethering startup flow.

Modify usb tethering flow to no longer require
mUsbTetherRequested. The new simplified flow is:

1. Usb rndis function is set through UsbManager
2. Usb is configured with rndis enabled
3. We tether the USB interface
4. Usb is disconnected
5. We untether the USB interface

This allows USB tethering to be enabled through
either UsbManager or ConnectivityManager and aligns
the flow to be similar to other usb function services
such as MTP.

Bug: 62876645
Test: Enable and disable tethering through connectivity and with `svc
usb setFunction rndis`

Change-Id: Ica4203a499db177999302e099e28948b06ef2298
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
bee33f843ea978970f563e2cbef8e3482aa20a7b 25-Oct-2017 Erik Kline <ek@google.com> Merge "Switch to listening for CarrierConfig changes for provisioning rechecks" am: c21effd526 am: 166c27440d
am: fc0b863b44

Change-Id: I2e46e8271209798692d5074d336ef73eb96370bb
c21effd5269726cc4202d15475a2b00c9c473bda 25-Oct-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Switch to listening for CarrierConfig changes for provisioning rechecks"
de63772eff39adccc7819765e09b499cfd3b833e 12-Oct-2017 Erik Kline <ek@google.com> Switch to listening for CarrierConfig changes for provisioning rechecks

This change switches the signal used for provisioning rechecks from:

ACTION_SIM_STATE_CHANGED

to:

ACTION_CARRIER_CONFIG_CHANGED

Additionally:
- reexamine carrier config overrides during provisioning re-checks
(this just was never happening before).
- refactor shared code out to VersionedBroadcastListener

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net
Bug: 63400667
Bug: 67755969
Change-Id: Ib9d222eb7ca0e0dd988a1bd97ab32059189ada2c
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
cc9258797608e770e06a6c8a0e4f39b1bbaeb3b5 11-Oct-2017 Erik Kline <ek@google.com> Merge "Log upstream network suspend/resume callbacks"
am: 645cd2ad26

Change-Id: I375e47a21d2fc6a5e67ff6367087c22beceb6377
126171b2ccf938934a14fcd992dbff0919da7b53 10-Oct-2017 Erik Kline <ek@google.com> Log upstream network suspend/resume callbacks

Also log signal strength while we're at it:

2017-10-10T14:05:00.968 - [UpstreamNetworkMonitor] preferred upstream type: WIFI
2017-10-10T14:06:07.654 - [UpstreamNetworkMonitor] upstream network signal strength: -62 -> -67
2017-10-10T14:06:13.704 - [UpstreamNetworkMonitor] upstream network signal strength: -67 -> -64

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 64976634
Bug: 67396342

Merged-In: I9121798bba0be9dcdf1e45d39c092020620fa53b
Merged-In: I1d3420380691efd886315275598134b98f4041ed
Change-Id: Id6e143edc9f5b0256aa637643680f6c8dce70d90
(cherry picked from commit 60caf7d29132262dd4a077b68daa807d22773524)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
ce0d273b1740bde96fb557f143443af06ce578ee 11-Oct-2017 Erik Kline <ek@google.com> Merge "Log upstream network suspend/resume callbacks" into oc-mr1-dev am: ab10e1a7db
am: 8d3efa6722

Change-Id: I1d3420380691efd886315275598134b98f4041ed
60caf7d29132262dd4a077b68daa807d22773524 10-Oct-2017 Erik Kline <ek@google.com> Log upstream network suspend/resume callbacks

Also log signal strength while we're at it:

2017-10-10T14:05:00.968 - [UpstreamNetworkMonitor] preferred upstream type: WIFI
2017-10-10T14:06:07.654 - [UpstreamNetworkMonitor] upstream network signal strength: -62 -> -67
2017-10-10T14:06:13.704 - [UpstreamNetworkMonitor] upstream network signal strength: -67 -> -64

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 64976634
Bug: 67396342

Change-Id: Id6e143edc9f5b0256aa637643680f6c8dce70d90
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
df2a8807757112ca2868120bb09f973511424b77 24-Aug-2017 Erik Kline <ek@google.com> Merge changes from topic "offload_cherrypick"
am: b09cf3fbf1

Change-Id: Icb4332b34bc8b940a2c30beab143f7136e0178de
b3bb26eaa790cc18f6383387975630c1ae35752a 06-Jul-2017 Erik Kline <ek@google.com> Send add/removeDownstream info to offload HAL

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passed
Bug: 29337859
Bug: 32163131

Merged-In: I0cb81ac054fc2bf6c8b8bfe658e9404a15091d7a
Merged-In: I7abcdcc2d7d967179c47081a6db2b417164891f3
Change-Id: I6c59aa7cb80b54f376f294b24c1409710c553d74
(cherry picked from commit ed962a84122ab950a103fbbc0bf911f61b6b9500)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7c5c7cc57054c1c5e4a5f5504ae3707922e1b205 24-Aug-2017 Erik Kline <ek@google.com> Merge "Send add/removeDownstream info to offload HAL" into oc-mr1-dev am: 568cd41216
am: 7559e2d2b2

Change-Id: I7abcdcc2d7d967179c47081a6db2b417164891f3
ed962a84122ab950a103fbbc0bf911f61b6b9500 06-Jul-2017 Erik Kline <ek@google.com> Send add/removeDownstream info to offload HAL

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passed
Bug: 29337859
Bug: 32163131

Change-Id: I6c59aa7cb80b54f376f294b24c1409710c553d74
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6ff07301583c27f24be94b1f0811bae9cbc61e12 10-Aug-2017 Erik Kline <ek@google.com> Merge "Add future consideration for USB rndis notification handling"
am: 4263a5ed58

Change-Id: I7dd347447434214ecf3e5f9f8e2a603cd097f6c6
7111c9145bc6c5f46c6ac129405b9057589647e0 09-Aug-2017 Erik Kline <ek@google.com> Add future consideration for USB rndis notification handling

Test: builds
Bug: 63970368
Merged-In: If6afe1cdce9995251ba53fbf30acf9d6e31f9433
Merged-In: I78e280c2299ec3f4d97138ca648f9629ba82e87f
Merged-In: I891cd82b0e8af1049fa3ab9b0a95a2a9ab2e0b26
Change-Id: Ic9ca133a44123f281bd4cfeac57d426346c2b76d
(cherry picked from commit 1290568110405fd45f13824e67beeb98c30400a4)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6e367b825d667e285485e6736455bfcd01e90e2d 09-Aug-2017 Erik Kline <ek@google.com> Merge "Add future consideration for USB rndis notification handling" into oc-dr1-dev am: 15fbf9786d am: 5ab82f9478
am: 394b5574ef

Change-Id: I891cd82b0e8af1049fa3ab9b0a95a2a9ab2e0b26
47f2cf514496f224c9ddcd663635a7025b615d5b 09-Aug-2017 Erik Kline <ek@google.com> Merge "Always note the state of RNDIS from USB broadcasts."
am: d27af8af62

Change-Id: I33633e064a329b9094b0d279622febab6266e5cb
4f31c21787951ff28645f9e4354702584be74b32 08-Aug-2017 Erik Kline <ek@google.com> Always note the state of RNDIS from USB broadcasts.

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

Merged-In: I53115deda25ca83a00bd9de12891a72028647d12
Merged-In: I317b694c3a8c76077c031c4410d5b97ed79c1bbc
Merged-In: Ie226534011d6439c24cfe1957c5cf47ba171b0c0
Change-Id: I273edbe21fea586f1353ff378515401efc6bb15e
(cherry picked from commit 3897dc179f23dfbaf10f0139160aa29a232144f5)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a0536f206706f95e90aacc2ec8ccdf84bdcc0213 09-Aug-2017 Erik Kline <ek@google.com> Merge "Always note the state of RNDIS from USB broadcasts." into oc-dr1-dev am: 07df171ac6 am: c4b627b7d7
am: 83c2bd5ddd

Change-Id: Ie226534011d6439c24cfe1957c5cf47ba171b0c0
1290568110405fd45f13824e67beeb98c30400a4 09-Aug-2017 Erik Kline <ek@google.com> Add future consideration for USB rndis notification handling

Test: builds
Bug: 63970368
Change-Id: Ic9ca133a44123f281bd4cfeac57d426346c2b76d
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
3897dc179f23dfbaf10f0139160aa29a232144f5 08-Aug-2017 Erik Kline <ek@google.com> Always note the state of RNDIS from USB broadcasts.

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

Change-Id: I273edbe21fea586f1353ff378515401efc6bb15e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5469504e6b2f7b7e9a883a6bddbe30856f81b2f7 18-Jul-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Notify the user and turn off tethering when the service is disallowed.

Added UserRestrinctionListener for turning the service off one the
DISALLOW_CONFIG_TETHERING is on into Tethering. Added notification
about
tethering being turned off. Also added Unit Tests to test the
functionality
of the UserRestrictionListener added.

Bug: 27936525
Test: Turn the tehering service on (either wifi, usb or bluetooth).
Automatically the system should send a notification about the service
being active.Close settings from recents. From TestDPC User Restrictions
switch on DISALLOW_CONFIG_TETHERING. The tethering should be turned off
and a notification should appear informing that the service is inactive.

Merged-In: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
Change-Id: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
(cherry picked from commit fa6d5c5ca02f1bfc454bd3cd82e6c043661e7aa7)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5027dd1026da76ca84484831f31f6e14f1bf4066 03-Aug-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Notify the user and turn off tethering when the service is disallowed."
8228eb34462cc9f76152bc87e20e721cd0e20775 18-Jul-2017 Lorenzo Colitti <lorenzo@google.com> resolve merge conflicts of a1d67fb38ec0 to stage-aosp-master

Test: make -j64 services
Change-Id: I3955b01189993f3051c608bc5d07a87e4e3b5f0b
Merged-In: Ic1e799c17b4bb0272cf85e03d5ad14981a55defa
f8f3fbbd016d12f80c02e136ab4684da807792a1 26-Jun-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Notify the user and turn off tethering when the service is disallowed.

Added UserRestrinctionListener for turning the service off one the
DISALLOW_CONFIG_TETHERING is on into Tethering. Added notification about
tethering being turned off. Also added Unit Tests to test the functionality
of the UserRestrictionListener added.

Bug: 27936525
Merged-In: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
Test: Turn the tehering service on (either wifi, usb or bluetooth).
Automatically the system should send a notification about the service
being active.Close settings from recents. From TestDPC User Restrictions
switch on DISALLOW_CONFIG_TETHERING. The tethering should be turned off
and a notification should appear informing that the service is inactive.

Change-Id: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d17160ba191259ccde9fd74a974b2e6c88a7e8da 12-Jul-2017 Lorenzo Colitti <lorenzo@google.com> Add code to dump OffloadController state.

(cherry-picked from commit c2519c5feae397e18561e00acea9d5e456bfaabe)

Bug: 29337859
Bug: 32163131
Test: observed output of "adb shell dumpsys connectivity tethering"
Change-Id: Icc5aa605cd64a4a2bb5993941dcc4010cc0b1d8e
Merged-In: Icc5aa605cd64a4a2bb5993941dcc4010cc0b1d8e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
4ca0ba8f86f657f42ebae2d389f7a6f92251c01c 12-Jul-2017 Lorenzo Colitti <lorenzo@google.com> Fetch tethering offload stats.

Make tethering offload register an ITetheringStatsProvider and
fetch tethering stats from the hardware.

Currently we fetch stats in the following cases:

1. Just after changing upstreams, we fetch stats from the
previous upstream.
2. When we are polled by NetworkStatsService.

(cherry-picked from commit 5a7dea1a8eb2cf53fc1d5a52004647de94150e62)

Bug: 29337859
Bug: 32163131
Test: builds, boots
Test: stats appear in tethering logs
Change-Id: If744f2e06cb6a3095a40199936b9afb76eff7b56
Merged-In: If744f2e06cb6a3095a40199936b9afb76eff7b56
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
fa6d5c5ca02f1bfc454bd3cd82e6c043661e7aa7 18-Jul-2017 Alexandru-Andrei Rotaru <rotaru@google.com> Notify the user and turn off tethering when the service is disallowed.

Added UserRestrinctionListener for turning the service off one the
DISALLOW_CONFIG_TETHERING is on into Tethering. Added notification
about
tethering being turned off. Also added Unit Tests to test the
functionality
of the UserRestrictionListener added.

Bug: 27936525
Test: Turn the tehering service on (either wifi, usb or bluetooth).
Automatically the system should send a notification about the service
being active.Close settings from recents. From TestDPC User Restrictions
switch on DISALLOW_CONFIG_TETHERING. The tethering should be turned off
and a notification should appear informing that the service is inactive.

Change-Id: Ib7ea8885cedc2a842ebd4487c8b366a6666996bc
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c2519c5feae397e18561e00acea9d5e456bfaabe 12-Jul-2017 Lorenzo Colitti <lorenzo@google.com> Add code to dump OffloadController state.

Bug: 29337859
Bug: 32163131
Test: observed output of "adb shell dumpsys connectivity tethering"
Change-Id: Icc5aa605cd64a4a2bb5993941dcc4010cc0b1d8e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5a7dea1a8eb2cf53fc1d5a52004647de94150e62 12-Jul-2017 Lorenzo Colitti <lorenzo@google.com> Fetch tethering offload stats.

Make tethering offload register an ITetheringStatsProvider and
fetch tethering stats from the hardware.

Currently we fetch stats in the following cases:

1. Just after changing upstreams, we fetch stats from the
previous upstream.
2. When we are polled by NetworkStatsService.

Bug: 29337859
Bug: 32163131
Test: builds, boots
Test: stats appear in tethering logs
Change-Id: If744f2e06cb6a3095a40199936b9afb76eff7b56
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
ae21b8941453ce5973100671c2cb9ef9ff20394c 13-Jul-2017 Erik Kline <ek@google.com> Merge "Program offload-exempt local prefixes into the HAL"
am: de837a97aa

Change-Id: I741b6e31fb3adc922f47df824188786ff35e3aa9
5acb4e3b62c788bff1baa22ecb20f6b103cc8d93 04-Jul-2017 Erik Kline <ek@google.com> Program offload-exempt local prefixes into the HAL

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- observed calls to the HAL setLocalPrefixes in tethering log
Bug: 29337859
Bug: 32163131
Merged-In: I3c3bd4ee83ffe86ddbe6a16fbbfa0756bf5064d4
Merged-In: Iaf80e584df458010741401fc1a19e7f6e21923c1
Merged-In: Ifaf23c6179ead9de6ccfcf41e0c203025153167b
(cherry picked from commit 32179ff81511e00aef31e8fda705be3df074ece6)

Change-Id: I65ea833ac6fe7a75ebe546cfa358c4cffdf2de05
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
32179ff81511e00aef31e8fda705be3df074ece6 04-Jul-2017 Erik Kline <ek@google.com> Program offload-exempt local prefixes into the HAL

Additionally:
- move mOffloadController into MasterTetherSM

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- observed calls to the HAL setLocalPrefixes in tethering log
Bug: 29337859
Bug: 32163131
Change-Id: Ifaf23c6179ead9de6ccfcf41e0c203025153167b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
009d42ffe072a39707e6a49e33530358c997f5ae 12-Jul-2017 Erik Kline <ek@google.com> Merge "Stop unnecessary tethering reconfigurations"
am: 8ad1c81b07

Change-Id: I261ae05664d620997d38ca40edaffd8ca11b308e
48234d278756037979c5d00ce42f073fa97c4c99 08-Jul-2017 Erik Kline <ek@google.com> Stop unnecessary tethering reconfigurations

The TetheringConfiguraiton is retrieved at startup and on every
ACTION_CONFIGURATION_CHANGED broadcast. Re-retrieving the config
at every upstream selection is unnecessary and fills up the logs.

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
Bug: 32163131
Bug: 63250751
Merged-In: Id089375a5699ac1157fc5f445876fee558d7bc7e
Merged-In: I1fc87f9c2a31f7fd16889275e6ba197b2b48a264
Merged-In: Ia6276ada690aa3e4870bb83dc4bf3ddcddc35e7b
(cherry picked from commit 6ee73daa0aa90620e4b2cb13ead4b53d16f45010)

Change-Id: Ic51123e173cc29cfcb52210707f2a0f8d2ab2e3b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6ee73daa0aa90620e4b2cb13ead4b53d16f45010 08-Jul-2017 Erik Kline <ek@google.com> Stop unnecessary tethering reconfigurations

The TetheringConfiguraiton is retrieved at startup and on every
ACTION_CONFIGURATION_CHANGED broadcast. Re-retrieving the config
at every upstream selection is unnecessary and fills up the logs.

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
Bug: 32163131
Bug: 63250751
Change-Id: Ia6276ada690aa3e4870bb83dc4bf3ddcddc35e7b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
0a76af09b1b3f7d37944950267f3f23ab1d336f7 08-Jul-2017 Erik Kline <ek@google.com> Merge "Add more logging to the Tethering SharedLog"
am: 839cc0433f

Change-Id: Ibc2c9989ee9c5980003a60b43345baafc2cd3c0c
b4df3f45744aba9b3ab02980abf66b4d403160a1 06-Jul-2017 Erik Kline <ek@google.com> Add more logging to the Tethering SharedLog

This may at first seem a tad spammy, but a cursory examination suggests
most of this is the Tethering subsystem doing more work than necessary.
Some of this can be addressed with some simple changes in the near term.

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- watch "adb shell dumpsys connectivity tethering | tail 60"
shows new log entries

Bug: 29337859
Bug: 32163131
Bug: 63334101

Change-Id: I9539a37f346469f0474084f5f31527bc35093bce
Merged-In: I6820e6cc81cfa43d99ad66860e1dcf42d20109f8
Merged-In: I10960bf23a837eda1fb473826596c484484f1875
Merged-In: I0a8eb8be5562fa814109191b0110050ca4b60c02
Merged-In: I6219e56d571854a2c61e1da63095e319e4bd3dc1
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
2210890f26d8b5642a21a275742d5ca4e99f7d76 06-Jul-2017 Erik Kline <ek@google.com> Add more logging to the Tethering SharedLog

This may at first seem a tad spammy, but a cursory examination suggests
most of this is the Tethering subsystem doing more work than necessary.
Some of this can be addressed with some simple changes in the near term.

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- watch "adb shell dumpsys connectivity tethering | tail 60"
shows new log entries

Bug: 29337859
Bug: 32163131
Bug: 63334101
Change-Id: I6219e56d571854a2c61e1da63095e319e4bd3dc1
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
dbc7279e85b1bca8fe00d8c0dfbbc2cdd488175a 05-Jul-2017 Erik Kline <ek@google.com> resolve merge conflicts of b1eb85c9a8d3 to stage-aosp-master

Test: I solemnly swear I tested this conflict resolution.

Merged-In: I3ae731c21f292a476a9e30e229d66ef6ab4a0545
Merged-In: I717fdd269b012f32548ebe0603999ae403b03100
Merged-Id: Ia8f7f3616f1358b0427386ce8aff26899e03ac07
Merged-In: Ie32f50ec1a07e3126a05abee27c76bc63cdaca14
Change-Id: I217d7ca2958f3d6ca8992f738a034693a0fac486
2dce7712f3d974f90336e21cb7fc1cf180e860cc 04-Jul-2017 Erik Kline <ek@google.com> Switch to USB_CONFIGURED as the primary USB readiness signal

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- USB tethering on and off works as expected
Bug: 32163131
Bug: 36216864
Bug: 62147658
Bug: 62552150

Merged-In: I3ae731c21f292a476a9e30e229d66ef6ab4a0545
Merged-In: I717fdd269b012f32548ebe0603999ae403b03100
Merged-Id: Ia8f7f3616f1358b0427386ce8aff26899e03ac07
Change-Id: Ia8f7f3616f1358b0427386ce8aff26899e03ac07
(cherry picked from commit c438e306cc69b9d4d62512030267e93011b29978)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
c438e306cc69b9d4d62512030267e93011b29978 04-Jul-2017 Erik Kline <ek@google.com> Switch to USB_CONFIGURED as the primary USB readiness signal

Test: as follows
- built
- flashed
- booted
- "runtest frameworks-net" passes
- USB tethering on and off works as expected
Bug: 32163131
Bug: 36216864
Bug: 62147658
Bug: 62552150
Change-Id: Ia8f7f3616f1358b0427386ce8aff26899e03ac07
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
3a5278f2c4d71a8f69ce1085da42904283d62785 24-Jun-2017 Erik Kline <ek@google.com> Pass all offload-exempt prefixes into OffloadController

Additionally:
- eliminate useless TetherMasterUtilState

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

Merged-In: I6adcdbd6a4f14bd2cdaa056cfc0cf9c573a165b9
Merged-In: I5e689bcf5dd048ee9f9bd0c32b16d7c2e4c0268d
Merged-In: Ifd3817bd4569682d77a70f8192432391a573f6d8
Merged-In: I1ea57fbe322e26246f1d8b459519f18be1297467
Change-Id: I0482ac9dd9e8ba558b253643dbc01875ce9475ef
(cherry picked from commit be8ee08f5dcc3627cac6b0baa6664637684cce35)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
96ef85895786f92c4c5a350f643869024e3f1261 03-Jul-2017 Erik Kline <ek@google.com> Merge "Pass all offload-exempt prefixes into OffloadController"
am: 7fc4f63f23

Change-Id: Ibbca37f65dc0a0398432f325bf362996b9d61519
be8ee08f5dcc3627cac6b0baa6664637684cce35 24-Jun-2017 Erik Kline <ek@google.com> Pass all offload-exempt prefixes into OffloadController

Additionally:
- eliminate useless TetherMasterUtilState

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

Change-Id: I0482ac9dd9e8ba558b253643dbc01875ce9475ef
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
0aecb6ad445881121e616c20e8b8e55cfbba3c80 22-Jun-2017 Erik Kline <ek@google.com> Merge "Create a TetherInterfaceStateMachine when told the interface name." into oc-dev
am: be7657b038

Change-Id: Ie34a3c7aa39c9b70602236f4d4a4d5548566dd51
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
562e0c17d585a8ec3b426512df086b79690d57f9 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)
(cherry picked from commit 798a93b0df76c4feb5ddd619b788f2cf9ea5bf77)
/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
b912c50b197cc0fc49bb7897130581dd02d2af01 20-Jun-2017 Erik Kline <ek@google.com> resolve merge conflicts of 9e6b6e2a58d4 to oc-dev-plus-aosp

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I2104ecf8102c8f9541ee2d3ce6589b0081db4fe3
41531e267d7bb8bb5a0fe36555741c17d9d21c27 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

Change-Id: I93f3bdcf20dc4f03cd621d7ab6066344642550e3
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7fd696cb576f5a6a75a01c78f984716f42eb4999 12-Jun-2017 Erik Kline <ek@google.com> Make interface IP serving code set LinkProperties

Additionally, clean up awkward IPv6TetheringInterfaceServices
instantiation mechanics. In future, this class will be absorbed
by TetherInterfaceStateMachine (prior to its renaming to IpServer).

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

Merged-In: I8b15edbf04c10cd9429da079c6b79352a6740b3b
Merged-In: I39a1744a7fa9b91e3b607429c79f39578e9bde19
Merged-In: I753ab701f2109c0972816724e73119dc1dbc4dca
Change-Id: Ib620e3df182f9f8e2c019aae1cd8981eb0b29376
(cherry picked from commit dd4d5820344205085c19dc142aec252ea9ac220b)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5219f643ddc18e5c721e9228e97bac1eb2810559 19-Jun-2017 Erik Kline <ek@google.com> Merge "Make interface IP serving code set LinkProperties" am: 1dae9a4709
am: 9461f78541

Change-Id: I753ab701f2109c0972816724e73119dc1dbc4dca
dd4d5820344205085c19dc142aec252ea9ac220b 12-Jun-2017 Erik Kline <ek@google.com> Make interface IP serving code set LinkProperties

Additionally, clean up awkward IPv6TetheringInterfaceServices
instantiation mechanics. In future, this class will be absorbed
by TetherInterfaceStateMachine (prior to its renaming to IpServer).

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

Change-Id: Ib620e3df182f9f8e2c019aae1cd8981eb0b29376
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
1e2897dcff865cc0f00079f2a3c7d5188811544f 09-Jun-2017 Erik Kline <ek@google.com> make UpsreamNetworkMonitor the sole source of upstream network information

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

Merged-In: If45443143777e1446c812563742ae8af68d8f73e
Merged-In: Ifeb49f1b19ab36e438763b569c78a335b094f7d0
Merged-In: Idfebb9b79074f21aeccf773cac98aa7839bda9da
Change-Id: I66ce682cf9c31887264a095a4e4638d281d8ed39
(cherry picked from commit 5bbece747f7179a629eed942e2aa88507e744b6b)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
3760999e347ae1cfa25087451638de8ddc79c9f6 05-Jun-2017 Erik Kline <ek@google.com> Move findPreferredUpstreamType into UNM

This changes the way in which available networks are found. Previously
Tethering asked ConnectivityService for NetworkInfo and checked for
whether or not it was in state CONNECTED.

Here we use the fact that ConnectivityService will not call UNM's
callbacks' onAvailable() methods until the networks in question have
become connected.

Test: as follows
- built
- flashed
- booted
- runtest framework-net passed
Bug: 29337859
Bug: 32163131

Merged-In: I9937297727aa1a063e499fccd5833ace229b1e8a
Merged-In: Ifa1a34a1fb32149085421a63cb0f2586d2862d6b
Merged-In: Ia215e55b69b856f5511e5d4f852e39fa6c11462e
Change-Id: I97abe225fdd3accb38bd9168f545445b761a90d8
(cherry picked from commit a1d368af2f01e2048240fb730f6cc399fc1cc1ab)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a8e2e799a88be8f3eb93132da1f1982a9273eb64 13-Jun-2017 Erik Kline <ek@google.com> Merge IPv6TetheringInterfaceServices into TetherInterfaceStateMachine

Ideally this would have been done immediately after IPv6 tethering code
was made part of an official named release. Getting this in now should
help with the relaying of LinkProperties that is required for offload.

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

Merged-In: Ib6e6356e6caa469523fc098e850108de97b494e2
Merged-In: Iec52309a56dd38ac9854ce40a792b3b622f0b015
Merged-In: I5eb3c02331aabc033ecfebee2900477c61e1b6f6
Change-Id: I015fa3cb05a15624f9e80b7aa5a871cefef431b7
(cherry picked from commit 94ae4c99c5a0d580f5898d480e1e1d08a292d060)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
d2bf55e300a5a6c53b2f0af576328a788ddd0656 14-Jun-2017 Erik Kline <ek@google.com> Merge "Merge IPv6TetheringInterfaceServices into TetherInterfaceStateMachine" am: 6f029bbc82
am: 35728f01cb

Change-Id: I5eb3c02331aabc033ecfebee2900477c61e1b6f6
94ae4c99c5a0d580f5898d480e1e1d08a292d060 13-Jun-2017 Erik Kline <ek@google.com> Merge IPv6TetheringInterfaceServices into TetherInterfaceStateMachine

Ideally this would have been done immediately after IPv6 tethering code
was made part of an official named release. Getting this in now should
help with the relaying of LinkProperties that is required for offload.

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

Change-Id: I015fa3cb05a15624f9e80b7aa5a871cefef431b7
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
4bcce2b2efa3f7e31fcdb998581f1843e2c17725 13-Jun-2017 Erik Kline <ek@google.com> Merge "make UpsreamNetworkMonitor the sole source of upstream network information" am: 30a1cf96bb
am: cfaeabb3e3

Change-Id: Idfebb9b79074f21aeccf773cac98aa7839bda9da
e13b93c5858f7aec1609c27eec5374d3a5b0e541 13-Jun-2017 Erik Kline <ek@google.com> Merge "Only disable Wi-Fi IP serving on specific interface, if available" am: 6428e1a4d4
am: e675273dbc

Change-Id: I99b170ebacc4135d1a09ce1ec3d43f76c6765de4
5bbece747f7179a629eed942e2aa88507e744b6b 09-Jun-2017 Erik Kline <ek@google.com> make UpsreamNetworkMonitor the sole source of upstream network information

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131
Change-Id: I66ce682cf9c31887264a095a4e4638d281d8ed39
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
218c226b0882640a351deb0dd945a30b8bc32fff 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

Change-Id: Ifd9131bad20810ee24c9436d8c0df7a81fae11d5
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
6e9a10104c77e8f16c66ee0a435af6ec395369a2 06-Jun-2017 Erik Kline <ek@google.com> Convert IControlsTethering from interface into callback

Additionally:
- add updateLinkProperties() method to new callback
- skeletally connect LinkProperties updates through
to OffloadController

TODOs liberally sprinkled through out.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Merged-In: I178130e65db4fef26d62ea7eaa9a52f7e8103432
Merged-In: I832d77747de7517513c22d36fff4a2fa2bb95154
Change-Id: I631d17b26be153534551a1615931fc98b598b953
(cherry picked from commit ab6439b0f8dd0a67c81235a3fc4d9c149de3780d)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
b9fc817f59a373e58ba847f2b4e2216fedeeaa34 09-Jun-2017 Erik Kline <ek@google.com> Merge "Convert IControlsTethering from interface into callback" am: 5b9d362b60
am: ad3fd82f8b

Change-Id: Ib1f41df1200378191c0722a280939ccbde539920
e7d76993811ffd7f6bab233ea95bb775e6fb689f 08-Jun-2017 Erik Kline <ek@google.com> Delete legacy "wifi interface name guessing" behaviour
am: 9e22554068

Change-Id: Iecb4498c004a45403213d6e4bd7b6f8725334646
998e766accec19900daa4d339c78c903ca7a9d99 08-Jun-2017 Erik Kline <ek@google.com> Delete legacy "wifi interface name guessing" behaviour
am: 9e22554068

Change-Id: I25e3814f979dbe65055498c85b34411cf6d3c996
ab6439b0f8dd0a67c81235a3fc4d9c149de3780d 06-Jun-2017 Erik Kline <ek@google.com> Convert IControlsTethering from interface into callback

Additionally:
- add updateLinkProperties() method to new callback
- skeletally connect LinkProperties updates through
to OffloadController

TODOs liberally sprinkled through out.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Change-Id: I631d17b26be153534551a1615931fc98b598b953
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
ad652cbcf34aa25418b035b6badea09974650771 08-Jun-2017 Erik Kline <ek@google.com> Merge "Move findPreferredUpstreamType into UNM" am: 32703994fe
am: 8bc87070f9

Change-Id: Ia215e55b69b856f5511e5d4f852e39fa6c11462e
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
a1d368af2f01e2048240fb730f6cc399fc1cc1ab 05-Jun-2017 Erik Kline <ek@google.com> Move findPreferredUpstreamType into UNM

This changes the way in which available networks are found. Previously
Tethering asked ConnectivityService for NetworkInfo and checked for
whether or not it was in state CONNECTED.

Here we use the fact that ConnectivityService will not call UNM's
callbacks' onAvailable() methods until the networks in question have
become connected.

Test: as follows
- built
- flashed
- booted
- runtest framework-net passed
Bug: 32163131

Change-Id: I97abe225fdd3accb38bd9168f545445b761a90d8
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
ea7a46cee6c35548144ba89839158d4ce7ab23b2 05-Jun-2017 Erik Kline <ek@google.com> Merge "Minor upstream selection refactoring" am: 12fe022fbd am: 2cb58deb7b
am: 3e402328d5

Change-Id: I6ee263014ad42f7e195cd5d1806916a5c3ef18e0
93c4afae07e15b89a1aaacdb5242cefa1c0c2fb2 04-Jun-2017 Erik Kline <ek@google.com> Minor upstream selection refactoring

Specifically:
- relocated "tryCell" handling
- minor logging change
- remove unneeded checkExpectedThread()

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 32163131
Change-Id: I2f5428206503fd222b959e695c26326df53038f1
/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
729c31c2e9167e71c59a89191414151739f26b96 02-Jun-2017 Erik Kline <ek@google.com> Merge "Handle Wi-Fi passing explicit interface name and AP/IP mode" am: 3478ff8c9e am: 1536453059
am: 00956c4f7c

Change-Id: I599813c4b4d866623344df56f62ed6a40b4025d6
2efb827f61db989ab55792052c99713ef5f5eefa 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: 62076211
Change-Id: I3557a9c14f4e9f1de1869084566a179003d98ffe
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
9d2abb4b40f1c782280b35d8e225364624afb28d 01-Jun-2017 Erik Kline <ek@google.com> Merge "Add a tethering offload settings kill switch" am: 7cf3086f37 am: 503a6952b2
am: 03941982dc

Change-Id: I7e15919817c59579ff6e7b28e858f13c3090ee5c
92c4db04e54a7bb375df01ce6e3fd98d568c6990 31-May-2017 Erik Kline <ek@google.com> Add a tethering offload settings kill switch

Check for tether_offload_disabled (defaulting to false if not present)
before starting the OffloadController.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: Ifcc0eb1a41f09ad9e717c9252d2d55e69789669b
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7287c98414b0659b4e7f1769abc9dc9c4a6f2829 29-May-2017 Erik Kline <ek@google.com> Merge "Support "dumpsys connectivity tethering"" am: 6cdcba7b48 am: 06e6033327
am: ff8b93f815

Change-Id: I68ff0810e4109c52e1d594a4b75fc768570ef59d
ee363c4e9b4090bb73e99b68193074fce503e5ca 29-May-2017 Erik Kline <ek@google.com> Support "dumpsys connectivity tethering"

Also print current upstream interface in tethering dump output.

Test: as follows
- build
- flashed
- booted
- runtest frameworks-net passes
- "dumpsys connectivity tethering" shows just tethering info
Bug: 32163131
Bug: 36504926
Bug: 36988090
Bug: 38152109
Bug: 38186915
Bug: 38218697
Change-Id: I7f185fd71946a032e7f815207016294892df135d
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
3f5f551042c23a6ca89ddd67b273c7767979a29e 28-May-2017 Erik Kline <ek@google.com> Merge "Minor improvement in logging in TetheringConfiguration" am: 39ce589f0b am: 8211c36db9
am: 1315903420

Change-Id: I77b4db07f2a43a576146537ae2ab72d2d0ebdde6
6bd745320619dc43fec2326582c5f5b2f3c9a740 19-May-2017 Erik Kline <ek@google.com> Minor improvement in logging in TetheringConfiguration

Test: as follows
- built
- booted
- flashed
- runtest frameworks-net passes
- dumpsys connectivity shows expected output
Bug: 32163131
Bug: 36504926
Bug: 36988090
Bug: 38152109
Bug: 38186915
Bug: 38218697
Change-Id: I4a2129d780dfec7bca693486a100ea3c78465430
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
aa75fc4ec918b949010c9f9d5f9cca8d67fa34d2 26-May-2017 Erik Kline <ek@google.com> Merge "Support registration of offload control callbacks." am: 7ee96625c2 am: 66cc06c2c7
am: 96c6d201f4

Change-Id: Ie3c4b0929ccf311b4f02fffe0908571cbbb7d772
f4b6e34fc093d0e493bc97e91b71d753720f7114 25-Apr-2017 Erik Kline <ek@google.com> Support registration of offload control callbacks.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: I054cdf6a277c77e4cbf5c81145446a9be1c5fe39
/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
2a508a776f8a2f337e67daf49d5b140484876666 23-May-2017 Erik Kline <ek@google.com> Merge "Refactor TISM add/remove code" am: 5041bbde19 am: c85053f7eb
am: 2e33be3ca9

Change-Id: Ic1bcb3ca011bdc886086f34be18409eb5b12f521
5041bbde19e2f2d396045d73cb5d05a05011ce22 23-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Refactor TISM add/remove code"
73e7a17a216de0e884d3c77914380eb7902f2d03 22-May-2017 zhouzhijie <zhouzhijie@xiaomi.com> Merge "Creat a new notification to avoid the mTetheredNotificationBuilder changed" am: 99cf40a25a am: 3818d4187c
am: b7681ecd46

Change-Id: I95284107f41b8bc4f4eae0870796f85a8b0b178b
99cf40a25a23393b7463e9c5f664c4586c5eca48 22-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Creat a new notification to avoid the mTetheredNotificationBuilder changed"
4dd9bb83e2779b309dcc7a7db389b16fa3cb05be 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
Change-Id: I44a57660d23e76a7c13368cb8f60eaeac5830a0a
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
308ed7f4672c9b7e1aa594b95723410098c9b7a9 18-May-2017 Erik Kline <ek@google.com> Merge "Expand logging capabilities of Tethering subsystem" am: 0373340b07 am: 96f9371a66
am: 945ff184c2

Change-Id: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
130d45966fcb4ff6d0b5e4a88b271e5c41163ae4 18-May-2017 zhouzhijie <zhouzhijie@xiaomi.com> Creat a new notification to avoid the mTetheredNotificationBuilder changed

Now the method NotificationBuilder.build() is different with m.
it is not creat new notification. But here it need to creat a
new notification to avoid the mTetheredNotificationBuilder
changed. So we use buildInto to replace build

Change-Id: I274ec833de4ade4a778e1937a09d1e6242d92a7f
Signed-off-by: zhouzhijie <zhouzhijie@xiaomi.com>
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
7747fd4ce055e8e1f6381062a58b867728f57d85 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
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
5a7c8a0b24adc0f5d5ce3b98e995ef78096abf5b 30-Apr-2017 Erik Kline <ek@google.com> Add tethering offload HAL call via JNI

Additionally, try to locate java Control interface.

Test: as follows
- built
- flashed
- booted
- OffloadController log messages observed, but only ever
"not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Merged-In: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
(cherry picked from commit 58ed1b051bdffd239d92919170a0bb41a4cc197c)
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
47222fc935891d5e4aa147c2b6763efeedd99a39 30-Apr-2017 Erik Kline <ek@google.com> Add tethering offload HAL call via JNI

Additionally, try to locate java Control interface.

Test: as follows
- built
- flashed
- booted
- OffloadController log messages observed, but only ever
"not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Merged-In: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
(cherry picked from commit 58ed1b051bdffd239d92919170a0bb41a4cc197c)
/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
d1ea33a0399e4f937183009f9c57412053775ad6 09-May-2017 Erik Kline <ek@google.com> Merge "Refactor and improve logging." am: c3d41d5093 am: 8af8235bca
am: 9f76683c59

Change-Id: Ieb9a8e3f85f41d18056a7827997f12986ff13ca1
1fdc2e23b5d8136e06cafd7de896b49e5f929c7f 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

Change-Id: I14d6da18660223f7cace156cb6594ee18928a7b0
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
a805bfc4cab91a718f10d46e287dc956b9007e8f 29-Apr-2017 Erik Kline <ek@google.com> Merge "Use ConnectivityService's NETWORK_STACK permission for SoftAp operations" am: 169681db26 am: b663a7d6d7
am: b6ec8ed691

Change-Id: If6c7225e853e1969022d9b9d6cee127c477e0df7
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
256be78f7d00c619cca9ed5a550b04fabd4cc48e 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
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
45cb5e37b030c8834ed06c13808aa26d070889f2 28-Apr-2017 Erik Kline <ek@google.com> Merge "Notify WifiManager of interface state changes" am: 8e97274186 am: 241a7f15f2
am: 2439781719

Change-Id: I5b3f640f4dd5cfac7555ddf1f6ae752899caddb0
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
216af6d3febb109628d9185ec1a619f0e003bcd1 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
09d1588183f717378b97a854ce53000792ef9736 21-Apr-2017 Erik Kline <ek@google.com> Merge "Clarify IControlsTethering LOCAL_ONLY state name" am: 649c459858 am: f7c93bcd45
am: 6305795287

Change-Id: Idf256ced2c3403f9672b29c10ec02adb44a0ab7c
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
ca41be796a56fab152cd07bbeaf9283de7e8be90 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
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
dc7e445bc7def6ae901e7d9770bbf31eb9a15269 20-Apr-2017 Erik Kline <ek@google.com> Merge "Switch to WifiManager.{start,stop}SoftAp()" am: 275edcb940 am: 11fdd1769b
am: 7d321645a2

Change-Id: I40e72d9b8f99c52089a8c73c8ca20d1efd10c68d
275edcb940f1fb0aba53f19b87fe76d6fd8538a0 20-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Switch to WifiManager.{start,stop}SoftAp()"
c9ee35581ccc69b9480178c2b7280bd10f42be5f 20-Apr-2017 Erik Kline <ek@google.com> Merge "Add local-only hotspot info into tether state change broadcast" am: 4c7a999d79 am: 6af3dd0fc3
am: 3fa8908370

Change-Id: If3851c3f15314e3c0d357e154049aaa2b8b5c8e7
8351faa900acdba1022f03bb3f18e26f539eadae 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
ceb54c63dc7af8f11ec9eac4993a43b9e788ee2f 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
/frameworks/base/services/core/java/com/android/server/connectivity/Tethering.java
152c9cf703bb0f4ac7133761f744f8604e4f97fa 13-Apr-2017 Erik Kline <ek@google.com> Merge "Extract SimChangeListener to its own file" am: 0ef8df6d52 am: 85f5725fb5
am: 270ab2fa7e

Change-Id: Ic39902fe33258dad0315a82b46f37582ba968085
227648f3368876c1cc249f40c26b32b250fd3cae 20-Jan-2017 Erik Kline <ek@google.com> Extract SimChangeListener to its own file

Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- runtest -x full/path/to/SimChangeListenerTest.java passes
Bug: 32163131
Change-Id: If90539fe9a5dc07c7c24ed0b70b920d94065a623
/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
f700d5cad7ed9834dd16635d7626586e9912f6d0 10-Apr-2017 Erik Kline <ek@google.com> Merge "Tethering: support Local-only Hotspot mode for downstreams" am: d3128d4b55 am: 908ce167eb
am: f6626e812c

Change-Id: I79677f7e8e7ae5abec2a13b5e5391b8f07857a36
ea9cc488eb0f096c9fd402eff49e3d30f5b6de2e 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