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

Commit 3a6e5568 authored by Sanket Agarwal's avatar Sanket Agarwal
Browse files

Add flag to disable phone policy

After the separation of policy and mechanism this change completes the
loop whereby a non-phone device could simply disable the phone policy
and implement its own version

Test: Check by flashing flag vs no flag for verification
Bug: b/33079907
Change-Id: I9476f0dc16a5257a6fc8c198ff419fbdad3e8795
parent 10f36a1d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -71,4 +71,7 @@

    <!-- Enabling autoconnect over pan -->
    <bool name="config_bluetooth_pan_enable_autoconnect">true</bool>

    <!-- Enabling the phone policy -->
    <bool name="enable_phone_policy">true</bool>
</resources>
+9 −2
Original line number Diff line number Diff line
@@ -422,8 +422,15 @@ public class AdapterService extends Service {
        mProfileObserver = new ProfileObserver(getApplicationContext(), this, new Handler());
        mProfileObserver.start();

        // Phone policy is specific to phone implementations and hence if a device wants to exclude
        // it out then it can be disabled by using the flag below.
        if (getResources().getBoolean(com.android.bluetooth.R.bool.enable_phone_policy)) {
            Log.i(TAG, "Phone policy enabled");
            mPhonePolicy = new PhonePolicy(this, new ServiceFactory());
            mPhonePolicy.start();
        } else {
            Log.i(TAG, "Phone policy disabled");
        }

        setAdapterService(this);