diff options
author | 2025-03-07 22:30:00 +0000 | |
---|---|---|
committer | 2025-03-10 21:46:20 +0000 | |
commit | 0fbb5411c2daa96ce6d93ea1303fcdd30403c328 (patch) | |
tree | ddfd11040f12b27f849ee4ed2e7bc88f193ddd5d /service | |
parent | 4fb02392596f2baf97417fc23f8b04147749e896 (diff) |
BluetoothManagerService: Remove proto dump
Added by the Android Health team to dump
structured bt stats through the bluetooth_manager
dumpsys on incident reports.
This has now been deprecated and the proto output
can be removed.
Bug: 331817295
Test: m com.android.bt
Flag: EXEMPT, dead code removal
Change-Id: I06b9d6a9937582d2692df7c4e5e59fd24c60d999
Diffstat (limited to 'service')
-rw-r--r-- | service/Android.bp | 17 | ||||
-rwxr-xr-x | service/kls-classpath | 1 | ||||
-rw-r--r-- | service/src/ActiveLog.kt | 16 | ||||
-rw-r--r-- | service/src/ActiveLogTest.kt | 11 | ||||
-rw-r--r-- | service/src/com/android/server/bluetooth/BluetoothManagerService.java | 32 |
5 files changed, 0 insertions, 77 deletions
diff --git a/service/Android.bp b/service/Android.bp index 1532b89d3c..4b608dd4b3 100644 --- a/service/Android.bp +++ b/service/Android.bp @@ -72,7 +72,6 @@ java_library { static_libs: [ "androidx.annotation_annotation", "androidx.appcompat_appcompat", - "bluetooth-manager-service-proto-java-gen", "bluetooth-nano-protos", "bluetooth-proto-enums-java-gen", "bluetooth_flags_java_lib", @@ -121,21 +120,6 @@ java_library { } java_library { - name: "bluetooth-manager-service-proto-java-gen", - srcs: [":srcs_bluetooth_manager_service_proto"], - installable: false, - - proto: { - type: "stream", - include_dirs: ["external/protobuf/src"], - }, - - sdk_version: "system_server_current", - min_sdk_version: "Tiramisu", - apex_available: ["com.android.bt"], -} - -java_library { name: "bluetooth-nano-protos", srcs: [":system-messages-proto-src"], installable: false, @@ -183,7 +167,6 @@ android_robolectric_test { static_libs: [ "androidx.test.core", "androidx.test.ext.truth", - "bluetooth-manager-service-proto-java-gen", "bluetooth-nano-protos", "bluetooth-proto-enums-java-gen", "bluetooth_flags_java_lib", diff --git a/service/kls-classpath b/service/kls-classpath index 94c74875ad..3ea610246d 100755 --- a/service/kls-classpath +++ b/service/kls-classpath @@ -16,7 +16,6 @@ CLASSPATH+=":$ROOT/out/soong/.intermediates/packages/modules/Bluetooth/service/c CLASSPATH+=":$ROOT/out/soong/.intermediates/packages/modules/Bluetooth/framework/framework-bluetooth.impl/android_common/turbine-jarjar/framework-bluetooth.impl.jar" CLASSPATH+=":$ROOT/out/soong/.intermediates/prebuilts/sdk/current/androidx/m2repository/androidx/annotation/annotation-jvm/1.8.0-alpha01/androidx.annotation_annotation/android_common_apex33/turbine-combined/androidx.annotation_annotation.jar" -CLASSPATH+=":$ROOT/out/soong/.intermediates/packages/modules/Bluetooth/service/bluetooth-manager-service-proto-java-gen/android_common_apex33/turbine-combined/bluetooth-manager-service-proto-java-gen.jar" CLASSPATH+=":$ROOT/out/soong/.intermediates/packages/modules/Bluetooth/service/bluetooth-nano-protos/android_common_apex33/turbine-combined/bluetooth-nano-protos.jar" CLASSPATH+=":$ROOT/out/soong/.intermediates/packages/modules/Bluetooth/android/app/bluetooth-proto-enums-java-gen/android_common_apex33/turbine-combined/bluetooth-proto-enums-java-gen.jar" CLASSPATH+=":$ROOT/out/soong/.intermediates/packages/modules/Bluetooth/flags/bluetooth_flags_java_lib/android_common_apex33/turbine-combined/bluetooth_flags_java_lib.jar" diff --git a/service/src/ActiveLog.kt b/service/src/ActiveLog.kt index 46e3a5570d..ac49031f90 100644 --- a/service/src/ActiveLog.kt +++ b/service/src/ActiveLog.kt @@ -30,14 +30,12 @@ import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_START_ERROR import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_SYSTEM_BOOT import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_USER_SWITCH import android.os.Binder -import android.util.proto.ProtoOutputStream import androidx.annotation.VisibleForTesting import com.android.bluetooth.BluetoothStatsLog import com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED import com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__DISABLED import com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__ENABLED import com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__UNKNOWN -import com.android.server.BluetoothManagerServiceDumpProto as BtProto import java.io.PrintWriter private const val TAG = "ActiveLogs" @@ -58,13 +56,6 @@ object ActiveLogs { } @JvmStatic - fun dumpProto(proto: ProtoOutputStream) { - val token = proto.start(BtProto.ACTIVE_LOGS) - activeLogs.forEach { it.dump(proto) } - proto.end(token) - } - - @JvmStatic fun add(reason: Int, enable: Boolean) { add(reason, enable, "BluetoothSystemServer", false) } @@ -124,13 +115,6 @@ internal class ActiveLog( (if (isBle) "Ble" else "") + "]. \tReason is " + getEnableDisableReasonString(reason) - - fun dump(proto: ProtoOutputStream) { - proto.write(BtProto.ActiveLog.TIMESTAMP_MS, timestamp) - proto.write(BtProto.ActiveLog.ENABLE, enable) - proto.write(BtProto.ActiveLog.PACKAGE_NAME, packageName) - proto.write(BtProto.ActiveLog.REASON, reason) - } } private fun getEnableDisableReasonString(reason: Int): String { diff --git a/service/src/ActiveLogTest.kt b/service/src/ActiveLogTest.kt index ccd86a375e..baa5076626 100644 --- a/service/src/ActiveLogTest.kt +++ b/service/src/ActiveLogTest.kt @@ -26,7 +26,6 @@ import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_SATELLITE_MOD import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_START_ERROR import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_SYSTEM_BOOT import android.bluetooth.BluetoothProtoEnums.ENABLE_DISABLE_REASON_USER_SWITCH -import android.util.proto.ProtoOutputStream import com.android.server.bluetooth.ActiveLogs import com.android.server.bluetooth.Log import com.google.common.truth.Truth.assertThat @@ -137,14 +136,4 @@ class ActiveLogTest { ".*UNKNOWN\\[\\d+\\]\n" ) } - - @Test - fun protoDump() { - ActiveLogs.add(ENABLE_DISABLE_REASON_APPLICATION_REQUEST, false) - - val proto = ProtoOutputStream() - ActiveLogs.dumpProto(proto) - - assertThat(proto.getRawSize()).isEqualTo(48) - } } diff --git a/service/src/com/android/server/bluetooth/BluetoothManagerService.java b/service/src/com/android/server/bluetooth/BluetoothManagerService.java index 216b621794..c5e64dfd5a 100644 --- a/service/src/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/src/com/android/server/bluetooth/BluetoothManagerService.java @@ -86,7 +86,6 @@ import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.VisibleForTesting; import com.android.modules.expresslog.Counter; import com.android.modules.expresslog.Histogram; -import com.android.server.BluetoothManagerServiceDumpProto; import com.android.server.bluetooth.airplane.AirplaneModeListener; import com.android.server.bluetooth.satellite.SatelliteModeListener; @@ -1997,10 +1996,6 @@ class BluetoothManagerService { } void dump(FileDescriptor fd, PrintWriter writer, String[] args) { - if ((args.length > 0) && args[0].startsWith("--proto")) { - dumpProto(fd); - return; - } String errorMsg = null; writer.println("Bluetooth Status"); @@ -2090,33 +2085,6 @@ class BluetoothManagerService { }); } - private void dumpProto(FileDescriptor fd) { - final ProtoOutputStream proto = new ProtoOutputStream(new FileOutputStream(fd)); - proto.write(BluetoothManagerServiceDumpProto.ENABLED, isEnabled()); - proto.write(BluetoothManagerServiceDumpProto.STATE, mState.get()); - proto.write(BluetoothManagerServiceDumpProto.STATE_NAME, nameForState(mState.get())); - proto.write(BluetoothManagerServiceDumpProto.ADDRESS, logAddress(mAddress)); - proto.write(BluetoothManagerServiceDumpProto.NAME, mName); - if (mEnable) { - proto.write(BluetoothManagerServiceDumpProto.LAST_ENABLED_TIME_MS, mLastEnabledTime); - } - proto.write( - BluetoothManagerServiceDumpProto.CURR_TIMESTAMP_MS, SystemClock.elapsedRealtime()); - ActiveLogs.dumpProto(proto); - proto.write(BluetoothManagerServiceDumpProto.NUM_CRASHES, mCrashes); - proto.write( - BluetoothManagerServiceDumpProto.CRASH_LOG_MAXED, mCrashes == CRASH_LOG_MAX_SIZE); - for (Long time : mCrashTimestamps) { - proto.write(BluetoothManagerServiceDumpProto.CRASH_TIMESTAMPS_MS, time); - } - proto.write(BluetoothManagerServiceDumpProto.NUM_BLE_APPS, mBleApps.size()); - for (ClientDeathRecipient app : mBleApps.values()) { - proto.write( - BluetoothManagerServiceDumpProto.BLE_APP_PACKAGE_NAMES, app.getPackageName()); - } - proto.flush(); - } - static @NonNull Bundle getTempAllowlistBroadcastOptions() { final long duration = 10_000; final BroadcastOptions bOptions = BroadcastOptions.makeBasic(); |