diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-05-21 16:32:11 -0700 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2014-05-21 16:41:24 -0700 |
commit | f9ff2c9ae5595a20d77b10a41386932de1fc2da2 (patch) | |
tree | 5c122f3e21dfb7764a4d4fcfd1018f569839a5bd | |
parent | 4e5aa2cee69f6791f8001aeb1fc12389863fab8f (diff) | |
download | frameworks_base-f9ff2c9ae5595a20d77b10a41386932de1fc2da2.zip frameworks_base-f9ff2c9ae5595a20d77b10a41386932de1fc2da2.tar.gz frameworks_base-f9ff2c9ae5595a20d77b10a41386932de1fc2da2.tar.bz2 |
Make the EthernetManager available.
Change-Id: I7a60e977d7a40a5d0367168f2f6633ccae591ac4
-rw-r--r-- | core/java/android/app/ContextImpl.java | 9 | ||||
-rw-r--r-- | core/java/android/content/Context.java | 15 | ||||
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 8 |
3 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index b247580..74a1037 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -73,6 +73,8 @@ import android.media.MediaRouter; import android.media.session.MediaSessionManager; import android.net.ConnectivityManager; import android.net.IConnectivityManager; +import android.net.EthernetManager; +import android.net.IEthernetManager; import android.net.INetworkPolicyManager; import android.net.NetworkPolicyManager; import android.net.NetworkScoreManager; @@ -599,6 +601,13 @@ class ContextImpl extends Context { return new WifiScanner(ctx.getOuterContext(), service); }}); + registerService(ETHERNET_SERVICE, new ServiceFetcher() { + public Object createService(ContextImpl ctx) { + IBinder b = ServiceManager.getService(ETHERNET_SERVICE); + IEthernetManager service = IEthernetManager.Stub.asInterface(b); + return new EthernetManager(ctx.getOuterContext(), service); + }}); + registerService(WINDOW_SERVICE, new ServiceFetcher() { Display mDefaultDisplay; public Object getService(ContextImpl ctx) { diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index c11b04c..bfdc189 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2069,6 +2069,9 @@ public abstract class Context { * <dt> {@link #WIFI_P2P_SERVICE} ("wifip2p") * <dd> A {@link android.net.wifi.p2p.WifiP2pManager WifiP2pManager} for management of * Wi-Fi Direct connectivity. + * <dt> {@link #ETHERNET_SERVICE} ("ethernet") + * <dd> A {@link android.net.ethernet.EthernetManager EthernetManager} for + * management of Ethernet connectivity. * <dt> {@link #INPUT_METHOD_SERVICE} ("input_method") * <dd> An {@link android.view.inputmethod.InputMethodManager InputMethodManager} * for management of input methods. @@ -2382,6 +2385,18 @@ public abstract class Context { /** * Use with {@link #getSystemService} to retrieve a {@link + * android.net.ethernet.EthernetManager} for handling management of + * Ethernet access. + * + * @see #getSystemService + * @see android.net.ethernet.EthernetManager + * + * @hide + */ + public static final String ETHERNET_SERVICE = "ethernet"; + + /** + * Use with {@link #getSystemService} to retrieve a {@link * android.net.nsd.NsdManager} for handling management of network service * discovery * diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 55ae9c6..de46b16 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -130,6 +130,8 @@ public final class SystemServer { "com.android.server.wifi.p2p.WifiP2pService"; private static final String HDMI_CEC_SERVICE_CLASS = "com.android.server.hdmi.HdmiCecService"; + private static final String ETHERNET_SERVICE_CLASS = + "com.android.server.ethernet.EthernetService"; private final int mFactoryTestMode; private Timer mProfilerSnapshotTimer; @@ -660,6 +662,12 @@ public final class SystemServer { } try { + mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS); + } catch (Throwable e) { + reportWtf("starting Ethernet Service", e); + } + + try { Slog.i(TAG, "Connectivity Service"); connectivity = new ConnectivityService( context, networkManagement, networkStats, networkPolicy); |