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

Commit 527e0784 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12296955 from f6079d75 to 24Q4-release

Change-Id: Ic02299214d511ccc88f3fca9fc1a822150a5b541
parents ae046682 f6079d75
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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",
@@ -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/.*",
        ],
+1 −0
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ public class AvrcpBipObexServer extends ServerRequestHandler {
                    try {
                        outStream.close();
                    } catch (IOException e) {
                        warn("An exception occurred while closing e=" + e);
                    }
                }
            }
+11 −2
Original line number Diff line number Diff line
@@ -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();
    }

@@ -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();
@@ -2240,6 +2246,9 @@ public class AdapterService extends Service {

        AdapterServiceBinder(AdapterService svc) {
            mService = svc;
            if (Flags.getStateFromSystemServer()) {
                return;
            }
            mService.invalidateBluetoothGetStateCache();
            BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache();
        }
@@ -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");
            }
+22 −14
Original line number Diff line number Diff line
@@ -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;
@@ -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 {
@@ -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:
@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -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