Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java +4 −40 Original line number Diff line number Diff line Loading @@ -16,20 +16,6 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.STATE_CONNECTED; import static android.bluetooth.BluetoothAdapter.STATE_CONNECTING; import static android.bluetooth.BluetoothAdapter.STATE_DISCONNECTED; import static android.bluetooth.BluetoothAdapter.STATE_DISCONNECTING; import static android.bluetooth.BluetoothAdapter.STATE_OFF; import static android.bluetooth.BluetoothAdapter.STATE_ON; import static android.bluetooth.BluetoothAdapter.STATE_TURNING_OFF; import static android.bluetooth.BluetoothAdapter.STATE_TURNING_ON; import android.annotation.IntDef; import android.annotation.Nullable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * BluetoothCallback provides a callback interface for the settings Loading @@ -47,7 +33,7 @@ public interface BluetoothCallback { * {@link android.bluetooth.BluetoothAdapter#STATE_ON}, * {@link android.bluetooth.BluetoothAdapter#STATE_TURNING_OFF}. */ default void onBluetoothStateChanged(@AdapterState int bluetoothState) {} default void onBluetoothStateChanged(int bluetoothState) {} /** * It will be called when the local Bluetooth adapter has started Loading Loading @@ -103,9 +89,7 @@ public interface BluetoothCallback { * {@link android.bluetooth.BluetoothAdapter#STATE_CONNECTED}, * {@link android.bluetooth.BluetoothAdapter#STATE_DISCONNECTING}. */ default void onConnectionStateChanged( @Nullable CachedBluetoothDevice cachedDevice, @ConnectionState int state) {} default void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {} /** * It will be called when device been set as active for {@code bluetoothProfile} Loading Loading @@ -140,10 +124,8 @@ public interface BluetoothCallback { * {@link android.bluetooth.BluetoothProfile#STATE_DISCONNECTING}. * @param bluetoothProfile the BluetoothProfile id. */ default void onProfileConnectionStateChanged( CachedBluetoothDevice cachedDevice, @ConnectionState int state, int bluetoothProfile) { default void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { } /** Loading @@ -158,22 +140,4 @@ public interface BluetoothCallback { */ default void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { } @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = { "STATE_" }, value = { STATE_DISCONNECTED, STATE_CONNECTING, STATE_CONNECTED, STATE_DISCONNECTING, }) @interface ConnectionState {} @IntDef(prefix = { "STATE_" }, value = { STATE_OFF, STATE_TURNING_ON, STATE_ON, STATE_TURNING_OFF, }) @Retention(RetentionPolicy.SOURCE) @interface AdapterState {} } packages/SystemUI/src/com/android/systemui/bluetooth/BluetoothLogger.ktdeleted 100644 → 0 +0 −102 Original line number Diff line number Diff line /* * Copyright (C) 2022 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.systemui.bluetooth import com.android.systemui.dagger.SysUISingleton import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogLevel import com.android.systemui.log.dagger.BluetoothLog import javax.inject.Inject /** Helper class for logging bluetooth events. */ @SysUISingleton class BluetoothLogger @Inject constructor(@BluetoothLog private val logBuffer: LogBuffer) { fun logActiveDeviceChanged(address: String, profileId: Int) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address int1 = profileId }, { "ActiveDeviceChanged. address=$str1 profileId=$int1" } ) fun logDeviceConnectionStateChanged(address: String?, state: String) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address str2 = state }, { "DeviceConnectionStateChanged. address=$str1 state=$str2" } ) fun logAclConnectionStateChanged(address: String, state: String) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address str2 = state }, { "AclConnectionStateChanged. address=$str1 state=$str2" } ) fun logProfileConnectionStateChanged(address: String, state: String, profileId: Int) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address str2 = state int1 = profileId }, { "ProfileConnectionStateChanged. address=$str1 state=$str2 profileId=$int1" } ) fun logStateChange(state: String) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = state }, { "BluetoothStateChanged. state=$str1" } ) fun logBondStateChange(address: String, state: Int) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address int1 = state }, { "DeviceBondStateChanged. address=$str1 state=$int1" } ) fun logDeviceAdded(address: String) = logBuffer.log(TAG, LogLevel.DEBUG, { str1 = address }, { "DeviceAdded. address=$str1" }) fun logDeviceDeleted(address: String) = logBuffer.log(TAG, LogLevel.DEBUG, { str1 = address }, { "DeviceDeleted. address=$str1" }) fun logDeviceAttributesChanged() = logBuffer.log(TAG, LogLevel.DEBUG, {}, { "DeviceAttributesChanged." }) } private const val TAG = "BluetoothLog" packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java +1 −1 Original line number Diff line number Diff line Loading @@ -601,7 +601,7 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo private final class BluetoothCallbackHandler implements BluetoothCallback { @Override public void onBluetoothStateChanged(@BluetoothCallback.AdapterState int bluetoothState) { public void onBluetoothStateChanged(int bluetoothState) { mHandler.obtainMessage(MSG_ON_BLUETOOTH_STATE_CHANGED, bluetoothState, 0).sendToTarget(); } Loading packages/SystemUI/src/com/android/systemui/log/dagger/BluetoothLog.ktdeleted 100644 → 0 +0 −22 Original line number Diff line number Diff line /* * Copyright (C) 2022 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.systemui.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for bluetooth. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class BluetoothLog packages/SystemUI/src/com/android/systemui/log/dagger/KeyguardUpdateMonitorLog.kt +0 −5 Original line number Diff line number Diff line package com.android.systemui.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for KeyguardUpdateMonitor. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class KeyguardUpdateMonitorLog Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java +4 −40 Original line number Diff line number Diff line Loading @@ -16,20 +16,6 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothAdapter.STATE_CONNECTED; import static android.bluetooth.BluetoothAdapter.STATE_CONNECTING; import static android.bluetooth.BluetoothAdapter.STATE_DISCONNECTED; import static android.bluetooth.BluetoothAdapter.STATE_DISCONNECTING; import static android.bluetooth.BluetoothAdapter.STATE_OFF; import static android.bluetooth.BluetoothAdapter.STATE_ON; import static android.bluetooth.BluetoothAdapter.STATE_TURNING_OFF; import static android.bluetooth.BluetoothAdapter.STATE_TURNING_ON; import android.annotation.IntDef; import android.annotation.Nullable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * BluetoothCallback provides a callback interface for the settings Loading @@ -47,7 +33,7 @@ public interface BluetoothCallback { * {@link android.bluetooth.BluetoothAdapter#STATE_ON}, * {@link android.bluetooth.BluetoothAdapter#STATE_TURNING_OFF}. */ default void onBluetoothStateChanged(@AdapterState int bluetoothState) {} default void onBluetoothStateChanged(int bluetoothState) {} /** * It will be called when the local Bluetooth adapter has started Loading Loading @@ -103,9 +89,7 @@ public interface BluetoothCallback { * {@link android.bluetooth.BluetoothAdapter#STATE_CONNECTED}, * {@link android.bluetooth.BluetoothAdapter#STATE_DISCONNECTING}. */ default void onConnectionStateChanged( @Nullable CachedBluetoothDevice cachedDevice, @ConnectionState int state) {} default void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {} /** * It will be called when device been set as active for {@code bluetoothProfile} Loading Loading @@ -140,10 +124,8 @@ public interface BluetoothCallback { * {@link android.bluetooth.BluetoothProfile#STATE_DISCONNECTING}. * @param bluetoothProfile the BluetoothProfile id. */ default void onProfileConnectionStateChanged( CachedBluetoothDevice cachedDevice, @ConnectionState int state, int bluetoothProfile) { default void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { } /** Loading @@ -158,22 +140,4 @@ public interface BluetoothCallback { */ default void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { } @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = { "STATE_" }, value = { STATE_DISCONNECTED, STATE_CONNECTING, STATE_CONNECTED, STATE_DISCONNECTING, }) @interface ConnectionState {} @IntDef(prefix = { "STATE_" }, value = { STATE_OFF, STATE_TURNING_ON, STATE_ON, STATE_TURNING_OFF, }) @Retention(RetentionPolicy.SOURCE) @interface AdapterState {} }
packages/SystemUI/src/com/android/systemui/bluetooth/BluetoothLogger.ktdeleted 100644 → 0 +0 −102 Original line number Diff line number Diff line /* * Copyright (C) 2022 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.systemui.bluetooth import com.android.systemui.dagger.SysUISingleton import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogLevel import com.android.systemui.log.dagger.BluetoothLog import javax.inject.Inject /** Helper class for logging bluetooth events. */ @SysUISingleton class BluetoothLogger @Inject constructor(@BluetoothLog private val logBuffer: LogBuffer) { fun logActiveDeviceChanged(address: String, profileId: Int) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address int1 = profileId }, { "ActiveDeviceChanged. address=$str1 profileId=$int1" } ) fun logDeviceConnectionStateChanged(address: String?, state: String) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address str2 = state }, { "DeviceConnectionStateChanged. address=$str1 state=$str2" } ) fun logAclConnectionStateChanged(address: String, state: String) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address str2 = state }, { "AclConnectionStateChanged. address=$str1 state=$str2" } ) fun logProfileConnectionStateChanged(address: String, state: String, profileId: Int) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address str2 = state int1 = profileId }, { "ProfileConnectionStateChanged. address=$str1 state=$str2 profileId=$int1" } ) fun logStateChange(state: String) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = state }, { "BluetoothStateChanged. state=$str1" } ) fun logBondStateChange(address: String, state: Int) = logBuffer.log( TAG, LogLevel.DEBUG, { str1 = address int1 = state }, { "DeviceBondStateChanged. address=$str1 state=$int1" } ) fun logDeviceAdded(address: String) = logBuffer.log(TAG, LogLevel.DEBUG, { str1 = address }, { "DeviceAdded. address=$str1" }) fun logDeviceDeleted(address: String) = logBuffer.log(TAG, LogLevel.DEBUG, { str1 = address }, { "DeviceDeleted. address=$str1" }) fun logDeviceAttributesChanged() = logBuffer.log(TAG, LogLevel.DEBUG, {}, { "DeviceAttributesChanged." }) } private const val TAG = "BluetoothLog"
packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java +1 −1 Original line number Diff line number Diff line Loading @@ -601,7 +601,7 @@ public class KeyboardUI extends CoreStartable implements InputManager.OnTabletMo private final class BluetoothCallbackHandler implements BluetoothCallback { @Override public void onBluetoothStateChanged(@BluetoothCallback.AdapterState int bluetoothState) { public void onBluetoothStateChanged(int bluetoothState) { mHandler.obtainMessage(MSG_ON_BLUETOOTH_STATE_CHANGED, bluetoothState, 0).sendToTarget(); } Loading
packages/SystemUI/src/com/android/systemui/log/dagger/BluetoothLog.ktdeleted 100644 → 0 +0 −22 Original line number Diff line number Diff line /* * Copyright (C) 2022 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.systemui.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for bluetooth. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class BluetoothLog
packages/SystemUI/src/com/android/systemui/log/dagger/KeyguardUpdateMonitorLog.kt +0 −5 Original line number Diff line number Diff line package com.android.systemui.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for KeyguardUpdateMonitor. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class KeyguardUpdateMonitorLog