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

Commit b9ec0b20 authored by Sal Savage's avatar Sal Savage Committed by Android (Google) Code Review
Browse files

Merge "Don't use PhonePolicy on automotive builds" into tm-dev

parents 5099a522 6150dc89
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();