Handle removed UIDs in network stats and policy.
When UID_REMOVED, clean up any existing UID network policy so it
doesn't linger for future apps. Also move any NetworkStatsHistory
to special UID_REMOVED tracking bucket.
Tests for new removal code. Also test detailed UID stats, including
network changes to verify template matching logic.
Bug: 4584212
Change-Id: I9faadf6b6f3830eb45d86c7f1980a27cdbcdb11e
This commit is contained in:
parent
de450f98eb
commit
d57635406d
1 changed files with 177 additions and 15 deletions
|
|
@ -29,18 +29,27 @@ public class NetworkState implements Parcelable {
|
|||
public final NetworkInfo networkInfo;
|
||||
public final LinkProperties linkProperties;
|
||||
public final LinkCapabilities linkCapabilities;
|
||||
/** Currently only used by testing. */
|
||||
public final String subscriberId;
|
||||
|
||||
public NetworkState(NetworkInfo networkInfo, LinkProperties linkProperties,
|
||||
LinkCapabilities linkCapabilities) {
|
||||
this(networkInfo, linkProperties, linkCapabilities, null);
|
||||
}
|
||||
|
||||
public NetworkState(NetworkInfo networkInfo, LinkProperties linkProperties,
|
||||
LinkCapabilities linkCapabilities, String subscriberId) {
|
||||
this.networkInfo = networkInfo;
|
||||
this.linkProperties = linkProperties;
|
||||
this.linkCapabilities = linkCapabilities;
|
||||
this.subscriberId = subscriberId;
|
||||
}
|
||||
|
||||
public NetworkState(Parcel in) {
|
||||
networkInfo = in.readParcelable(null);
|
||||
linkProperties = in.readParcelable(null);
|
||||
linkCapabilities = in.readParcelable(null);
|
||||
subscriberId = in.readString();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
@ -53,6 +62,7 @@ public class NetworkState implements Parcelable {
|
|||
out.writeParcelable(networkInfo, flags);
|
||||
out.writeParcelable(linkProperties, flags);
|
||||
out.writeParcelable(linkCapabilities, flags);
|
||||
out.writeString(subscriberId);
|
||||
}
|
||||
|
||||
public static final Creator<NetworkState> CREATOR = new Creator<NetworkState>() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue