Logs hearing aid information when a hearing aid is bonded

The information including device mode, device side, and entry page id where the binding process starts. Set the mapped bond entry from BluetoothPairingDetail into the cached bluetooth device and log it later when the device mode and device side is received after the hearing aid bluetooth profile is connected.

Bug: 237344016
Test: m statsd_testdrive & statsd_testdrive 513

Change-Id: Ie0432f7da4f29e89e47d0ad3d72a04a9f5ea83ae
This commit is contained in:
Angela Wang
2022-07-04 08:37:19 +00:00
parent d7d1d9451b
commit cf199c96bf
2 changed files with 33 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ import static com.android.settings.accessibility.TextReadingPreferenceFragment.R
import android.content.ComponentName;
import com.android.internal.util.FrameworkStatsLog;
import com.android.settings.core.instrumentation.SettingsStatsLog;
/** Methods for logging accessibility states. */
@@ -112,4 +113,26 @@ public final class AccessibilityStatsLogUtils {
return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_UNKNOWN_ENTRY;
}
}
/**
* Converts the entering page id where the hearing aid binding process starts for logging.
*
* @param pageId the entry page id where the hearing aid binding process starts
* @return the int value for logging mapped from some page ids defined in
* {@link SettingsStatsLog}
*/
public static int convertToHearingAidInfoBondEntry(int pageId) {
switch (pageId) {
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__SETTINGS_CONNECTED_DEVICE_CATEGORY:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__CONNECTED_DEVICES;
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__DIALOG_ACCESSIBILITY_HEARINGAID:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__ACCESSIBILITY_HEARING_AIDS;
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__DIALOG_ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER;
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__BLUETOOTH_FRAGMENT:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__BLUETOOTH;
default:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__PAGE_UNKNOWN;
}
}
}