Loading android/app/src/com/android/bluetooth/btservice/Config.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Context; import android.content.res.Resources; import android.content.res.Resources; import android.provider.Settings; import android.provider.Settings; import android.util.ArrayMap; import android.util.FeatureFlagUtils; import android.util.FeatureFlagUtils; import android.util.Log; import android.util.Log; Loading @@ -42,6 +43,7 @@ import com.android.bluetooth.pan.PanService; import com.android.bluetooth.pbap.BluetoothPbapService; import com.android.bluetooth.pbap.BluetoothPbapService; import com.android.bluetooth.pbapclient.PbapClientService; import com.android.bluetooth.pbapclient.PbapClientService; import com.android.bluetooth.sap.SapService; import com.android.bluetooth.sap.SapService; import com.android.server.SystemConfig; import java.util.ArrayList; import java.util.ArrayList; Loading Loading @@ -112,6 +114,11 @@ public class Config { if (resources == null) { if (resources == null) { return; return; } } SystemConfig systemConfig = SystemConfig.getInstance(); ArrayMap<String, Boolean> componentEnabledStates = null; if (systemConfig != null) { componentEnabledStates = systemConfig.getComponentsEnabledStates(ctx.getPackageName()); } ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length); ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length); for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) { for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) { Loading @@ -123,6 +130,13 @@ public class Config { supported = true; supported = true; } } if (componentEnabledStates != null && componentEnabledStates.containsKey(config.mClass.getName())) { supported = componentEnabledStates.get(config.mClass.getName()); Log.v(TAG, config.mClass.getSimpleName() + " Feature Flag set to " + supported + " by components configuration"); } if (supported && !isProfileDisabled(ctx, config.mMask)) { if (supported && !isProfileDisabled(ctx, config.mMask)) { Log.v(TAG, "Adding " + config.mClass.getSimpleName()); Log.v(TAG, "Adding " + config.mClass.getSimpleName()); profiles.add(config.mClass); profiles.add(config.mClass); Loading Loading
android/app/src/com/android/bluetooth/btservice/Config.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Context; import android.content.res.Resources; import android.content.res.Resources; import android.provider.Settings; import android.provider.Settings; import android.util.ArrayMap; import android.util.FeatureFlagUtils; import android.util.FeatureFlagUtils; import android.util.Log; import android.util.Log; Loading @@ -42,6 +43,7 @@ import com.android.bluetooth.pan.PanService; import com.android.bluetooth.pbap.BluetoothPbapService; import com.android.bluetooth.pbap.BluetoothPbapService; import com.android.bluetooth.pbapclient.PbapClientService; import com.android.bluetooth.pbapclient.PbapClientService; import com.android.bluetooth.sap.SapService; import com.android.bluetooth.sap.SapService; import com.android.server.SystemConfig; import java.util.ArrayList; import java.util.ArrayList; Loading Loading @@ -112,6 +114,11 @@ public class Config { if (resources == null) { if (resources == null) { return; return; } } SystemConfig systemConfig = SystemConfig.getInstance(); ArrayMap<String, Boolean> componentEnabledStates = null; if (systemConfig != null) { componentEnabledStates = systemConfig.getComponentsEnabledStates(ctx.getPackageName()); } ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length); ArrayList<Class> profiles = new ArrayList<>(PROFILE_SERVICES_AND_FLAGS.length); for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) { for (ProfileConfig config : PROFILE_SERVICES_AND_FLAGS) { Loading @@ -123,6 +130,13 @@ public class Config { supported = true; supported = true; } } if (componentEnabledStates != null && componentEnabledStates.containsKey(config.mClass.getName())) { supported = componentEnabledStates.get(config.mClass.getName()); Log.v(TAG, config.mClass.getSimpleName() + " Feature Flag set to " + supported + " by components configuration"); } if (supported && !isProfileDisabled(ctx, config.mMask)) { if (supported && !isProfileDisabled(ctx, config.mMask)) { Log.v(TAG, "Adding " + config.mClass.getSimpleName()); Log.v(TAG, "Adding " + config.mClass.getSimpleName()); profiles.add(config.mClass); profiles.add(config.mClass); Loading