[PR #180] [MERGED] android: add ability to launch digital assistant on long press #316

Closed
opened 2026-03-02 12:40:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kavishdevar/librepods/pull/180
Author: @kavishdevar
Created: 7/13/2025
Status: Merged
Merged: 7/13/2025
Merged by: @kavishdevar

Base: mainHead: dev


📝 Commits (5)

  • 8033214 Initial plan
  • c9a13d1 Implement BLE-only mode toggle and basic functionality
  • 6d78807 Fix BLE-only mode compatibility issues and enhance MAC address handling
  • 04f941c Address BLE-only mode feedback: hide renaming, add ear detection warning, ensure default is false
  • f2b52aa android: add support for invoking digital assistant on long press

📊 Changes

20 files changed (+805 additions, -281 deletions)

View changed files

📝 android/app/src/main/java/me/kavishdevar/librepods/MainActivity.kt (+10 -10)
📝 android/app/src/main/java/me/kavishdevar/librepods/QuickSettingsDialogActivity.kt (+3 -5)
📝 android/app/src/main/java/me/kavishdevar/librepods/composables/BatteryView.kt (+4 -4)
📝 android/app/src/main/java/me/kavishdevar/librepods/composables/ControlCenterNoiseControlSegmentedButton.kt (+1 -1)
📝 android/app/src/main/java/me/kavishdevar/librepods/composables/IndependentToggle.kt (+1 -1)
📝 android/app/src/main/java/me/kavishdevar/librepods/composables/NoiseControlSettings.kt (+2 -2)
📝 android/app/src/main/java/me/kavishdevar/librepods/composables/PressAndHoldSettings.kt (+22 -2)
📝 android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt (+2 -115)
android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt (+42 -0)
📝 android/app/src/main/java/me/kavishdevar/librepods/screens/AirPodsSettingsScreen.kt (+64 -39)
📝 android/app/src/main/java/me/kavishdevar/librepods/screens/AppSettingsScreen.kt (+74 -0)
📝 android/app/src/main/java/me/kavishdevar/librepods/screens/DebugScreen.kt (+2 -2)
📝 android/app/src/main/java/me/kavishdevar/librepods/screens/PressAndHoldSettingsScreen.kt (+156 -46)
📝 android/app/src/main/java/me/kavishdevar/librepods/services/AirPodsQSService.kt (+2 -2)
📝 android/app/src/main/java/me/kavishdevar/librepods/services/AirPodsService.kt (+262 -20)
📝 android/app/src/main/java/me/kavishdevar/librepods/utils/AACPManager.kt (+64 -4)
📝 android/app/src/main/java/me/kavishdevar/librepods/utils/IslandWindow.kt (+21 -16)
📝 android/app/src/main/java/me/kavishdevar/librepods/utils/MediaController.kt (+45 -0)
📝 android/app/src/main/java/me/kavishdevar/librepods/utils/PopupWindow.kt (+18 -12)
android/app/src/main/res/drawable/settings_voice.xml (+10 -0)

📄 Description

This pull request refactors the codebase by reorganizing constants, improving modularity, and enhancing the PressAndHoldSettings functionality. The most significant changes include moving constants from utils to a new constants package, adding logic for customizable long-press actions, and cleaning up unused imports and code.

Refactoring and Modularization:

  • Moved constants like AirPodsNotifications, NoiseControlMode, and Battery from utils to a new constants package for better organization (android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt, android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt) [1] [2].
  • Removed unused constants and enums from the Packets file during the refactor to streamline the codebase (android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt).

Enhancements to PressAndHoldSettings:

  • Added logic to retrieve and display user-configurable long-press actions for AirPods stems using SharedPreferences. This includes support for actions like "Cycle Noise Control Modes" and "Digital Assistant" (android/app/src/main/java/me/kavishdevar/librepods/composables/PressAndHoldSettings.kt) [1] [2] [3].
  • Introduced a new StemAction enum to define possible long-press actions (android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt).

Import Cleanup:

  • Removed redundant imports and adjusted import paths to reflect the new constants package structure across multiple files (e.g., MainActivity.kt, QuickSettingsDialogActivity.kt, and BatteryView.kt) [1] [2] [3].

Minor Functional Updates:

  • Added a new bleOnlyMode setting in AirPodsSettingsScreen to support BLE-only mode configuration (android/app/src/main/java/me/kavishdevar/librepods/screens/AirPodsSettingsScreen.kt).

These changes improve code maintainability, enhance user customization options, and align with best practices for modularization.

^^ obviously ai :]


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kavishdevar/librepods/pull/180 **Author:** [@kavishdevar](https://github.com/kavishdevar) **Created:** 7/13/2025 **Status:** ✅ Merged **Merged:** 7/13/2025 **Merged by:** [@kavishdevar](https://github.com/kavishdevar) **Base:** `main` ← **Head:** `dev` --- ### 📝 Commits (5) - [`8033214`](https://github.com/kavishdevar/librepods/commit/80332142085fc7298de668aa8cef5adb4a8d030b) Initial plan - [`c9a13d1`](https://github.com/kavishdevar/librepods/commit/c9a13d1f0392dd24a1bae090267e8918a0fd68ee) Implement BLE-only mode toggle and basic functionality - [`6d78807`](https://github.com/kavishdevar/librepods/commit/6d788077107c28d40dd6bb8ae32b5237c388a823) Fix BLE-only mode compatibility issues and enhance MAC address handling - [`04f941c`](https://github.com/kavishdevar/librepods/commit/04f941cc93551c69ce3d09b5629f1e2dd8f9361c) Address BLE-only mode feedback: hide renaming, add ear detection warning, ensure default is false - [`f2b52aa`](https://github.com/kavishdevar/librepods/commit/f2b52aa775915016e407ec2a7889afcd8c0e245a) android: add support for invoking digital assistant on long press ### 📊 Changes **20 files changed** (+805 additions, -281 deletions) <details> <summary>View changed files</summary> 📝 `android/app/src/main/java/me/kavishdevar/librepods/MainActivity.kt` (+10 -10) 📝 `android/app/src/main/java/me/kavishdevar/librepods/QuickSettingsDialogActivity.kt` (+3 -5) 📝 `android/app/src/main/java/me/kavishdevar/librepods/composables/BatteryView.kt` (+4 -4) 📝 `android/app/src/main/java/me/kavishdevar/librepods/composables/ControlCenterNoiseControlSegmentedButton.kt` (+1 -1) 📝 `android/app/src/main/java/me/kavishdevar/librepods/composables/IndependentToggle.kt` (+1 -1) 📝 `android/app/src/main/java/me/kavishdevar/librepods/composables/NoiseControlSettings.kt` (+2 -2) 📝 `android/app/src/main/java/me/kavishdevar/librepods/composables/PressAndHoldSettings.kt` (+22 -2) 📝 `android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt` (+2 -115) ➕ `android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt` (+42 -0) 📝 `android/app/src/main/java/me/kavishdevar/librepods/screens/AirPodsSettingsScreen.kt` (+64 -39) 📝 `android/app/src/main/java/me/kavishdevar/librepods/screens/AppSettingsScreen.kt` (+74 -0) 📝 `android/app/src/main/java/me/kavishdevar/librepods/screens/DebugScreen.kt` (+2 -2) 📝 `android/app/src/main/java/me/kavishdevar/librepods/screens/PressAndHoldSettingsScreen.kt` (+156 -46) 📝 `android/app/src/main/java/me/kavishdevar/librepods/services/AirPodsQSService.kt` (+2 -2) 📝 `android/app/src/main/java/me/kavishdevar/librepods/services/AirPodsService.kt` (+262 -20) 📝 `android/app/src/main/java/me/kavishdevar/librepods/utils/AACPManager.kt` (+64 -4) 📝 `android/app/src/main/java/me/kavishdevar/librepods/utils/IslandWindow.kt` (+21 -16) 📝 `android/app/src/main/java/me/kavishdevar/librepods/utils/MediaController.kt` (+45 -0) 📝 `android/app/src/main/java/me/kavishdevar/librepods/utils/PopupWindow.kt` (+18 -12) ➕ `android/app/src/main/res/drawable/settings_voice.xml` (+10 -0) </details> ### 📄 Description This pull request refactors the codebase by reorganizing constants, improving modularity, and enhancing the `PressAndHoldSettings` functionality. The most significant changes include moving constants from `utils` to a new `constants` package, adding logic for customizable long-press actions, and cleaning up unused imports and code. ### Refactoring and Modularization: * Moved constants like `AirPodsNotifications`, `NoiseControlMode`, and `Battery` from `utils` to a new `constants` package for better organization (`android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt`, `android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt`) [[1]](diffhunk://#diff-38c6a0f3cf713a2b5b6365f938e6373fd45fa10c4280d1067b1f6cac6cf6cc8fL19-L50) [[2]](diffhunk://#diff-b5dd3dab30fbbebbb51c72e8c0114f7300c9f859e5cf6b524917755ec4a4911eR1-R42). * Removed unused constants and enums from the `Packets` file during the refactor to streamline the codebase (`android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt`). ### Enhancements to `PressAndHoldSettings`: * Added logic to retrieve and display user-configurable long-press actions for AirPods stems using `SharedPreferences`. This includes support for actions like "Cycle Noise Control Modes" and "Digital Assistant" (`android/app/src/main/java/me/kavishdevar/librepods/composables/PressAndHoldSettings.kt`) [[1]](diffhunk://#diff-f40710be2bc14b0d4ec976f6867cb645b7726e1f24e7ab58c4000f6fbc491c3dR75-R92) [[2]](diffhunk://#diff-f40710be2bc14b0d4ec976f6867cb645b7726e1f24e7ab58c4000f6fbc491c3dL125-R145) [[3]](diffhunk://#diff-f40710be2bc14b0d4ec976f6867cb645b7726e1f24e7ab58c4000f6fbc491c3dL185-R205). * Introduced a new `StemAction` enum to define possible long-press actions (`android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt`). ### Import Cleanup: * Removed redundant imports and adjusted import paths to reflect the new `constants` package structure across multiple files (e.g., `MainActivity.kt`, `QuickSettingsDialogActivity.kt`, and `BatteryView.kt`) [[1]](diffhunk://#diff-ffd24efb06649a7a9a68230a7fefa70b5c86c3e8dfdf0b58b4de9375d6782d66R107) [[2]](diffhunk://#diff-5351ad0d69db7d23d94e6b92f1c20d37013c4b94a260dc38c52eac7f2e2a8832L65-L80) [[3]](diffhunk://#diff-214d2a871b5d491205cb8e8274ce5603f2c492d7420793b9e55281cb6bb485e7R50-L54). ### Minor Functional Updates: * Added a new `bleOnlyMode` setting in `AirPodsSettingsScreen` to support BLE-only mode configuration (`android/app/src/main/java/me/kavishdevar/librepods/screens/AirPodsSettingsScreen.kt`). These changes improve code maintainability, enhance user customization options, and align with best practices for modularization. ^^ obviously ai :] --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 12:40:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librepods#316
No description provided.