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

Commit 2bf4d716 authored by William Escande's avatar William Escande
Browse files

PhonePolicy: use looper to make test faster

Some tests are taking up to 10s and this is triggering timeout during
critical presubmit.
Using a test looper allow to skip the timeout and to directly have the
expected results

also unify logs and cleanup the class

Test: atest BluetoothInstrumenationTests
Bug: 311772251
Flag: TEST_ONLY && refactor
Change-Id: I0e6dbcb4f03983273ec997ec6851ff1a659c926e
parent f1fc93e2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -715,9 +715,7 @@ public class AdapterService extends Service {
         */
        if (!isAutomotiveDevice && getResources().getBoolean(R.bool.enable_phone_policy)) {
            Log.i(TAG, "Phone policy enabled");
            PhonePolicy phonePolicy = new PhonePolicy(this, new ServiceFactory());
            phonePolicy.start();
            mPhonePolicy = Optional.of(phonePolicy);
            mPhonePolicy = Optional.of(new PhonePolicy(this, mLooper, new ServiceFactory()));
        } else {
            Log.i(TAG, "Phone policy disabled");
        }
+212 −348

File changed.

Preview size limit exceeded, changes collapsed.

+342 −654

File changed.

Preview size limit exceeded, changes collapsed.