Loading android/app/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,7 @@ android_app { "-Xep:ClassCanBeStatic:ERROR", "-Xep:DateFormatConstant:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyCatch:ERROR", "-Xep:EqualsGetClass:ERROR", "-Xep:FallThrough:ERROR", "-Xep:HidingField:ERROR", Loading Loading @@ -367,6 +368,9 @@ android_app { // See https://r.android.com/3200511 "-Xep:AndroidFrameworkEfficientCollections:OFF", // Does not look pertinent in our situation "-Xep:AndroidFrameworkEfficientXml:OFF", // Exclude generated files "-XepExcludedPaths:.*/srcjars/.*", ], Loading android/app/src/com/android/bluetooth/avrcp/AvrcpBipObexServer.java +1 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,7 @@ public class AvrcpBipObexServer extends ServerRequestHandler { try { outStream.close(); } catch (IOException e) { warn("An exception occurred while closing e=" + e); } } } Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +11 −2 Original line number Diff line number Diff line Loading @@ -1153,6 +1153,10 @@ public class AdapterService extends Service { } private void invalidateBluetoothGetStateCache() { if (Flags.getStateFromSystemServer()) { // State is managed by the system server return; } BluetoothAdapter.invalidateBluetoothGetStateCache(); } Loading Loading @@ -1482,7 +1486,9 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); if (!Flags.getStateFromSystemServer()) { BluetoothAdapter.invalidateBluetoothGetStateCache(); } BluetoothAdapter.invalidateGetAdapterConnectionStateCache(); BluetoothMap.invalidateBluetoothGetConnectionStateCache(); BluetoothSap.invalidateBluetoothGetConnectionStateCache(); Loading Loading @@ -2240,6 +2246,9 @@ public class AdapterService extends Service { AdapterServiceBinder(AdapterService svc) { mService = svc; if (Flags.getStateFromSystemServer()) { return; } mService.invalidateBluetoothGetStateCache(); BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache(); } Loading Loading @@ -2281,7 +2290,7 @@ public class AdapterService extends Service { try { // Wait for Bluetooth to be killed from its main thread Thread.sleep(950); // SystemServer is waiting 1000 ms, we need to wait less here Thread.sleep(1_000); // SystemServer is waiting 2000 ms, we need to wait less here } catch (InterruptedException e) { Log.e(TAG, "killBluetoothProcess: Interrupted while waiting for kill"); } Loading android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +22 −14 Original line number Diff line number Diff line Loading @@ -1124,6 +1124,12 @@ class HeadsetStateMachine extends StateMachine { } } break; case INTENT_SCO_VOLUME_CHANGED: if (Flags.hfpAllowVolumeChangeWithoutSco()) { // when flag is removed, remove INTENT_SCO_VOLUME_CHANGED case in AudioOn processIntentScoVolume((Intent) message.obj, mDevice); } break; case INTENT_CONNECTION_ACCESS_REPLY: handleAccessPermissionResult((Intent) message.obj); break; Loading Loading @@ -1245,6 +1251,20 @@ class HeadsetStateMachine extends StateMachine { * @param state audio state */ public abstract void processAudioEvent(int state); void processIntentScoVolume(Intent intent, BluetoothDevice device) { int volumeValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0); stateLogD( "processIntentScoVolume: mSpeakerVolume=" + mSpeakerVolume + ", volumeValue=" + volumeValue); if (mSpeakerVolume != volumeValue) { mSpeakerVolume = volumeValue; mNativeInterface.setVolume( device, HeadsetHalConstants.VOLUME_TYPE_SPK, mSpeakerVolume); } } } class Connected extends ConnectedBase { Loading Loading @@ -1613,6 +1633,8 @@ class HeadsetStateMachine extends StateMachine { break; } case INTENT_SCO_VOLUME_CHANGED: // TODO: b/362313390 Remove this case once the fix is in place because this // message will be handled by the ConnectedBase state. processIntentScoVolume((Intent) message.obj, mDevice); break; case STACK_EVENT: Loading Loading @@ -1660,20 +1682,6 @@ class HeadsetStateMachine extends StateMachine { break; } } private void processIntentScoVolume(Intent intent, BluetoothDevice device) { int volumeValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0); stateLogD( "processIntentScoVolume: mSpeakerVolume=" + mSpeakerVolume + ", volumeValue=" + volumeValue); if (mSpeakerVolume != volumeValue) { mSpeakerVolume = volumeValue; mNativeInterface.setVolume( device, HeadsetHalConstants.VOLUME_TYPE_SPK, mSpeakerVolume); } } } class AudioDisconnecting extends ConnectedBase { Loading android/app/src/com/android/bluetooth/le_scan/TransitionalScanHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -736,6 +736,7 @@ public class TransitionalScanHelper { sendResultsByPendingIntent( app.mInfo, permittedResults, ScanSettings.CALLBACK_TYPE_ALL_MATCHES); } catch (PendingIntent.CanceledException e) { Log.d(TAG, "Exception while sending result", e); } } } else { Loading Loading
android/app/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,7 @@ android_app { "-Xep:ClassCanBeStatic:ERROR", "-Xep:DateFormatConstant:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyCatch:ERROR", "-Xep:EqualsGetClass:ERROR", "-Xep:FallThrough:ERROR", "-Xep:HidingField:ERROR", Loading Loading @@ -367,6 +368,9 @@ android_app { // See https://r.android.com/3200511 "-Xep:AndroidFrameworkEfficientCollections:OFF", // Does not look pertinent in our situation "-Xep:AndroidFrameworkEfficientXml:OFF", // Exclude generated files "-XepExcludedPaths:.*/srcjars/.*", ], Loading
android/app/src/com/android/bluetooth/avrcp/AvrcpBipObexServer.java +1 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,7 @@ public class AvrcpBipObexServer extends ServerRequestHandler { try { outStream.close(); } catch (IOException e) { warn("An exception occurred while closing e=" + e); } } } Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +11 −2 Original line number Diff line number Diff line Loading @@ -1153,6 +1153,10 @@ public class AdapterService extends Service { } private void invalidateBluetoothGetStateCache() { if (Flags.getStateFromSystemServer()) { // State is managed by the system server return; } BluetoothAdapter.invalidateBluetoothGetStateCache(); } Loading Loading @@ -1482,7 +1486,9 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); if (!Flags.getStateFromSystemServer()) { BluetoothAdapter.invalidateBluetoothGetStateCache(); } BluetoothAdapter.invalidateGetAdapterConnectionStateCache(); BluetoothMap.invalidateBluetoothGetConnectionStateCache(); BluetoothSap.invalidateBluetoothGetConnectionStateCache(); Loading Loading @@ -2240,6 +2246,9 @@ public class AdapterService extends Service { AdapterServiceBinder(AdapterService svc) { mService = svc; if (Flags.getStateFromSystemServer()) { return; } mService.invalidateBluetoothGetStateCache(); BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache(); } Loading Loading @@ -2281,7 +2290,7 @@ public class AdapterService extends Service { try { // Wait for Bluetooth to be killed from its main thread Thread.sleep(950); // SystemServer is waiting 1000 ms, we need to wait less here Thread.sleep(1_000); // SystemServer is waiting 2000 ms, we need to wait less here } catch (InterruptedException e) { Log.e(TAG, "killBluetoothProcess: Interrupted while waiting for kill"); } Loading
android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +22 −14 Original line number Diff line number Diff line Loading @@ -1124,6 +1124,12 @@ class HeadsetStateMachine extends StateMachine { } } break; case INTENT_SCO_VOLUME_CHANGED: if (Flags.hfpAllowVolumeChangeWithoutSco()) { // when flag is removed, remove INTENT_SCO_VOLUME_CHANGED case in AudioOn processIntentScoVolume((Intent) message.obj, mDevice); } break; case INTENT_CONNECTION_ACCESS_REPLY: handleAccessPermissionResult((Intent) message.obj); break; Loading Loading @@ -1245,6 +1251,20 @@ class HeadsetStateMachine extends StateMachine { * @param state audio state */ public abstract void processAudioEvent(int state); void processIntentScoVolume(Intent intent, BluetoothDevice device) { int volumeValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0); stateLogD( "processIntentScoVolume: mSpeakerVolume=" + mSpeakerVolume + ", volumeValue=" + volumeValue); if (mSpeakerVolume != volumeValue) { mSpeakerVolume = volumeValue; mNativeInterface.setVolume( device, HeadsetHalConstants.VOLUME_TYPE_SPK, mSpeakerVolume); } } } class Connected extends ConnectedBase { Loading Loading @@ -1613,6 +1633,8 @@ class HeadsetStateMachine extends StateMachine { break; } case INTENT_SCO_VOLUME_CHANGED: // TODO: b/362313390 Remove this case once the fix is in place because this // message will be handled by the ConnectedBase state. processIntentScoVolume((Intent) message.obj, mDevice); break; case STACK_EVENT: Loading Loading @@ -1660,20 +1682,6 @@ class HeadsetStateMachine extends StateMachine { break; } } private void processIntentScoVolume(Intent intent, BluetoothDevice device) { int volumeValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0); stateLogD( "processIntentScoVolume: mSpeakerVolume=" + mSpeakerVolume + ", volumeValue=" + volumeValue); if (mSpeakerVolume != volumeValue) { mSpeakerVolume = volumeValue; mNativeInterface.setVolume( device, HeadsetHalConstants.VOLUME_TYPE_SPK, mSpeakerVolume); } } } class AudioDisconnecting extends ConnectedBase { Loading
android/app/src/com/android/bluetooth/le_scan/TransitionalScanHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -736,6 +736,7 @@ public class TransitionalScanHelper { sendResultsByPendingIntent( app.mInfo, permittedResults, ScanSettings.CALLBACK_TYPE_ALL_MATCHES); } catch (PendingIntent.CanceledException e) { Log.d(TAG, "Exception while sending result", e); } } } else { Loading