summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChiachang Wang <chiachangwang@google.com>2020-12-23 06:49:33 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-12-23 06:49:33 +0000
commita53b25ad26dd48151d6abf6eba6e90d5f2cac1ef (patch)
treeb48a4e242265c2d6cc980dee249102d84cf16ec6
parenta817ecd4b5589a6e7e30388227f269e20ef3eef5 (diff)
parent57957ec1009069035ac33c36877afa00b3e86e56 (diff)
Merge "[IT4.1] Clean up to remove no-op logic" am: af0c29529d am: 57957ec100
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1529103 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Icfccefc4c1076c9eb058db7eb713aa5323d734c7
-rw-r--r--services/core/java/com/android/server/NetworkManagementService.java30
1 files changed, 7 insertions, 23 deletions
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 39e005172b03..d30adf1b68eb 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -396,22 +396,12 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
* Notify our observers of a change in the data activity state of the interface
*/
private void notifyInterfaceClassActivity(int type, boolean isActive, long tsNanos,
- int uid, boolean fromRadio) {
+ int uid) {
final boolean isMobile = ConnectivityManager.isNetworkTypeMobile(type);
int powerState = isActive
? DataConnectionRealTimeInfo.DC_POWER_STATE_HIGH
: DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
if (isMobile) {
- if (!fromRadio) {
- if (mMobileActivityFromRadio) {
- // If this call is not coming from a report from the radio itself, but we
- // have previously received reports from the radio, then we will take the
- // power state to just be whatever the radio last reported.
- powerState = mLastPowerStateFromRadio;
- }
- } else {
- mMobileActivityFromRadio = true;
- }
if (mLastPowerStateFromRadio != powerState) {
mLastPowerStateFromRadio = powerState;
try {
@@ -431,15 +421,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
}
}
- if (!isMobile || fromRadio || !mMobileActivityFromRadio) {
- // Report the change in data activity. We don't do this if this is a change
- // on the mobile network, that is not coming from the radio itself, and we
- // have previously seen change reports from the radio. In that case only
- // the radio is the authority for the current state.
- final boolean active = isActive;
- invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
- Integer.toString(type), active, tsNanos, uid));
- }
+ final boolean active = isActive;
+ invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
+ Integer.toString(type), active, tsNanos, uid));
boolean report = false;
synchronized (mIdleTimerLock) {
@@ -671,7 +655,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
timestampNanos = timestamp;
}
mDaemonHandler.post(() ->
- notifyInterfaceClassActivity(label, isActive, timestampNanos, uid, false));
+ notifyInterfaceClassActivity(label, isActive, timestampNanos, uid));
}
@Override
@@ -1157,7 +1141,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
mNetworkActive = false;
}
mDaemonHandler.post(() -> notifyInterfaceClassActivity(type, true,
- SystemClock.elapsedRealtimeNanos(), -1, false));
+ SystemClock.elapsedRealtimeNanos(), -1));
}
}
@@ -1181,7 +1165,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
}
mActiveIdleTimers.remove(iface);
mDaemonHandler.post(() -> notifyInterfaceClassActivity(params.type, false,
- SystemClock.elapsedRealtimeNanos(), -1, false));
+ SystemClock.elapsedRealtimeNanos(), -1));
}
}