Volume Restore is a small .NET MAUI Android app that watches the media volume (%VOLM equivalent) and restores a configured level when a trigger level is reached.
The purpose (and default setting) is to restore Google's auto lowering of detected headphone device from full(25) to low (6). This app when toggled will restore full volume within ~1second.
The app is designed for a specific volume-state workflow without internet access, accounts, analytics, or cloud services.
NOTE: The actual C# is 'vibe' coded. What came from me was the design of watching media volume instead of notifications, finding Googles auto lower level to be 6 which took some heavy debugging. and the user rocker protection.
With the default volume settings:
- Restore trigger:
6 - Restore level:
25Note this corresponds to full 100% volume - Lower pause level:
5 - Higher pause level:
7 - Pause duration:
1 minute
A direct media-volume change to 6 restores the level to 25.
The lower and higher pause levels are discrete rocker-protection events, not a range. Reaching either 5 or 7 starts or restarts the pause timer. Trigger events are ignored while the pause is active, allowing normal manual volume adjustment with the device buttons.
- Copy the signed APK to the Android device.
- Open the APK using a File manager app.
- If prompted, allow that Files source to install unknown apps.
- Install or update Volume Restore.
- Open the app and enable Event Monitoring when required.
Event monitoring defaults to off. The user must enable it with the switch near the top of the app.
The selected state is saved locally. The status below the switch reports:
ACTIVEwhen the Android service is runningSTARTINGwhile service startup is pendingOFFwhen monitoring is disabledERRORif Android rejects service startup
When enabled, monitoring uses a sticky Android foreground service. Removing the app from Android Recents does not normally stop monitoring. Android Force stop always stops the app and service until the app is opened again. After restarting the phone, open the app to start enabled monitoring again.
The app stores these settings locally with .NET MAUI Preferences:
- Level to restore to
- Restore trigger
- Lower pause level
- Higher pause level
- Pause duration in minutes
No network connection is used.
The app declares only the normal permissions required to control media volume and run the foreground monitor:
android.permission.MODIFY_AUDIO_SETTINGSandroid.permission.FOREGROUND_SERVICEandroid.permission.FOREGROUND_SERVICE_SPECIAL_USE
These permissions do not display runtime consent prompts. The app does not request notification permission. Android still requires foreground-service visibility and may show the service under Active apps.
- .NET 10 SDK with the MAUI Android workload
- Android SDK 36
- Visual Studio 2026 or the .NET CLI
- Android 7.0 (API 24) or later
The configured release publish target is Android ARM64.
dotnet build VolumeRestore.csprojdotnet publish VolumeRestore.csproj -c Release -p:PublishProfile=FolderProfileThe installable signed APK is written to:
bin\Release\net10.0-android36.0\publish\android-arm64\com.example.volumerestore-Signed.apk
Release signing is loaded from the local release-signing directory. That directory is excluded from Git and must never be committed. Back it up securely because Android updates must be signed with the same key.
Volume Restore operates entirely on the device. It does not request internet access, send telemetry, or collect personal data.
