Skip to content

Commit bb56d34

Browse files
add AlwaysAllowChargingSounds
1 parent c66cd79 commit bb56d34

File tree

10 files changed

+70
-0
lines changed

10 files changed

+70
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# AlwaysAllowChargingSounds
2+
3+
Always allow charging sounds and vibration,
4+
even when the device is in Do-not-Disturb mode.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
alias(libs.plugins.buildlogic.android.application)
3+
alias(libs.plugins.buildlogic.kotlin.android)
4+
}
5+
6+
android {
7+
namespace = "de.binarynoise.AlwaysAllowChargingSounds"
8+
9+
defaultConfig {
10+
minSdk = 28
11+
targetSdk = 36
12+
}
13+
}
14+
15+
dependencies {}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<application android:label="AlwaysAllowChargingSounds">
6+
<meta-data
7+
android:name="xposedmodule"
8+
android:value="true"
9+
/>
10+
<meta-data
11+
android:name="xposeddescription"
12+
android:value="Always allow charging sounds, even in DnD mode."
13+
/>
14+
<meta-data
15+
android:name="xposedminversion"
16+
android:value="53"
17+
/>
18+
<meta-data
19+
android:name="xposedscope"
20+
android:resource="@array/scope"
21+
/>
22+
</application>
23+
24+
</manifest>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
de.binarynoise.AlwaysAllowChargingSounds.Hook
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package de.binarynoise.AlwaysAllowChargingSounds
2+
3+
import de.robv.android.xposed.IXposedHookLoadPackage
4+
import de.robv.android.xposed.XC_MethodReplacement
5+
import de.robv.android.xposed.XposedHelpers
6+
import de.robv.android.xposed.callbacks.XC_LoadPackage
7+
8+
class Hook : IXposedHookLoadPackage {
9+
10+
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
11+
val NotifierClass = XposedHelpers.findClass("com.android.server.power.Notifier", lpparam.classLoader)
12+
XposedHelpers.findAndHookMethod(NotifierClass, "isChargingFeedbackEnabled", Int::class.java, XC_MethodReplacement.returnConstant(true))
13+
}
14+
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string-array name="scope">
4+
<item>android</item>
5+
</string-array>
6+
</resources>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Always allow charging sound and vibration,
2+
even when the device is set into Do-not-Disturb mode.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Always allow charging sounds, even in DnD mode.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AlwaysAllowChargingSounds

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencyResolutionManagement {
3939
rootProject.name = "XposedModulets"
4040

4141
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
42+
include(":AlwaysAllowChargingSounds")
4243
include(":AlwaysAllowMultiInstanceSplit")
4344
include(":AnimationScaleMod")
4445
include(":AntiBrightnessChange")

0 commit comments

Comments
 (0)