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

Commit 33600e82 authored by Angela Wang's avatar Angela Wang
Browse files

Fix LE Audio toggle missing issue for dual mode hearing device

After the code change of ag/28283226, they hide the LE Audio toggle for
LE Audio only device since turning off the profile may cause this device
no functioning. But the dual mode hearing devices(LE Audio + Asha) are
wrongly recognized as LE Audio only devices since
HearingAidProfile.accessProfileEnabled() return false. This make the
users lost the ability to switch between profiles they preferred.

Make HearingAidProfile.accessProfileEnabled() return true and hide the
Hearing Aid toggle by default since it's also meaningless to turn off
the Asha profile for Asha-only devices.

Flag: com.android.settingslib.flags.asha_profile_access_profile_enabled_true
Bug: 356530795
Test: manual checking the UI
Change-Id: I7e20416fccbefad484cf9e5106248984e61216c2
parent aa86e4a7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -109,3 +109,13 @@ flag {
    description: "Settings catalyst project migration"
    bug: "323791114"
}

flag {
  name: "asha_profile_access_profile_enabled_true"
  namespace: "accessibility"
  description: "Changes the return value of HearingAidProfile.accessProfileEnabled() to true"
  bug: "356530795"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+2 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import androidx.annotation.NonNull;

import com.android.settingslib.R;
import com.android.settingslib.Utils;
import com.android.settingslib.flags.Flags;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -141,7 +142,7 @@ public class HearingAidProfile implements LocalBluetoothProfile {
    }

    public boolean accessProfileEnabled() {
        return false;
        return Flags.ashaProfileAccessProfileEnabledTrue();
    }

    public boolean isAutoConnectable() {