Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be13cd04 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "SystemServer: Unified TAG logging" into main

parents 50a3a913 9fce26d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ filegroup {
        ":statslog-bluetooth-java-gen",
        "src/**/*.java",
        "src/AdapterState.kt",
        "src/Log.kt",
        "src/RadioModeListener.kt",
        "src/airplane/ModeListener.kt",
        "src/com/**/*.kt",
@@ -161,6 +162,7 @@ android_robolectric_test {
        ":statslog-bluetooth-java-gen",
        "src/AdapterState.kt",
        "src/AdapterStateTest.kt",
        "src/Log.kt",
        "src/RadioModeListener.kt",
        "src/RadioModeListenerTest.kt",
        "src/airplane/ModeListener.kt",
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
package com.android.server.bluetooth

import android.bluetooth.BluetoothAdapter.STATE_OFF
import android.util.Log
import com.google.common.truth.Truth.assertThat
import kotlin.time.Duration.Companion.days
import kotlinx.coroutines.CoroutineStart

service/src/Log.kt

0 → 100644
+38 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.server.bluetooth

import android.util.Log

private const val SYSTEM_SERVER_TAG = "BluetoothSystemServer"

public class Log private constructor() {
    companion object {
        @JvmStatic
        fun v(subtag: String, msg: String) = Log.v(SYSTEM_SERVER_TAG, "${subtag}: ${msg}")
        @JvmStatic
        fun d(subtag: String, msg: String) = Log.d(SYSTEM_SERVER_TAG, "${subtag}: ${msg}")
        @JvmStatic
        fun i(subtag: String, msg: String) = Log.i(SYSTEM_SERVER_TAG, "${subtag}: ${msg}")
        @JvmStatic
        fun w(subtag: String, msg: String) = Log.w(SYSTEM_SERVER_TAG, "${subtag}: ${msg}")
        @JvmStatic
        fun e(subtag: String, msg: String) = Log.e(SYSTEM_SERVER_TAG, "${subtag}: ${msg}")
        @JvmStatic
        fun e(subtag: String, msg: String, tr: Throwable) =
            Log.e(SYSTEM_SERVER_TAG, "${subtag}: ${msg}", tr)
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.database.ContentObserver
import android.os.Handler
import android.os.Looper
import android.provider.Settings
import android.util.Log

private const val TAG = "BluetoothRadioModeListener"

+2 −2
Original line number Diff line number Diff line
@@ -25,16 +25,16 @@ import android.content.Context
import android.content.res.Resources
import android.os.Looper
import android.provider.Settings
import android.util.Log
import android.widget.Toast
import com.android.bluetooth.BluetoothStatsLog
import com.android.server.bluetooth.BluetoothAdapterState
import com.android.server.bluetooth.Log
import com.android.server.bluetooth.initializeRadioModeListener
import kotlin.time.Duration.Companion.minutes
import kotlin.time.TimeMark
import kotlin.time.TimeSource

private const val TAG = "BluetoothAirplaneModeListener"
private const val TAG = "AirplaneModeListener"

/** @return true if Bluetooth state is impacted by airplane mode */
public var isOn = false
Loading