DO NOT MERGE Fixes in comments for NetworkEvent, DnsEvent and ConnectEvent
Test: the APIs will be tested by CTS when unhidden
Bug: 29748723
(cherry picked from commit da9d3ad3ac)
Change-Id: Iaff05eb6d4a2fd12e0271c703d694ecfc0dc9a17
This commit is contained in:
@@ -31,6 +31,7 @@ public final class ConnectEvent extends NetworkEvent implements Parcelable {
|
|||||||
/** The destination port number. */
|
/** The destination port number. */
|
||||||
private final int port;
|
private final int port;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
public ConnectEvent(String ipAddress, int port, String packageName, long timestamp) {
|
public ConnectEvent(String ipAddress, int port, String packageName, long timestamp) {
|
||||||
super(packageName, timestamp);
|
super(packageName, timestamp);
|
||||||
this.ipAddress = ipAddress;
|
this.ipAddress = ipAddress;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public final class DnsEvent extends NetworkEvent implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private final int ipAddressesCount;
|
private final int ipAddressesCount;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
public DnsEvent(String hostname, String[] ipAddresses, int ipAddressesCount,
|
public DnsEvent(String hostname, String[] ipAddresses, int ipAddressesCount,
|
||||||
String packageName, long timestamp) {
|
String packageName, long timestamp) {
|
||||||
super(packageName, timestamp);
|
super(packageName, timestamp);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.app.admin;
|
package android.app.admin;
|
||||||
|
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.os.ParcelFormatException;
|
import android.os.ParcelFormatException;
|
||||||
@@ -35,21 +36,29 @@ public abstract class NetworkEvent implements Parcelable {
|
|||||||
/** The timestamp of the event being reported in milliseconds. */
|
/** The timestamp of the event being reported in milliseconds. */
|
||||||
long timestamp;
|
long timestamp;
|
||||||
|
|
||||||
protected NetworkEvent() {
|
/** @hide */
|
||||||
|
NetworkEvent() {
|
||||||
//empty constructor
|
//empty constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
protected NetworkEvent(String packageName, long timestamp) {
|
/** @hide */
|
||||||
|
NetworkEvent(String packageName, long timestamp) {
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the package name of the UID that performed the query. */
|
/**
|
||||||
|
* Returns the package name of the UID that performed the query, as returned by
|
||||||
|
* {@link PackageManager#getNameForUid}.
|
||||||
|
*/
|
||||||
public String getPackageName() {
|
public String getPackageName() {
|
||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the timestamp of the event being reported in milliseconds. */
|
/**
|
||||||
|
* Returns the timestamp of the event being reported in milliseconds, the difference between
|
||||||
|
* the time the event was reported and midnight, January 1, 1970 UTC.
|
||||||
|
*/
|
||||||
public long getTimestamp() {
|
public long getTimestamp() {
|
||||||
return timestamp;
|
return timestamp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user