[PR #141] feature: Add persistent notification for wireless pairing (Fixes non-split-screen pairing) #139

Open
opened 2026-03-04 02:11:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/tytydraco/LADB/pull/141
Author: @Golgrax
Created: 12/20/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • 030589f feat: add persistent notification for wireless pairing with RemoteInput

📊 Changes

7 files changed (+330 additions, -9 deletions)

View changed files

📝 app/src/main/AndroidManifest.xml (+12 -0)
app/src/main/java/com/draco/ladb/receivers/PairingReceiver.kt (+188 -0)
app/src/main/java/com/draco/ladb/services/PairingService.kt (+77 -0)
📝 app/src/main/java/com/draco/ladb/utils/ADB.kt (+15 -8)
📝 app/src/main/java/com/draco/ladb/views/MainActivity.kt (+32 -1)
📝 app/src/main/res/menu/main.xml (+5 -0)
📝 app/src/main/res/values/strings.xml (+1 -0)

📄 Description

This PR addresses a major UX barrier for devices that do not support split-screen or floating windows.

This new feature allows the user to complete the entire pairing and connection process directly from the notification shade while the Developer Options screen remains open in the foreground.

Key Features

  • Two-Step Stateful Pairing:

  • Step 1: User inputs the Port (or IP:Port) via the notification.

  • Step 2: The notification updates to ask for the Pairing Code.

  • The app statefully remembers the port between steps, providing a clean, conversational flow.

  • Real-time Feedback: Displays actual output logs from the ADB command in the notification text (e.g., "Successfully paired" or real error messages like "Wrong password").

  • Automatic Connection: Immediately triggers mDNS discovery and initServer() upon successful pairing, ensuring the app is connected and ready to use as soon as the user returns to it.

  • Dynamic UI: The input field and "Enter" button automatically disappear once the status reaches "Connected!", leaving a clean confirmation message.

  • Retry Mechanism: If pairing fails, a "Retry" action button appears to reset the flow without needing to reopen the app.

Sample Testing

View Screenshots
  1. Open the LADB app
1
  1. Select "Pairing Notification" from the menu.
2

Allow it.

3
  1. Navigate to Developer Options > Wireless Debugging > Pair with pairing code.
4
  1. Expand the LADB notification.
  2. Enter the Port -> Tap Enter.
5
  1. Enter the Code -> Tap Enter.
image
  1. Verify the notification says "Connected! You can now use LADB." and the input field hides.
    image
image
  1. Return to LADB and verify the shell is active.
image

🔄 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/tytydraco/LADB/pull/141 **Author:** [@Golgrax](https://github.com/Golgrax) **Created:** 12/20/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`030589f`](https://github.com/tytydraco/LADB/commit/030589fbcd809b43f8090a4cb52846edac2d1a22) feat: add persistent notification for wireless pairing with RemoteInput ### 📊 Changes **7 files changed** (+330 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/AndroidManifest.xml` (+12 -0) ➕ `app/src/main/java/com/draco/ladb/receivers/PairingReceiver.kt` (+188 -0) ➕ `app/src/main/java/com/draco/ladb/services/PairingService.kt` (+77 -0) 📝 `app/src/main/java/com/draco/ladb/utils/ADB.kt` (+15 -8) 📝 `app/src/main/java/com/draco/ladb/views/MainActivity.kt` (+32 -1) 📝 `app/src/main/res/menu/main.xml` (+5 -0) 📝 `app/src/main/res/values/strings.xml` (+1 -0) </details> ### 📄 Description This PR addresses a major UX barrier for devices that do not support split-screen or floating windows. This new feature allows the user to complete the entire pairing and connection process directly from the notification shade while the Developer Options screen remains open in the foreground. # Key Features * Two-Step Stateful Pairing: * Step 1: User inputs the Port (or IP:Port) via the notification. * Step 2: The notification updates to ask for the Pairing Code. * The app statefully remembers the port between steps, providing a clean, conversational flow. * Real-time Feedback: Displays actual output logs from the ADB command in the notification text (e.g., "Successfully paired" or real error messages like "Wrong password"). * Automatic Connection: Immediately triggers mDNS discovery and initServer() upon successful pairing, ensuring the app is connected and ready to use as soon as the user returns to it. * Dynamic UI: The input field and "Enter" button automatically disappear once the status reaches "Connected!", leaving a clean confirmation message. * Retry Mechanism: If pairing fails, a "Retry" action button appears to reset the flow without needing to reopen the app. # Sample Testing <details> <summary><b>View Screenshots</b></summary> 1. Open the LADB app <img width="250" height="1600" alt="1" src="https://github.com/user-attachments/assets/599b8d4a-4e7a-4a6f-863d-de0b69440b96" /> 2. Select "Pairing Notification" from the menu. <img width="250" height="1600" alt="2" src="https://github.com/user-attachments/assets/049e0905-54cc-49e1-8d1d-1bf0830f5840" /> Allow it. <img width="250" height="1600" alt="3" src="https://github.com/user-attachments/assets/ddcb175d-424c-4bb7-8b4b-8db7fc2f4c7e" /> 3. Navigate to Developer Options > Wireless Debugging > Pair with pairing code. <img width="250" height="1600" alt="4" src="https://github.com/user-attachments/assets/d46ab9d6-ee7a-4c06-8c4f-f7132383bf9e" /> 4. Expand the LADB notification. 5. Enter the Port -> Tap Enter. <img width="250" height="1600" alt="5" src="https://github.com/user-attachments/assets/df31cd14-9616-4f46-8500-fca89fe881ac" /> 6. Enter the Code -> Tap Enter. <img width="250" height="1600" alt="image" src="https://github.com/user-attachments/assets/936436e8-9b50-4322-a408-bb99ac84e7aa" /> 7. Verify the notification says "Connected! You can now use LADB." and the input field hides. <img width="250" height="1600" alt="image" src="https://github.com/user-attachments/assets/42fe2121-9911-45fa-8ae8-acc0eaa26458" /> <img width="250" height="1600" alt="image" src="https://github.com/user-attachments/assets/4441d014-49e6-4d58-bbfa-2526c66c8fc3" /> 8. Return to LADB and verify the shell is active. <img width="250" height="1600" alt="image" src="https://github.com/user-attachments/assets/b17f4b2a-f2ee-4683-836e-47f41e38307b" /> </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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/LADB#139
No description provided.