diff options
author | markchien <markchien@google.com> | 2019-12-16 20:15:20 +0800 |
---|---|---|
committer | markchien <markchien@google.com> | 2019-12-20 10:31:31 +0800 |
commit | ae8aa646dc809e714af45369d9409f63ea367b2c (patch) | |
tree | b0055a73410d13f221aea2a41fd6d10dee635fff /services/java/com/android/server/SystemServer.java | |
parent | 6af4789825dd28fd516df963203965564a004936 (diff) |
[Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.
Bug: 144320246
Test: -build, flash, boot
-atest TetheringTests
Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index f05bbe215b78..50ae3761b255 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -16,6 +16,7 @@ package com.android.server; +import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK; import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_CRITICAL; import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_HIGH; import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL; @@ -42,8 +43,8 @@ import android.database.sqlite.SQLiteCompatibilityWalFlags; import android.database.sqlite.SQLiteGlobal; import android.hardware.display.DisplayManagerInternal; import android.net.ConnectivityModuleConnector; +import android.net.ITetheringConnector; import android.net.NetworkStackClient; -import android.net.TetheringManager; import android.os.BaseBundle; import android.os.Binder; import android.os.Build; @@ -2267,8 +2268,14 @@ public final class SystemServer { t.traceBegin("StartTethering"); try { - // Tethering must start after ConnectivityService and NetworkStack. - TetheringManager.getInstance().start(); + // TODO: hide implementation details, b/146312721. + ConnectivityModuleConnector.getInstance().startModuleService( + ITetheringConnector.class.getName(), + PERMISSION_MAINLINE_NETWORK_STACK, service -> { + ServiceManager.addService(Context.TETHERING_SERVICE, service, + false /* allowIsolated */, + DUMP_FLAG_PRIORITY_HIGH | DUMP_FLAG_PRIORITY_NORMAL); + }); } catch (Throwable e) { reportWtf("starting Tethering", e); } |