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

Commit 665205e0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add Feature Flag for Hearing Aid Profile"

parents 28870b1b 3a55a31c
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);