summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/android/net/dhcp/DhcpDiscoverPacket.java2
-rw-r--r--src/android/net/dhcp/DhcpPacket.java28
-rw-r--r--src/com/android/server/NetworkObserverRegistry.java12
3 files changed, 18 insertions, 24 deletions
diff --git a/src/android/net/dhcp/DhcpDiscoverPacket.java b/src/android/net/dhcp/DhcpDiscoverPacket.java
index 11f2b61..9707d13 100644
--- a/src/android/net/dhcp/DhcpDiscoverPacket.java
+++ b/src/android/net/dhcp/DhcpDiscoverPacket.java
@@ -22,7 +22,7 @@ import java.nio.ByteBuffer;
/**
* This class implements the DHCP-DISCOVER packet.
*/
-class DhcpDiscoverPacket extends DhcpPacket {
+public class DhcpDiscoverPacket extends DhcpPacket {
/**
* The IP address of the client which sent this packet.
*/
diff --git a/src/android/net/dhcp/DhcpPacket.java b/src/android/net/dhcp/DhcpPacket.java
index a15d423..d5c3efb 100644
--- a/src/android/net/dhcp/DhcpPacket.java
+++ b/src/android/net/dhcp/DhcpPacket.java
@@ -108,22 +108,22 @@ public abstract class DhcpPacket {
/**
* The client DHCP port.
*/
- static final short DHCP_CLIENT = (short) 68;
+ public static final short DHCP_CLIENT = (short) 68;
/**
* The server DHCP port.
*/
- static final short DHCP_SERVER = (short) 67;
+ public static final short DHCP_SERVER = (short) 67;
/**
* The message op code indicating a request from a client.
*/
- protected static final byte DHCP_BOOTREQUEST = (byte) 1;
+ public static final byte DHCP_BOOTREQUEST = (byte) 1;
/**
* The message op code indicating a response from the server.
*/
- protected static final byte DHCP_BOOTREPLY = (byte) 2;
+ public static final byte DHCP_BOOTREPLY = (byte) 2;
/**
* The code type used to identify an Ethernet MAC address in the
@@ -139,7 +139,7 @@ public abstract class DhcpPacket {
/**
* The magic cookie that identifies this as a DHCP packet instead of BOOTP.
*/
- private static final int DHCP_MAGIC_COOKIE = 0x63825363;
+ public static final int DHCP_MAGIC_COOKIE = 0x63825363;
/**
* DHCP Optional Type: DHCP Subnet Mask
@@ -221,16 +221,16 @@ public abstract class DhcpPacket {
/**
* DHCP Optional Type: DHCP Message Type
*/
- protected static final byte DHCP_MESSAGE_TYPE = 53;
+ public static final byte DHCP_MESSAGE_TYPE = 53;
// the actual type values
- protected static final byte DHCP_MESSAGE_TYPE_DISCOVER = 1;
- protected static final byte DHCP_MESSAGE_TYPE_OFFER = 2;
- protected static final byte DHCP_MESSAGE_TYPE_REQUEST = 3;
- protected static final byte DHCP_MESSAGE_TYPE_DECLINE = 4;
- protected static final byte DHCP_MESSAGE_TYPE_ACK = 5;
- protected static final byte DHCP_MESSAGE_TYPE_NAK = 6;
- protected static final byte DHCP_MESSAGE_TYPE_RELEASE = 7;
- protected static final byte DHCP_MESSAGE_TYPE_INFORM = 8;
+ public static final byte DHCP_MESSAGE_TYPE_DISCOVER = 1;
+ public static final byte DHCP_MESSAGE_TYPE_OFFER = 2;
+ public static final byte DHCP_MESSAGE_TYPE_REQUEST = 3;
+ public static final byte DHCP_MESSAGE_TYPE_DECLINE = 4;
+ public static final byte DHCP_MESSAGE_TYPE_ACK = 5;
+ public static final byte DHCP_MESSAGE_TYPE_NAK = 6;
+ public static final byte DHCP_MESSAGE_TYPE_RELEASE = 7;
+ public static final byte DHCP_MESSAGE_TYPE_INFORM = 8;
/**
* DHCP Optional Type: DHCP Server Identifier
diff --git a/src/com/android/server/NetworkObserverRegistry.java b/src/com/android/server/NetworkObserverRegistry.java
index afe166b..b83bc5c 100644
--- a/src/com/android/server/NetworkObserverRegistry.java
+++ b/src/com/android/server/NetworkObserverRegistry.java
@@ -42,19 +42,13 @@ public class NetworkObserverRegistry extends INetdUnsolicitedEventListener.Stub
private static final String TAG = NetworkObserverRegistry.class.getSimpleName();
/**
- * Constructs a new NetworkObserverRegistry.
- *
- * <p>Only one registry should be used per process since netd will silently ignore multiple
- * registrations from the same process.
- */
- NetworkObserverRegistry() {}
-
- /**
* Start listening for Netd events.
*
* <p>This should be called before allowing any observer to be registered.
+ * Note there is no unregister method. The only way to unregister is when the process
+ * terminates.
*/
- void register(@NonNull INetd netd) throws RemoteException {
+ public void register(@NonNull INetd netd) throws RemoteException {
netd.registerUnsolicitedEventListener(this);
}