OSDN Git Service

Refactor isTetheringSupported() calls
authorErik Kline <ek@google.com>
Fri, 9 Mar 2018 05:18:02 +0000 (14:18 +0900)
committerErik Kline <ek@google.com>
Sat, 31 Mar 2018 00:24:43 +0000 (17:24 -0700)
commit465ff3a0c1da8afd5cb13b25ed9a3c95ee0dd2c4
tree4244fd2c83b485e8d21a25ef511ef910b5feae97
parent786150bc0924e6effbddb8d11592d18f1372498e
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

Change-Id: Ia64faaadefb4a5d84a50da98bdebd544b6fda101
services/core/java/com/android/server/ConnectivityService.java
services/core/java/com/android/server/connectivity/Tethering.java
services/core/java/com/android/server/connectivity/tethering/TetheringDependencies.java
tests/net/java/com/android/server/connectivity/TetheringTest.java