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

Commit f873045b authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Add Feature Flag for Hearing Aid Profile"

am: 665205e0

Change-Id: I485609530eb2c62a50eb58f8a244f88953b60d24
parents 99e5bebf 665205e0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.provider.Settings;
import android.util.FeatureFlagUtils;
import android.util.Log;

import com.android.bluetooth.R;
@@ -117,6 +118,13 @@ public class Config {
        ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length);
        for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) {
            boolean supported = resources.getBoolean(config.mSupported);

            if (supported && (config.mClass == HearingAidService.class) && !FeatureFlagUtils
                                .isEnabled(ctx, FeatureFlagUtils.HEARING_AID_SETTINGS)) {
                Log.v(TAG, "Feature Flag disables support for HearingAidService");
                supported = false;
            }

            if (supported && !isProfileDisabled(ctx, config.mMask)) {
                Log.v(TAG, "Adding " + config.mClass.getSimpleName());
                profiles.add(config.mClass);