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

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

Add Feature Flag for Hearing Aid Profile

am: b0f4bdeb

Change-Id: Iffc1283d0ce7ece0c9e7eb8d3f020760cbbd022a
parents 0e775651 b0f4bdeb
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);