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

Commit 1ef79776 authored by Roshan Pius's avatar Roshan Pius
Browse files

package: Add a new BLE channel sounding feature flag

Rationale for adding a new feature flag:
Channel sounding is a new ranging technology supported by Bluetooth
spec. Ranging apps might want to filter based on device's support
for this new hardware feature. This is an optional BT feature, so
not all devices supporting Bluetooth may support this particular
feature. So a feature flag will be useful for apps to query/filter
to understand if ranging is possible via channel sounding or not.

Bug: 371095923
Test: Compiles
Change-Id: I364685fd25ac1069390c07faa59b9b95e3b25e44
parent fb060b28
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13109,6 +13109,7 @@ package android.content.pm {
    field public static final String FEATURE_BACKUP = "android.software.backup";
    field public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
    field public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le";
    field @FlaggedApi("com.android.ranging.flags.ranging_cs_enabled") public static final String FEATURE_BLUETOOTH_LE_CHANNEL_SOUNDING = "android.hardware.bluetooth_le.channel_sounding";
    field public static final String FEATURE_CAMERA = "android.hardware.camera";
    field public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any";
    field public static final String FEATURE_CAMERA_AR = "android.hardware.camera.ar";
+10 −0
Original line number Diff line number Diff line
@@ -3162,6 +3162,16 @@ public abstract class PackageManager {
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device is capable of ranging with
     * other devices using channel sounding via Bluetooth Low Energy radio.
     */
    @FlaggedApi(com.android.ranging.flags.Flags.FLAG_RANGING_CS_ENABLED)
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_BLUETOOTH_LE_CHANNEL_SOUNDING =
             "android.hardware.bluetooth_le.channel_sounding";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device has a camera facing away
+4 −1
Original line number Diff line number Diff line
@@ -2968,7 +2968,10 @@ public final class SystemServer implements Dumpable {
        if (com.android.ranging.flags.Flags.rangingStackEnabled()) {
            if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_UWB)
                    || context.getPackageManager().hasSystemFeature(
                            PackageManager.FEATURE_WIFI_RTT)) {
                            PackageManager.FEATURE_WIFI_RTT)
                    || (com.android.ranging.flags.Flags.rangingCsEnabled()
                            && context.getPackageManager().hasSystemFeature(
                                    PackageManager.FEATURE_BLUETOOTH_LE_CHANNEL_SOUNDING))) {
                t.traceBegin("RangingService");
                // TODO: b/375264320 - Remove after RELEASE_RANGING_STACK is ramped to next.
                try {