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

Commit 98077b9c authored by William Escande's avatar William Escande
Browse files

Inline getTempAllowlistBroadcastOptions

Test: m .
Bug: 311772251
Flag: Exempt, Mechanical refactor
Change-Id: I1bae4dd2689b971b3e674bdc6885fdbf2bfd7828
parent 6d57d919
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import android.location.LocationManager;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.ParcelUuid;
import android.os.PowerExemptionManager;
import android.os.Process;
@@ -1158,13 +1157,6 @@ public final class Utils {
                context.getContentResolver(), uri, values, null, null);
    }

    /**
     * Returns bundled broadcast options.
     */
    public static @NonNull Bundle getTempAllowlistBroadcastOptions() {
        return getTempBroadcastOptions().toBundle();
    }

    /**
     * Returns broadcast options.
     */
+2 −2
Original line number Diff line number Diff line
@@ -1097,7 +1097,7 @@ public class A2dpService extends ProfileService {
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                        | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
        sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle());
    }

    private void broadcastCodecConfig(BluetoothDevice device, BluetoothCodecStatus codecStatus) {
@@ -1107,7 +1107,7 @@ public class A2dpService extends ProfileService {
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                        | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
        sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle());
    }

    public void handleBondStateChanged(BluetoothDevice device, int fromState, int toState) {
+2 −2
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ final class A2dpStateMachine extends StateMachine {
                        | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        mA2dpService.handleConnectionStateChanged(mDevice, prevState, newState);
        mA2dpService.sendBroadcast(
                intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
                intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle());
    }

    private void broadcastAudioState(int newState, int prevState) {
@@ -754,7 +754,7 @@ final class A2dpStateMachine extends StateMachine {
        intent.putExtra(BluetoothProfile.EXTRA_STATE, newState);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        mA2dpService.sendBroadcast(
                intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
                intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle());
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -318,6 +318,7 @@ class A2dpSinkStateMachine extends StateMachine {
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        mService.connectionStateChanged(mDevice, mMostRecentState, currentState);
        mMostRecentState = currentState;
        mService.sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
        mService.sendBroadcast(
                intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle());
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -1359,7 +1359,8 @@ class AvrcpControllerStateMachine extends StateMachine {
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        mMostRecentState = currentState;
        mService.sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
        mService.sendBroadcast(
                intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle());
    }

    private boolean shouldRequestFocus() {
Loading