Feature/samsung routine bluetooth autostart#9
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Samsung Modes & Routines-friendly entry point to start/stop GestureService via app shortcuts / app actions, and refactors service start/stop logic into a reusable controller to support “autostart on car Bluetooth connect” workflows.
Changes:
- Add static app shortcuts and a new
RoutineTriggerActivityto start/stop the gesture listening service from external automation tools (e.g., Samsung Routines). - Introduce
GestureServiceControllerand refactorMainActivityto use it for starting/stopping and checking running state. - Update build configuration (AGP bump; packaging JNI libs config) and add Settings UI guidance for Samsung Routine setup.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| build.gradle.kts | Bumps Android Gradle Plugin version. |
| app/build.gradle.kts | Adjusts packaging configuration for JNI libs. |
| app/src/main/AndroidManifest.xml | Registers static shortcuts metadata and new exported routine trigger activity. |
| app/src/main/res/xml/shortcuts.xml | Adds static shortcuts for “Start/Stop DriveSwipe”. |
| app/src/main/res/values/strings.xml | Adds shortcut labels. |
| app/src/main/java/com/example/driveswipe/ServiceContract.kt | Adds routine start/stop action constants. |
| app/src/main/java/com/example/driveswipe/RoutineTriggerActivity.kt | New activity that starts/stops the service based on incoming action. |
| app/src/main/java/com/example/driveswipe/MainActivity.kt | Uses GestureServiceController and syncs service-running UI state. |
| app/src/main/java/com/example/driveswipe/GestureServiceController.kt | New controller for intent building, permission checks, start/stop, and running-state query. |
| app/src/main/java/com/example/driveswipe/DriveSwipeApp.kt | Adds Settings UI instructions for Samsung Routine autostart. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+48
to
+55
| <intent-filter> | ||
| <action android:name="com.example.driveswipe.action.ROUTINE_START" /> | ||
| <category android:name="android.intent.category.DEFAULT" /> | ||
| </intent-filter> | ||
| <intent-filter> | ||
| <action android:name="com.example.driveswipe.action.ROUTINE_STOP" /> | ||
| <category android:name="android.intent.category.DEFAULT" /> | ||
| </intent-filter> |
Comment on lines
+62
to
+66
| fun isRunning(context: Context): Boolean { | ||
| val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager | ||
| return activityManager.getRunningServices(Int.MAX_VALUE).any { serviceInfo -> | ||
| serviceInfo.service.className == GestureService::class.java.name | ||
| } |
| } else { | ||
| registerReceiver(serviceEventReceiver, filter) | ||
| } | ||
| viewModel.setServiceRunning(GestureServiceController.isRunning(this)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.