Loading service/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ java_defaults { "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:LongFloatConversion:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:NonApiType:ERROR", "-Xep:NonCanonicalType:ERROR", Loading service/src/com/android/server/bluetooth/BluetoothManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.GuardedBy; 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; Loading Loading @@ -563,6 +564,10 @@ class BluetoothManagerService { } }; private final Histogram mShutdownLatencyHistogram = new Histogram( "bluetooth.value_shutdown_latency", new Histogram.UniformOptions(50, 0, 3000)); BluetoothManagerService(@NonNull Context context, @NonNull Looper looper) { mContext = requireNonNull(context, "Context cannot be null"); mContentResolver = requireNonNull(mContext.getContentResolver(), "Resolver cannot be null"); Loading Loading @@ -1194,6 +1199,7 @@ class BluetoothManagerService { if (mAdapter == null) { return; } long currentTimeMs = System.currentTimeMillis(); try { mAdapter.unregisterCallback(mBluetoothCallback, mContext.getAttributionSource()); Loading Loading @@ -1236,6 +1242,9 @@ class BluetoothManagerService { Log.e(TAG, "Bluetooth death not received correctly after > 2000ms", e); } long timeSpentForShutdown = System.currentTimeMillis() - currentTimeMs; mShutdownLatencyHistogram.logSample((float) timeSpentForShutdown); // TODO: b/356931756 - Remove sleep SystemClock.sleep(100); // required to let the ActivityManager be notified of BT death Loading Loading
service/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ java_defaults { "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:LongFloatConversion:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:NonApiType:ERROR", "-Xep:NonCanonicalType:ERROR", Loading
service/src/com/android/server/bluetooth/BluetoothManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ import com.android.bluetooth.flags.Flags; import com.android.internal.annotations.GuardedBy; 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; Loading Loading @@ -563,6 +564,10 @@ class BluetoothManagerService { } }; private final Histogram mShutdownLatencyHistogram = new Histogram( "bluetooth.value_shutdown_latency", new Histogram.UniformOptions(50, 0, 3000)); BluetoothManagerService(@NonNull Context context, @NonNull Looper looper) { mContext = requireNonNull(context, "Context cannot be null"); mContentResolver = requireNonNull(mContext.getContentResolver(), "Resolver cannot be null"); Loading Loading @@ -1194,6 +1199,7 @@ class BluetoothManagerService { if (mAdapter == null) { return; } long currentTimeMs = System.currentTimeMillis(); try { mAdapter.unregisterCallback(mBluetoothCallback, mContext.getAttributionSource()); Loading Loading @@ -1236,6 +1242,9 @@ class BluetoothManagerService { Log.e(TAG, "Bluetooth death not received correctly after > 2000ms", e); } long timeSpentForShutdown = System.currentTimeMillis() - currentTimeMs; mShutdownLatencyHistogram.logSample((float) timeSpentForShutdown); // TODO: b/356931756 - Remove sleep SystemClock.sleep(100); // required to let the ActivityManager be notified of BT death Loading