Merge "Add VPN logs" am: 23d9715001

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2527299

Change-Id: Id1653a0c0ca918873c334ef071ffea7a085ba44c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jean Chalard
2023-04-07 06:25:52 +00:00
committed by Automerger Merge Worker

View File

@@ -3391,6 +3391,7 @@ public class Vpn {
* consistency of the Ikev2VpnRunner fields. * consistency of the Ikev2VpnRunner fields.
*/ */
public void onDefaultNetworkChanged(@NonNull Network network) { public void onDefaultNetworkChanged(@NonNull Network network) {
mEventChanges.log("[UnderlyingNW] Default network changed to " + network);
Log.d(TAG, "onDefaultNetworkChanged: " + network); Log.d(TAG, "onDefaultNetworkChanged: " + network);
// If there is a new default network brought up, cancel the retry task to prevent // If there is a new default network brought up, cancel the retry task to prevent
@@ -3628,6 +3629,7 @@ public class Vpn {
mNetworkCapabilities = new NetworkCapabilities.Builder(mNetworkCapabilities) mNetworkCapabilities = new NetworkCapabilities.Builder(mNetworkCapabilities)
.setTransportInfo(info) .setTransportInfo(info)
.build(); .build();
mEventChanges.log("[VPNRunner] Update agent caps " + mNetworkCapabilities);
doSendNetworkCapabilities(mNetworkAgent, mNetworkCapabilities); doSendNetworkCapabilities(mNetworkAgent, mNetworkCapabilities);
} }
} }
@@ -3664,6 +3666,7 @@ public class Vpn {
private void startIkeSession(@NonNull Network underlyingNetwork) { private void startIkeSession(@NonNull Network underlyingNetwork) {
Log.d(TAG, "Start new IKE session on network " + underlyingNetwork); Log.d(TAG, "Start new IKE session on network " + underlyingNetwork);
mEventChanges.log("[IKE] Start IKE session over " + underlyingNetwork);
try { try {
// Clear mInterface to prevent Ikev2VpnRunner being cleared when // Clear mInterface to prevent Ikev2VpnRunner being cleared when
@@ -3778,6 +3781,7 @@ public class Vpn {
} }
public void onValidationStatus(int status) { public void onValidationStatus(int status) {
mEventChanges.log("[Validation] validation status " + status);
if (status == NetworkAgent.VALIDATION_STATUS_VALID) { if (status == NetworkAgent.VALIDATION_STATUS_VALID) {
// No data stall now. Reset it. // No data stall now. Reset it.
mExecutor.execute(() -> { mExecutor.execute(() -> {
@@ -3818,6 +3822,7 @@ public class Vpn {
* consistency of the Ikev2VpnRunner fields. * consistency of the Ikev2VpnRunner fields.
*/ */
public void onDefaultNetworkLost(@NonNull Network network) { public void onDefaultNetworkLost(@NonNull Network network) {
mEventChanges.log("[UnderlyingNW] Network lost " + network);
// If the default network is torn down, there is no need to call // If the default network is torn down, there is no need to call
// startOrMigrateIkeSession() since it will always check if there is an active network // startOrMigrateIkeSession() since it will always check if there is an active network
// can be used or not. // can be used or not.
@@ -3936,6 +3941,8 @@ public class Vpn {
* consistency of the Ikev2VpnRunner fields. * consistency of the Ikev2VpnRunner fields.
*/ */
public void onSessionLost(int token, @Nullable Exception exception) { public void onSessionLost(int token, @Nullable Exception exception) {
mEventChanges.log("[IKE] Session lost on network " + mActiveNetwork
+ (null == exception ? "" : " reason " + exception.getMessage()));
Log.d(TAG, "onSessionLost() called for token " + token); Log.d(TAG, "onSessionLost() called for token " + token);
if (!isActiveToken(token)) { if (!isActiveToken(token)) {
@@ -4092,6 +4099,7 @@ public class Vpn {
* consistency of the Ikev2VpnRunner fields. * consistency of the Ikev2VpnRunner fields.
*/ */
private void disconnectVpnRunner() { private void disconnectVpnRunner() {
mEventChanges.log("[VPNRunner] Disconnect runner, underlying network" + mActiveNetwork);
mActiveNetwork = null; mActiveNetwork = null;
mUnderlyingNetworkCapabilities = null; mUnderlyingNetworkCapabilities = null;
mUnderlyingLinkProperties = null; mUnderlyingLinkProperties = null;