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:
Michal Karpinski
2016-12-05 13:31:40 +00:00
parent 0c4ec00f85
commit e3639a0a07
3 changed files with 15 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ public final class ConnectEvent extends NetworkEvent implements Parcelable {
/** The destination port number. */
private final int port;
/** @hide */
public ConnectEvent(String ipAddress, int port, String packageName, long timestamp) {
super(packageName, timestamp);
this.ipAddress = ipAddress;

View File

@@ -37,6 +37,7 @@ public final class DnsEvent extends NetworkEvent implements Parcelable {
*/
private final int ipAddressesCount;
/** @hide */
public DnsEvent(String hostname, String[] ipAddresses, int ipAddressesCount,
String packageName, long timestamp) {
super(packageName, timestamp);

View File

@@ -16,6 +16,7 @@
package android.app.admin;
import android.content.pm.PackageManager;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.ParcelFormatException;
@@ -35,21 +36,29 @@ public abstract class NetworkEvent implements Parcelable {
/** The timestamp of the event being reported in milliseconds. */
long timestamp;
protected NetworkEvent() {
/** @hide */
NetworkEvent() {
//empty constructor
}
protected NetworkEvent(String packageName, long timestamp) {
/** @hide */
NetworkEvent(String packageName, long timestamp) {
this.packageName = packageName;
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() {
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() {
return timestamp;
}