commit | 38560561a855797a17c03d75f050ad4c934524a3 | [log] [tgz] |
---|---|---|
author | Lorenzo Colitti <lorenzo@google.com> | Wed Jun 07 11:34:05 2023 +0900 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Wed Jun 14 06:08:58 2023 +0000 |
tree | dab0f36caff9985d026d153917debd3827f4d92d | |
parent | ec562c2e6a690b4966687e9a885d8541bb0259c0 [diff] |
Remove spurious WTF on pre-U devices. aosp/2162425 added a WTF if a NetworkAgent changed state before its native network has been created. This was intended to apply only to the new U+ codepath, where networks are always created immediately as soon as their agents register them. But the WTF is logged on pre-U devices as well. Fix this so that the WTF is only logged when the new codepath is running. Fix: 285999421 Test: TH (cherry picked from https://android-review.googlesource.com/q/commit:233f2d1d19bd36701e0dcfed6a57c85fac678e12) Merged-In: I28bda08a006978ab760fe8891bf5cf15b536201a Change-Id: I28bda08a006978ab760fe8891bf5cf15b536201a
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java index f85f336..28d1d73 100755 --- a/service/src/com/android/server/ConnectivityService.java +++ b/service/src/com/android/server/ConnectivityService.java
@@ -4560,7 +4560,9 @@ if (state == NetworkInfo.State.CONNECTED) return true; if (state != NetworkInfo.State.CONNECTING) { // TODO: throw if no WTFs are observed in the field. - Log.wtf(TAG, "Uncreated network in invalid state: " + state); + if (shouldCreateNetworksImmediately()) { + Log.wtf(TAG, "Uncreated network in invalid state: " + state); + } return false; } return nai.isVPN() || shouldCreateNetworksImmediately();