Replaced Slog by Slogf on PerUserCarService.java
Test: adb logcat PerUserCarService *:s
Bug: 182476140
(cherry-picked from commit 31deda51fb562a2bed7a4701944a52a31e7d1b46)
Merged-In: I98cbb122d5410b61812edc85162aa6b10b995fdc
Change-Id: I98cbb122d5410b61812edc85162aa6b10b995fdc
diff --git a/service/Android.bp b/service/Android.bp
index 6840ce7..e7c9ee1 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -54,6 +54,7 @@
// TODO(b/171603586): remove this after moving NewUserDisclaimerActivity
// to CarSettings
"car-admin-ui-lib",
+ "Slogf",
]
android_app {
diff --git a/service/src/com/android/car/PerUserCarService.java b/service/src/com/android/car/PerUserCarService.java
index 8347ea6..ee4dafe 100644
--- a/service/src/com/android/car/PerUserCarService.java
+++ b/service/src/com/android/car/PerUserCarService.java
@@ -25,9 +25,9 @@
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.util.IndentingPrintWriter;
-import android.util.Slog;
import com.android.car.admin.PerUserCarDevicePolicyService;
+import com.android.server.utils.Slogf;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -51,17 +51,17 @@
@Override
public IBinder onBind(Intent intent) {
- if (DBG) Slog.d(TAG, "onBind()");
+ if (DBG) Slogf.d(TAG, "onBind()");
if (mPerUserCarServiceBinder == null) {
- Slog.e(TAG, "PerUserCarServiceBinder null");
+ Slogf.e(TAG, "PerUserCarServiceBinder null");
}
return mPerUserCarServiceBinder;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
- if (DBG) Slog.d(TAG, "onStart()");
+ if (DBG) Slogf.d(TAG, "onStart()");
return START_STICKY;
}
@@ -69,7 +69,7 @@
@Override
public void onCreate() {
Context context = getApplicationContext();
- Slog.i(TAG, "created for user " + context.getUserId());
+ Slogf.i(TAG, "created for user %d", context.getUserId());
mPerUserCarServiceBinder = new PerUserCarServiceBinder();
mCarBluetoothUserService = new CarBluetoothUserService(this);
@@ -78,8 +78,8 @@
mPerUserCarDevicePolicyService = PerUserCarDevicePolicyService.getInstance(context);
mPerUserCarDevicePolicyService.registerBroadcastReceiver();
} else if (DBG) {
- Slog.d(TAG, "Not setting PerUserCarDevicePolicyService because device doesn't have "
- + PackageManager.FEATURE_DEVICE_ADMIN);
+ Slogf.d(TAG, "Not setting PerUserCarDevicePolicyService because device doesn't have %s",
+ PackageManager.FEATURE_DEVICE_ADMIN);
}
mLocationManagerProxy = new LocationManagerProxy(this);
@@ -88,7 +88,7 @@
@Override
public void onDestroy() {
- Slog.i(TAG, "destroyed for user " + getApplicationContext().getUserId());
+ Slogf.i(TAG, "destroyed for user %d", getApplicationContext().getUserId());
if (mPerUserCarDevicePolicyService != null) {
mPerUserCarDevicePolicyService.onDestroy();