diff options
| author | 2022-07-08 07:50:54 +0000 | |
|---|---|---|
| committer | 2022-07-08 07:50:54 +0000 | |
| commit | ecef7df64fa6dccf5828081fe37cb0e1d00db3d4 (patch) | |
| tree | cf3813d48b703dee56e03928c2a5629b30010741 | |
| parent | eddf6d85c205a49d5a1603aa8499f2b64db9049d (diff) | |
| parent | 951d5538f352c791013cd82685235657e3117bd2 (diff) | |
Merge "Remove SharedLog usage from NetworkStackClient" am: 8080688fce am: 0a13fe3c3a am: 951d5538f3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2129833
Change-Id: Idf91ba5897892cb02e97a5d352f9d94a4ad10c7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/net/java/android/net/ConnectivityModuleConnector.java | 32 | ||||
| -rw-r--r-- | services/net/java/android/net/NetworkStackClient.java | 45 |
2 files changed, 11 insertions, 66 deletions
diff --git a/services/net/java/android/net/ConnectivityModuleConnector.java b/services/net/java/android/net/ConnectivityModuleConnector.java index c6b15c17bd3c..6bf6349bc4b3 100644 --- a/services/net/java/android/net/ConnectivityModuleConnector.java +++ b/services/net/java/android/net/ConnectivityModuleConnector.java @@ -25,7 +25,6 @@ import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.net.util.SharedLog; import android.os.Build; import android.os.Environment; import android.os.IBinder; @@ -35,13 +34,13 @@ import android.os.UserHandle; import android.provider.DeviceConfig; import android.text.format.DateUtils; import android.util.ArraySet; +import android.util.Log; import android.util.Slog; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import java.io.File; -import java.io.PrintWriter; /** * Class used to communicate to the various networking mainline modules running in the network stack @@ -73,8 +72,6 @@ public class ConnectivityModuleConnector { private static ConnectivityModuleConnector sInstance; private Context mContext; - @GuardedBy("mLog") - private final SharedLog mLog = new SharedLog(TAG); @GuardedBy("mHealthListeners") private final ArraySet<ConnectivityModuleHealthListener> mHealthListeners = new ArraySet<>(); @NonNull @@ -384,38 +381,19 @@ public class ConnectivityModuleConnector { } private void log(@NonNull String message) { - Slog.d(TAG, message); - synchronized (mLog) { - mLog.log(message); - } + Log.d(TAG, message); } private void logWtf(@NonNull String message, @Nullable Throwable e) { Slog.wtf(TAG, message, e); - synchronized (mLog) { - mLog.e(message); - } + Log.e(TAG, message, e); } private void loge(@NonNull String message, @Nullable Throwable e) { - Slog.e(TAG, message, e); - synchronized (mLog) { - mLog.e(message); - } + Log.e(TAG, message, e); } private void logi(@NonNull String message) { - Slog.i(TAG, message); - synchronized (mLog) { - mLog.i(message); - } - } - - /** - * Dump ConnectivityModuleConnector logs to the specified {@link PrintWriter}. - */ - public void dump(PrintWriter pw) { - // dump is thread-safe on SharedLog - mLog.dump(null, pw, null); + Log.i(TAG, message); } } diff --git a/services/net/java/android/net/NetworkStackClient.java b/services/net/java/android/net/NetworkStackClient.java index 865e3b8cc109..b7eb5cd61329 100644 --- a/services/net/java/android/net/NetworkStackClient.java +++ b/services/net/java/android/net/NetworkStackClient.java @@ -25,19 +25,18 @@ import android.content.Context; import android.net.dhcp.DhcpServingParamsParcel; import android.net.dhcp.IDhcpServerCallbacks; import android.net.ip.IIpClientCallbacks; -import android.net.util.SharedLog; import android.os.Binder; import android.os.IBinder; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; +import android.util.Log; import android.util.Slog; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; -import java.io.PrintWriter; import java.util.ArrayList; /** @@ -61,9 +60,6 @@ public class NetworkStackClient { @GuardedBy("mPendingNetStackRequests") private INetworkStackConnector mConnector; - @GuardedBy("mLog") - private final SharedLog mLog = new SharedLog(TAG); - private volatile boolean mWasSystemServerInitialized = false; private interface NetworkStackCallback { @@ -237,34 +233,23 @@ public class NetworkStackClient { } /** - * Log a message in the local log. + * Log a debug message. */ private void log(@NonNull String message) { - synchronized (mLog) { - mLog.log(message); - } + Log.d(TAG, message); } private void logWtf(@NonNull String message, @Nullable Throwable e) { Slog.wtf(TAG, message); - synchronized (mLog) { - mLog.e(message, e); - } + Log.e(TAG, message, e); } private void loge(@NonNull String message, @Nullable Throwable e) { - synchronized (mLog) { - mLog.e(message, e); - } + Log.e(TAG, message, e); } - /** - * Log a message in the local and system logs. - */ private void logi(@NonNull String message) { - synchronized (mLog) { - mLog.i(message); - } + Log.i(TAG, message); } /** @@ -320,22 +305,4 @@ public class NetworkStackClient { request.onNetworkStackConnected(connector); } - - /** - * Dump NetworkStackClient logs to the specified {@link PrintWriter}. - */ - public void dump(PrintWriter pw) { - // dump is thread-safe on SharedLog - mLog.dump(null, pw, null); - // dump connectivity module connector logs. - ConnectivityModuleConnector.getInstance().dump(pw); - - final int requestsQueueLength; - synchronized (mPendingNetStackRequests) { - requestsQueueLength = mPendingNetStackRequests.size(); - } - - pw.println(); - pw.println("pendingNetStackRequests length: " + requestsQueueLength); - } } |