Direct notification of network interface changes.

Connectivity broadcasts recently changed and are no longer sent for
certain types of network changes.  For example, when stacked network
interfaces change for a mobile network.  To ensure that we pick up
all these details, directly wire the two services together.

Also remove some unused code for split network types.

Bug: 18666753
Change-Id: I0467bd5b330c0e0cb51af2306d821b41ad16337a
This commit is contained in:
Jeff Sharkey
2014-12-08 14:50:12 -08:00
parent ae5a8a5ec8
commit 5fb4f650df
4 changed files with 25 additions and 63 deletions

View File

@@ -40,8 +40,12 @@ interface INetworkStatsService {
/** Mark given UID as being in foreground for stats purposes. */
void setUidForeground(int uid, boolean uidForeground);
/** Force update of ifaces. */
void forceUpdateIfaces();
/** Force update of statistics. */
void forceUpdate();
/** Advise persistance threshold; may be overridden internally. */
void advisePersistThreshold(long thresholdBytes);

View File

@@ -41,7 +41,11 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> {
/**
* When enabled, combine all {@link #mSubType} together under
* {@link #SUBTYPE_COMBINED}.
*
* @deprecated we no longer offer to collect statistics on a per-subtype
* basis; this is always disabled.
*/
@Deprecated
public static final boolean COMBINE_SUBTYPE_ENABLED = true;
public static final int SUBTYPE_COMBINED = -1;

View File

@@ -49,7 +49,9 @@ import java.util.Objects;
public class NetworkTemplate implements Parcelable {
public static final int MATCH_MOBILE_ALL = 1;
@Deprecated
public static final int MATCH_MOBILE_3G_LOWER = 2;
@Deprecated
public static final int MATCH_MOBILE_4G = 3;
public static final int MATCH_WIFI = 4;
public static final int MATCH_ETHERNET = 5;
@@ -293,6 +295,7 @@ public class NetworkTemplate implements Parcelable {
/**
* Check if mobile network classified 3G or lower with matching IMSI.
*/
@Deprecated
private boolean matchesMobile3gLower(NetworkIdentity ident) {
ensureSubtypeAvailable();
if (ident.mType == TYPE_WIMAX) {
@@ -311,6 +314,7 @@ public class NetworkTemplate implements Parcelable {
/**
* Check if mobile network classified 4G with matching IMSI.
*/
@Deprecated
private boolean matchesMobile4g(NetworkIdentity ident) {
ensureSubtypeAvailable();
if (ident.mType == TYPE_WIMAX) {