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

Commit fe861064 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "SystemServer: use handler for BroadcastReceiver" into main am: cdfa2b65

parents be37464f cdfa2b65
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ class BluetoothManagerService {
        filter.addAction(Intent.ACTION_SETTING_RESTORED);
        filter.addAction(Intent.ACTION_SHUTDOWN);
        filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        mContext.registerReceiver(mReceiver, filter);
        mContext.registerReceiver(mReceiver, filter, null, mHandler);

        IntentFilter filterUser = new IntentFilter();
        filterUser.addAction(UserManager.ACTION_USER_RESTRICTIONS_CHANGED);
@@ -688,7 +688,7 @@ class BluetoothManagerService {
                },
                filterUser,
                null,
                null);
                mHandler);

        loadStoredNameAndAddress();
        if (isBluetoothPersistedStateOn()) {
+4 −7
Original line number Diff line number Diff line
@@ -95,13 +95,12 @@ public class BluetoothManagerServiceTest {

    TestLooper mLooper;

    boolean mHasException = false;

    static {
        // Required for reading DeviceConfig.
        InstrumentationRegistry.getInstrumentation()
                .getUiAutomation()
                .adoptShellPermissionIdentity(android.Manifest.permission.READ_DEVICE_CONFIG);
                .adoptShellPermissionIdentity(
                        android.Manifest.permission.INTERACT_ACROSS_USERS_FULL);
    }

    @Before
@@ -168,10 +167,8 @@ public class BluetoothManagerServiceTest {
            mManagerService = null;
        }
        mLooper.moveTimeForward(120_000); // 120 seconds
        // Do not try to assert if `syncHandler()` already raised an exception for it
        if (!mHasException) {

        assertThat(mLooper.nextMessage()).isNull();
        }
        validateMockitoUsage();
    }