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

Commit 6150dc89 authored by Sal Savage's avatar Sal Savage
Browse files

Don't use PhonePolicy on automotive builds

Automotive builds provide their own connection policy code which
conflicts with the code in PhonePolicy. The overlay used to disable
PhonePolicy is not available outside of the Bluetooth stack anymore as
its not overlayable.

Tag: #stability
Bug: 218408055
Test: make -j; -- make sure phone policy does not come up on AAOS builds
Change-Id: Ic731c5cc698e5dbb589b5d56df89f7876f726d03
parent a68b3ada
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -515,9 +515,16 @@ public class AdapterService extends Service {
        mDatabaseManager = new DatabaseManager(this);
        mDatabaseManager.start(MetadataDatabase.createDatabase(this));

        // 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(R.bool.enable_phone_policy)) {
        boolean isAutomotiveDevice = getApplicationContext().getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_AUTOMOTIVE);

        /*
         * 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. Phone policy is never used on
         * Android Automotive OS builds, in favor of a policy currently located in
         * CarBluetoothService.
         */
        if (!isAutomotiveDevice && getResources().getBoolean(R.bool.enable_phone_policy)) {
            Log.i(TAG, "Phone policy enabled");
            mPhonePolicy = new PhonePolicy(this, new ServiceFactory());
            mPhonePolicy.start();