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

Commit eb1ebfe6 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "ASHA: Enable ASHA by default if sysprop is not set" am: 6db105a7 am: 6e4a17e8

parents b849e8c9 6e4a17e8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.bluetooth.btservice;

import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.SystemProperties;
import android.util.Log;
@@ -193,6 +194,11 @@ public class Config {
            }
        }

        // Disable ASHA if BLE is not supported on this platform
        if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
            setProfileEnabled(HearingAidService.class, false);
        }

        ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length);
        for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) {
            Log.i(TAG, "init: profile=" + config.mClass.getSimpleName() + ", enabled="
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ public class HearingAidService extends ProfileService {
    private final ServiceFactory mFactory = new ServiceFactory();

    public static boolean isEnabled() {
        return BluetoothProperties.isProfileAshaCentralEnabled().orElse(false);
        return BluetoothProperties.isProfileAshaCentralEnabled().orElse(true);
    }

    @Override
+5 −1
Original line number Diff line number Diff line
@@ -601,8 +601,12 @@ public class BluetoothManagerService extends IBluetoothManager.Stub {

        mBluetoothNotificationManager = new BluetoothNotificationManager(mContext);

        // Disable ASHA if BLE is not supported on this platform
        mIsHearingAidProfileSupported =
                BluetoothProperties.isProfileAshaCentralEnabled().orElse(false);
                BluetoothProperties.isProfileAshaCentralEnabled().orElse(true);
        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
            mIsHearingAidProfileSupported = false;
        }

        String value = SystemProperties.get(
                "persist.sys.fflag.override.settings_bluetooth_hearing_aid");